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

Unified Diff: media/blink/skcanvas_video_renderer.cc

Issue 1236313002: Use skia to do accelerated YUV conversion for rec709 'HD' color space in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/skcanvas_video_renderer.cc
diff --git a/media/blink/skcanvas_video_renderer.cc b/media/blink/skcanvas_video_renderer.cc
index 16c7d87b4c341bce711b083936c8f3a8c4da04e7..50d1c7e3879c310af4a9fd63b46e1355649876e5 100644
--- a/media/blink/skcanvas_video_renderer.cc
+++ b/media/blink/skcanvas_video_renderer.cc
@@ -153,11 +153,11 @@ scoped_ptr<SkImage> CreateSkImageFromVideoFrameYUVTextures(
{uv_tex_size.width(), uv_tex_size.height()},
};
- // TODO(dcastagna): Skia currently doesn't support Rec709 YUV conversion.
- DCHECK(!CheckColorSpace(video_frame, media::COLOR_SPACE_HD_REC709));
SkYUVColorSpace color_space = kRec601_SkYUVColorSpace;
if (CheckColorSpace(video_frame, media::COLOR_SPACE_JPEG))
color_space = kJPEG_SkYUVColorSpace;
+ else if (CheckColorSpace(video_frame, media::COLOR_SPACE_HD_REC709))
+ color_space = kRec709_SkYUVColorSpace;
SkImage* img = SkImage::NewFromYUVTexturesCopy(context_3d.gr_context,
color_space, handles, yuvSizes,
@@ -232,10 +232,9 @@ class VideoImageGenerator : public SkImageGenerator {
size_t row_bytes[3],
SkYUVColorSpace* color_space) override {
if (!frame_.get() || !media::IsYuvPlanar(frame_->format()) ||
- // TODO(rileya): Skia currently doesn't support Rec709 YUV conversion,
- // or YUVA conversion. Remove this case once it does. As-is we will
- // fall back on the pure-software path in this case.
- CheckColorSpace(frame_, COLOR_SPACE_HD_REC709) ||
+ // TODO(rileya): Skia currently doesn't support YUVA conversion. Remove
+ // this case once it does. As-is we will fall back on the pure-software
+ // path in this case.
frame_->format() == PIXEL_FORMAT_YV12A) {
return false;
}
@@ -243,6 +242,8 @@ class VideoImageGenerator : public SkImageGenerator {
if (color_space) {
if (CheckColorSpace(frame_, COLOR_SPACE_JPEG))
*color_space = kJPEG_SkYUVColorSpace;
+ else if (CheckColorSpace(frame_, COLOR_SPACE_HD_REC709))
+ *color_space = kRec709_SkYUVColorSpace;
else
*color_space = kRec601_SkYUVColorSpace;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698