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

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: fix windows approach and video_capture_utils. 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 4c6b21619b2de28f55d5e6f1aeb935a028326d36..82201607726dcdf0c68f348328dc5422ab54db1a 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -428,11 +428,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);
danakj 2016/10/24 21:46:37 use chromium style please for isYuvPlanar
aleksandar.stojiljkovic 2016/10/25 10:12:28 Done.
+ if (!(isYuvPlanar || input_frame_format == media::PIXEL_FORMAT_Y16)) {
NOTREACHED() << media::VideoPixelFormatToString(input_frame_format);
danakj 2016/10/24 21:46:37 Hm where did this NOTREACHED();return; come from?
aleksandar.stojiljkovic 2016/10/25 10:12:28 NOTREACHED();return; is there from previous code;
return VideoFrameExternalResources();
}
@@ -440,7 +438,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)
+ : ResourceFormat::RGBA_8888;
danakj 2016/10/24 21:46:37 Can you leave a comment explaining this in the con
aleksandar.stojiljkovic 2016/10/25 10:12:28 Done. Thanks.
// 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