Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5094)

Unified Diff: content/browser/renderer_host/media/video_capture_controller.cc

Issue 882883004: Don't forward frames that can't be converted to I420. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/video_capture_controller.cc
diff --git a/content/browser/renderer_host/media/video_capture_controller.cc b/content/browser/renderer_host/media/video_capture_controller.cc
index f35ea57504c98675fb2c2f7eb21b1871d1a57f82..8ff97bdf767d93c8821ef401ec33b229dfc31348 100644
--- a/content/browser/renderer_host/media/video_capture_controller.cc
+++ b/content/browser/renderer_host/media/video_capture_controller.cc
@@ -469,23 +469,29 @@ void VideoCaptureController::VideoCaptureDeviceClient::OnIncomingCapturedData(
NOTREACHED();
}
- libyuv::ConvertToI420(data,
- length,
- yplane,
- yplane_stride,
- uplane,
- uv_plane_stride,
- vplane,
- uv_plane_stride,
- crop_x,
- crop_y,
- frame_format.frame_size.width(),
- (flip ? -frame_format.frame_size.height() :
+ if (libyuv::ConvertToI420(data,
+ length,
+ yplane,
+ yplane_stride,
+ uplane,
+ uv_plane_stride,
+ vplane,
+ uv_plane_stride,
+ crop_x,
+ crop_y,
+ frame_format.frame_size.width(),
+ (flip ? -frame_format.frame_size.height() :
frame_format.frame_size.height()),
- new_unrotated_width,
- new_unrotated_height,
- rotation_mode,
- origin_colorspace);
+ new_unrotated_width,
+ new_unrotated_height,
+ rotation_mode,
+ origin_colorspace) != 0) {
+ DLOG(WARNING) << "Failed to convert buffer from"
+ << media::VideoCaptureFormat::PixelFormatToString(
+ frame_format.pixel_format)
+ << "to I420.";
+ return;
+ }
scoped_refptr<media::VideoFrame> frame =
media::VideoFrame::WrapExternalPackedMemory(
media::VideoFrame::I420,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698