summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authormcasas@chromium.org <mcasas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-04 06:24:04 +0000
committermcasas@chromium.org <mcasas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-04 06:24:04 +0000
commit73958b6d336effc4a0954bb038e149df1b1a3369 (patch)
treefb255d3090b1e6ba9878a66521d73d01e2c46b13 /media
parentdc78df46e124d2d17b694235f89760a4f9b9a9dc (diff)
downloadchromium_src-73958b6d336effc4a0954bb038e149df1b1a3369.zip
chromium_src-73958b6d336effc4a0954bb038e149df1b1a3369.tar.gz
chromium_src-73958b6d336effc4a0954bb038e149df1b1a3369.tar.bz2
Mac Video Capture: resolution changes policy for QTKit/AVFoundation.
The captured frame received in VideoCaptureDeviceMac::ReceiveFrame() might change resolution if the camera gets reconfigured by another QTKit/AVFoundation client: other Chrome, FF, etc. If QTKit resolution changes it hits the DCHECKs in [1], causing a browser crash http://crbug.com/353620. Instead, update the |capture_format_| frame_size to the received one. AVFoundation should never see a resolution change since the AVCaptureVideoDataOutput is configured to resize. If this happens, signal an error. [1] https://code.google.com/p/chromium/codesearch#chromium/src/media/video/capture/mac/video_capture_device_mac.mm&q=video%20capture%20mac&sq=package:chromium&type=cs&l=301 BUG=288562, 353620 Review URL: https://codereview.chromium.org/223593003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261690 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/video/capture/mac/video_capture_device_mac.mm14
1 files changed, 10 insertions, 4 deletions
diff --git a/media/video/capture/mac/video_capture_device_mac.mm b/media/video/capture/mac/video_capture_device_mac.mm
index 7b88037..75f3937 100644
--- a/media/video/capture/mac/video_capture_device_mac.mm
+++ b/media/video/capture/mac/video_capture_device_mac.mm
@@ -298,10 +298,16 @@ void VideoCaptureDeviceMac::ReceiveFrame(
}
}
- DCHECK_EQ(capture_format_.frame_size.width(),
- frame_format.frame_size.width());
- DCHECK_EQ(capture_format_.frame_size.height(),
- frame_format.frame_size.height());
+ // QTKit capture source can change resolution if someone else reconfigures the
+ // camera, and that is fine: http://crbug.com/353620. In AVFoundation, this
+ // should not happen, it should resize internally.
+ if (!AVFoundationGlue::IsAVFoundationSupported()) {
+ capture_format_.frame_size = frame_format.frame_size;
+ } else if (capture_format_.frame_size != frame_format.frame_size) {
+ ReceiveError("Captured resolution " + frame_format.frame_size.ToString() +
+ ", and expected " + capture_format_.frame_size.ToString());
+ return;
+ }
client_->OnIncomingCapturedData(video_frame,
video_frame_length,