Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose bytesused to users #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ReactorScram
Copy link

@ReactorScram ReactorScram commented Sep 9, 2023

This lets users copy JPEG frames better.
Previously, when you read JPEG frames, it tells you the length of the frame is size_image, the maximum possible length. So it copies a bunch of zeroes and then if you write them to a file, the file is bigger than the actual JPEG contents.

_ added 2 commits September 9, 2023 13:32
When capturing JPEG frames, v4l will tell us that the JPEG can be as
big as the decoded YUV frame, like 4 MB for a 1080p frame.
But typically the JPEG is only 500 KB or so. Exposing bytesused
allows callers to copy less data and write precisely-sized JPEG frames
@ReactorScram
Copy link
Author

Looks like this commit does the same thing? c6925e5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant