diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-13 22:16:17 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-13 22:16:17 +0000 |
commit | d4833b74f7042a84c85ffc73b9fdf26f515d9ab8 (patch) | |
tree | ec5ed59bff3827a8dfcbf6d2e88b838ad30bce77 /media/base/video_frame.cc | |
parent | 3e2694fa1dc6404cc1739bccf865fc71393f0c03 (diff) | |
download | chromium_src-d4833b74f7042a84c85ffc73b9fdf26f515d9ab8.zip chromium_src-d4833b74f7042a84c85ffc73b9fdf26f515d9ab8.tar.gz chromium_src-d4833b74f7042a84c85ffc73b9fdf26f515d9ab8.tar.bz2 |
Refactor webkit_media::VideoRendererImpl into standalone class.
As a follow up to r115583 VideoRendererImpl no longer extends VideoRendererBase and instead is a standalone class whose sole purpose is to paint VideoFrames to SkCanvases.
BUG=28208
Review URL: http://codereview.chromium.org/9024019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117711 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/video_frame.cc')
-rw-r--r-- | media/base/video_frame.cc | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc index 918b3d3..7e7e60c 100644 --- a/media/base/video_frame.cc +++ b/media/base/video_frame.cc @@ -1,10 +1,11 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "media/base/video_frame.h" #include "base/logging.h" +#include "media/base/video_util.h" namespace media { @@ -79,27 +80,7 @@ scoped_refptr<VideoFrame> VideoFrame::CreateBlackFrame(int width, int height) { // Now set the data to YUV(0,128,128). const uint8 kBlackY = 0x00; const uint8 kBlackUV = 0x80; - - // Fill the Y plane. - uint8* y_plane = frame->data(VideoFrame::kYPlane); - for (size_t i = 0; i < frame->height_; ++i) { - memset(y_plane, kBlackY, frame->width_); - y_plane += frame->stride(VideoFrame::kYPlane); - } - - // Fill the U and V planes. - uint8* u_plane = frame->data(VideoFrame::kUPlane); - uint8* v_plane = frame->data(VideoFrame::kVPlane); - int uv_rows = frame->rows(VideoFrame::kUPlane); - int u_row_bytes = frame->row_bytes(VideoFrame::kUPlane); - int v_row_bytes = frame->row_bytes(VideoFrame::kVPlane); - for (size_t i = 0; i < (size_t)uv_rows; ++i) { - memset(u_plane, kBlackUV, u_row_bytes); - memset(v_plane, kBlackUV, v_row_bytes); - u_plane += frame->stride(VideoFrame::kUPlane); - v_plane += frame->stride(VideoFrame::kVPlane); - } - + FillYUV(frame, kBlackY, kBlackUV, kBlackUV); return frame; } |