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

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

Issue 2121043002: 16 bpp video stream capture, render and WebGL usage - Realsense R200 & SR300 support. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 2 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
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 85f0a2948c7586ce94c82b43916f65668e3426d9..324596788ed78044967a2bcffb1a0e61ae909468 100644
--- a/content/browser/renderer_host/media/video_capture_controller.cc
+++ b/content/browser/renderer_host/media/video_capture_controller.cc
@@ -218,7 +218,8 @@ void VideoCaptureController::AddClient(
// Check that requested VideoCaptureParams are valid and supported. If not,
// report an error immediately and punt.
if (!params.IsValid() ||
- params.requested_format.pixel_format != media::PIXEL_FORMAT_I420 ||
+ !(params.requested_format.pixel_format == media::PIXEL_FORMAT_I420 ||
+ params.requested_format.pixel_format == media::PIXEL_FORMAT_Y16) ||
params.requested_format.pixel_storage != media::PIXEL_STORAGE_CPU) {
// Crash in debug builds since the renderer should not have asked for
// invalid or unsupported parameters.
@@ -421,8 +422,9 @@ void VideoCaptureController::OnIncomingCapturedVideoFrame(
new base::DictionaryValue());
frame->metadata()->MergeInternalValuesInto(metadata.get());
- // Only I420 pixel format is currently supported.
- DCHECK_EQ(frame->format(), media::PIXEL_FORMAT_I420)
+ // Only I420 and Y16 pixel formats are currently supported.
+ DCHECK(frame->format() == media::PIXEL_FORMAT_I420 ||
+ frame->format() == media::PIXEL_FORMAT_Y16)
<< "Unsupported pixel format: "
<< media::VideoPixelFormatToString(frame->format());

Powered by Google App Engine
This is Rietveld 408576698