Skip to content

Commit

Permalink
Write colorbuffer directly to io if it fits in format
Browse files Browse the repository at this point in the history
  • Loading branch information
jkrumbiegel committed Oct 12, 2024
1 parent 2acd423 commit 941da84
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ffmpeg-util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,12 @@ function recordframe!(io::VideoStream)
# Make no copy if already Matrix{RGB{N0f8}}
# There may be a 1px padding for odd dimensions
xdim, ydim = size(glnative)
copy!(view(io.buffer, 1:xdim, 1:ydim), glnative)
write(io.io, io.buffer)
if eltype(glnative) == eltype(io.buffer) && size(glnative) == size(io.buffer)
write(io.io, glnative)
else
copy!(view(io.buffer, 1:xdim, 1:ydim), glnative)
write(io.io, io.buffer)
end
next_tick!(io.tick_controller)
return
end
Expand Down

0 comments on commit 941da84

Please sign in to comment.