[macOS] SampleBufferTransformer: Avoid using libyuv::MJPGSize().
I looked at the implementation of libyuv::MJPGSize() and discovered that part of "loading" the data required validating it, which involves reading up to 1 kB of bytes looking for an End of Image marker. Loading and unloading it like this seems like an awful waste if all we want to do is get the width and height... Luckily, the CVSampleBuffer contains a format description that has the dimensions, which I assume means getting them without reading 1 kB of raw data. This CL gets the dimensions that way instead of libyuv::MJPGSize(). (Note that libyuv::MJPGSize() is still used for sanity-checking inside of the unit tests.) Bug: chromium:1132299 Change-Id: I2c32bc319d3ae61cd6ea863ce59ab38f9fdd9d0d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2517948 Commit-Queue: Henrik Boström <hbos@chromium.org> Reviewed-by:Ilya Nikolaevskiy <ilnik@chromium.org> Cr-Commit-Position: refs/heads/master@{#824028}
Showing
Please register or sign in to comment