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

Unified Diff: media/filters/skcanvas_video_renderer.cc

Issue 88403004: Add plumbing for video pixel formats with JPEG color range. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add YV12J to a DCHECK Created 7 years 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 | « media/filters/ffmpeg_video_decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/skcanvas_video_renderer.cc
diff --git a/media/filters/skcanvas_video_renderer.cc b/media/filters/skcanvas_video_renderer.cc
index f0bf13d4bb8e9d0ab3cef4cb678ab59597232851..ec3e92fe754be1cb895f0f8f64a3ff289ef6dd94 100644
--- a/media/filters/skcanvas_video_renderer.cc
+++ b/media/filters/skcanvas_video_renderer.cc
@@ -13,7 +13,9 @@
namespace media {
static bool IsEitherYV12OrYV16(media::VideoFrame::Format format) {
- return format == media::VideoFrame::YV12 || format == media::VideoFrame::YV16;
+ return format == media::VideoFrame::YV12 ||
+ format == media::VideoFrame::YV16 ||
+ format == media::VideoFrame::YV12J;
}
static bool IsEitherYV12OrYV16OrNative(media::VideoFrame::Format format) {
@@ -87,6 +89,11 @@ static void FastPaint(
y_shift = 1;
}
+ if (video_frame->format() == media::VideoFrame::YV12J) {
+ yuv_type = media::YV12;
+ y_shift = 1;
+ }
+
// Transform the destination rectangle to local coordinates.
const SkMatrix& local_matrix = canvas->getTotalMatrix();
SkRect local_dest_rect;
@@ -217,8 +224,10 @@ static void ConvertVideoFrameToBitmap(
(video_frame->visible_rect().y() >> y_shift)) +
(video_frame->visible_rect().x() >> 1);
}
+
switch (video_frame->format()) {
case media::VideoFrame::YV12:
+ case media::VideoFrame::YV12J:
media::ConvertYUVToRGB32(
video_frame->data(media::VideoFrame::kYPlane) + y_offset,
video_frame->data(media::VideoFrame::kUPlane) + uv_offset,
« no previous file with comments | « media/filters/ffmpeg_video_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698