Commit bcd4dab1 authored by Henrik Boström's avatar Henrik Boström Committed by Commit Bot

[macOS Capture] SampleBufferTransformer: CHECK that "sample" is MJPEG.

In https://crbug.com/1148964 it was discovered that assumptions that
SampleBufferTransformer was making did not always hold.

For example, SBT assumed that if the camera produced pixel buffers then
those pixels buffers would contain IOSurfaces, but this was not always
the case. This was fixed so now I'm looking at other assumptions.

Similarly, SBT assumes that if the camera produces a SampleBuffer that
doesn't have a pixel buffer, this must be the MJPEG case. This CL
promotes a DCHECK for this into a CHECK so that we don't run the risk
of having hard-to-debug crashes happening if there are any cameras out
there in the wild where this does not hold (hopefully not).

Bug: chromium:1148964
Change-Id: I3e063dd7ed48962d31c7fd46a9a66de7e8337498
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2554597
Commit-Queue: Henrik Boström <hbos@chromium.org>
Commit-Queue: Markus Handell <handellm@google.com>
Auto-Submit: Henrik Boström <hbos@chromium.org>
Reviewed-by: default avatarMarkus Handell <handellm@google.com>
Cr-Commit-Position: refs/heads/master@{#830135}
parent dccda1f3
...@@ -646,7 +646,7 @@ bool SampleBufferTransformer::TransformSampleBuffer( ...@@ -646,7 +646,7 @@ bool SampleBufferTransformer::TransformSampleBuffer(
CMSampleBufferGetFormatDescription(source_sample_buffer); CMSampleBufferGetFormatDescription(source_sample_buffer);
FourCharCode source_pixel_format = FourCharCode source_pixel_format =
CMFormatDescriptionGetMediaSubType(source_format_description); CMFormatDescriptionGetMediaSubType(source_format_description);
DCHECK(source_pixel_format == kPixelFormatMjpeg); CHECK_EQ(source_pixel_format, kPixelFormatMjpeg);
CMVideoDimensions source_dimensions = CMVideoDimensions source_dimensions =
CMVideoFormatDescriptionGetDimensions(source_format_description); CMVideoFormatDescriptionGetDimensions(source_format_description);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment