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

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: 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: cc/resources/video_resource_updater.cc
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc
index 9fe434f3837211b63d4ded74b8b39ced0a398b20..3b5bed2ac65e495879a72ac39dc3464351be3239 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -358,11 +358,9 @@ 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.
- if (!media::IsYuvPlanar(input_frame_format)) {
+ // Only YUV and Y16 software video frames are supported.
+ const bool isYuvPlanar = media::IsYuvPlanar(input_frame_format);
+ if (!(isYuvPlanar || input_frame_format == media::PIXEL_FORMAT_Y16)) {
NOTREACHED() << media::VideoPixelFormatToString(input_frame_format);
return VideoFrameExternalResources();
}
@@ -370,7 +368,8 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes(
const bool software_compositor = context_provider_ == NULL;
ResourceFormat output_resource_format =
- resource_provider_->YuvResourceFormat(bits_per_channel);
+ isYuvPlanar ? resource_provider_->YuvResourceFormat(bits_per_channel)
aleksandar.stojiljkovic 2016/10/20 21:52:49 Check above only allows Yuv and Y16, so ResourceFo
+ : ResourceFormat::RGBA_8888;
// 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