diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-23 22:34:24 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-23 22:34:24 +0000 |
commit | 34f993563386ad569f3674d157153e697e847e0a (patch) | |
tree | bb12aa46242ad8534f51387cca789375ba92f10f /chrome | |
parent | 5ff5ee97910c9fb6909f4a3029427edd21366d9b (diff) | |
download | chromium_src-34f993563386ad569f3674d157153e697e847e0a.zip chromium_src-34f993563386ad569f3674d157153e697e847e0a.tar.gz chromium_src-34f993563386ad569f3674d157153e697e847e0a.tar.bz2 |
Merged VideoSurface, VideoFrame and VideoFrameImpl in VideoFrame.
Patch by sergeyu@chromium.org
BUG=28100
TEST=Ran media_unittests
Review URL: http://codereview.chromium.org/1226001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42391 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/renderer/media/ipc_video_renderer.cc | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/chrome/renderer/media/ipc_video_renderer.cc b/chrome/renderer/media/ipc_video_renderer.cc index 0a98489..c5bac86 100644 --- a/chrome/renderer/media/ipc_video_renderer.cc +++ b/chrome/renderer/media/ipc_video_renderer.cc @@ -6,7 +6,7 @@ #include "chrome/common/render_messages.h" #include "chrome/renderer/render_thread.h" -#include "media/base/buffers.h" +#include "media/base/video_frame.h" #include "media/base/media_format.h" IPCVideoRenderer::IPCVideoRenderer( @@ -123,39 +123,37 @@ void IPCVideoRenderer::DoUpdateVideo() { return; } - media::VideoSurface surface; - CHECK(frame->Lock(&surface)); - CHECK(surface.width == static_cast<size_t>(video_size_.width())); - CHECK(surface.height == static_cast<size_t>(video_size_.height())); - CHECK(surface.format == media::VideoSurface::YV12); - CHECK(surface.planes == 3); + CHECK(frame->width() == static_cast<size_t>(video_size_.width())); + CHECK(frame->height() == static_cast<size_t>(video_size_.height())); + CHECK(frame->format() == media::VideoFrame::YV12); + CHECK(frame->planes() == 3); uint8* dest = reinterpret_cast<uint8*>(transport_dib_->memory()); // Copy Y plane. - const uint8* src = surface.data[media::VideoSurface::kYPlane]; - size_t stride = surface.strides[media::VideoSurface::kYPlane]; - for (size_t row = 0; row < surface.height; ++row) { - memcpy(dest, src, surface.width); - dest += surface.width; + const uint8* src = frame->data(media::VideoFrame::kYPlane); + size_t stride = frame->stride(media::VideoFrame::kYPlane); + for (size_t row = 0; row < frame->height(); ++row) { + memcpy(dest, src, frame->width()); + dest += frame->width(); src += stride; } // Copy U plane. - src = surface.data[media::VideoSurface::kUPlane]; - stride = surface.strides[media::VideoSurface::kUPlane]; - for (size_t row = 0; row < surface.height / 2; ++row) { - memcpy(dest, src, surface.width / 2); - dest += surface.width / 2; + src = frame->data(media::VideoFrame::kUPlane); + stride = frame->stride(media::VideoFrame::kUPlane); + for (size_t row = 0; row < frame->height() / 2; ++row) { + memcpy(dest, src, frame->width() / 2); + dest += frame->width() / 2; src += stride; } // Copy V plane. - src = surface.data[media::VideoSurface::kVPlane]; - stride = surface.strides[media::VideoSurface::kVPlane]; - for (size_t row = 0; row < surface.height / 2; ++row) { - memcpy(dest, src, surface.width / 2); - dest += surface.width / 2; + src = frame->data(media::VideoFrame::kVPlane); + stride = frame->stride(media::VideoFrame::kVPlane); + for (size_t row = 0; row < frame->height() / 2; ++row) { + memcpy(dest, src, frame->width() / 2); + dest += frame->width() / 2; src += stride; } @@ -167,8 +165,6 @@ void IPCVideoRenderer::DoUpdateVideo() { Send(new ViewHostMsg_UpdateVideo(routing_id_, transport_dib_->id(), video_rect_)); - - frame->Unlock(); } void IPCVideoRenderer::DoDestroyVideo() { |