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

Unified Diff: cc/resources/video_resource_updater.cc

Issue 2428263004: 16 bpp video stream capture, render and createImageBitmap(video) using (CPU) shared memory buffers (Closed)
Patch Set: Split webrtc_depth_capture_browsertest. Thanks phoglund@, Created 4 years, 1 month 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: cc/resources/video_resource_updater.cc
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc
index 02986b4ca30f290c13807ad78a240e9a50943bb9..2ea3f4691eaeee32cbf94f12bde5951088415aeb 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -428,16 +428,22 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes(
break;
}
- // TODO(dshwang): support PIXEL_FORMAT_Y16. crbug.com/624436
- DCHECK_NE(bits_per_channel, 16);
-
- // Only YUV software video frames are supported.
- DCHECK(media::IsYuvPlanar(input_frame_format));
+ // Only YUV and Y16 software video frames are supported.
+ DCHECK(media::IsYuvPlanar(input_frame_format) ||
+ input_frame_format == media::PIXEL_FORMAT_Y16);
const bool software_compositor = context_provider_ == NULL;
- ResourceFormat output_resource_format =
- resource_provider_->YuvResourceFormat(bits_per_channel);
+ ResourceFormat output_resource_format;
+ if (input_frame_format == media::PIXEL_FORMAT_Y16) {
+ // Unable to display directly as yuv planes so convert it to RGBA for
+ // compositing.
+ output_resource_format = RGBA_8888;
+ } else {
+ // Can be composited directly from yuv planes.
+ output_resource_format =
+ resource_provider_->YuvResourceFormat(bits_per_channel);
+ }
// If GPU compositing is enabled, but the output resource format
// returned by the resource provider is RGBA_8888, then a GPU driver

Powered by Google App Engine
This is Rietveld 408576698