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

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

Issue 2398463003: 16 bit capture and GPU&CPU memory buffer support.
Patch Set: fixes. 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 c594c3bb11a6d638bc76f4601e830463b191a41d..2f0215dd6cfff0c94878635917a38938c2a47d96 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 &&
params.requested_format.pixel_storage !=
media::PIXEL_STORAGE_GPUMEMORYBUFFER)) {
@@ -423,8 +424,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());
@@ -525,7 +527,8 @@ void VideoCaptureController::DoNewBufferOnIOThread(
handles.push_back(remote_handle);
}
client->event_handler->OnBufferCreated2(client->controller_id, handles,
- buffer->dimensions(), buffer_id);
+ buffer->dimensions(),
+ frame->format(), buffer_id);
break;
}
case media::VideoFrame::STORAGE_SHMEM: {

Powered by Google App Engine
This is Rietveld 408576698