summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/gpu_video_decoder_host.cc
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-17 22:03:16 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-17 22:03:16 +0000
commit1318e92f70e240d7ae71320ea7e4fcae18f2ce3e (patch)
tree412ee9192a850d9867bea3a841d800f67081ebe3 /chrome/renderer/gpu_video_decoder_host.cc
parent9fcd39385ae39a68d3509238bd9ef83af1868fc7 (diff)
downloadchromium_src-1318e92f70e240d7ae71320ea7e4fcae18f2ce3e.zip
chromium_src-1318e92f70e240d7ae71320ea7e4fcae18f2ce3e.tar.gz
chromium_src-1318e92f70e240d7ae71320ea7e4fcae18f2ce3e.tar.bz2
Resubmit GpuVideoDecoder and related patches.
BUG=53714 TEST=Tree is green Review URL: http://codereview.chromium.org/3442006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59860 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/gpu_video_decoder_host.cc')
-rw-r--r--chrome/renderer/gpu_video_decoder_host.cc37
1 files changed, 5 insertions, 32 deletions
diff --git a/chrome/renderer/gpu_video_decoder_host.cc b/chrome/renderer/gpu_video_decoder_host.cc
index a585ede..771c38a 100644
--- a/chrome/renderer/gpu_video_decoder_host.cc
+++ b/chrome/renderer/gpu_video_decoder_host.cc
@@ -109,12 +109,9 @@ void GpuVideoDecoderHost::FillThisBuffer(scoped_refptr<VideoFrame> frame) {
// TODO(hclam): We should keep an IDMap to convert between a frame a buffer
// ID so that we can signal GpuVideoDecoder in GPU process to use the buffer.
// This eliminates one conversion step.
+ // TODO(hclam): Fill the param.
GpuVideoDecoderOutputBufferParam param;
- // TODO(hclam): This is a hack to pass the texture id to the hardware video
- // decoder. We should have created a mapping between VideoFrame and buffer id
- // and we pass the buffer id to the GPU process.
- param.texture = frame->gl_texture(VideoFrame::kRGBPlane);
if (!channel_host_ || !channel_host_->Send(
new GpuVideoDecoderMsg_FillThisBuffer(route_id(), param))) {
LOG(ERROR) << "GpuVideoDecoderMsg_FillThisBuffer failed";
@@ -152,13 +149,6 @@ void GpuVideoDecoderHost::OnInitializeDone(
if (!input_transfer_buffer_->Map(param.input_buffer_size))
break;
- if (!base::SharedMemory::IsHandleValid(param.output_buffer_handle))
- break;
- output_transfer_buffer_.reset(
- new base::SharedMemory(param.output_buffer_handle, false));
- if (!output_transfer_buffer_->Map(param.output_buffer_size))
- break;
-
success = true;
} while (0);
@@ -168,7 +158,6 @@ void GpuVideoDecoderHost::OnInitializeDone(
void GpuVideoDecoderHost::OnUninitializeDone() {
input_transfer_buffer_.reset();
- output_transfer_buffer_.reset();
event_handler_->OnUninitializeDone();
}
@@ -189,27 +178,11 @@ void GpuVideoDecoderHost::OnFillThisBufferDone(
if (param.flags & GpuVideoDecoderOutputBufferParam::kFlagsEndOfStream) {
VideoFrame::CreateEmptyFrame(&frame);
- } else if (done_param_.surface_type ==
- media::VideoFrame::TYPE_SYSTEM_MEMORY) {
- VideoFrame::CreateFrame(VideoFrame::YV12,
- init_param_.width,
- init_param_.height,
- base::TimeDelta::FromMicroseconds(param.timestamp),
- base::TimeDelta::FromMicroseconds(param.duration),
- &frame);
- uint8* src = static_cast<uint8*>(output_transfer_buffer_->memory());
- uint8* data0 = frame->data(0);
- uint8* data1 = frame->data(1);
- uint8* data2 = frame->data(2);
- int32 size = init_param_.width * init_param_.height;
- memcpy(data0, src, size);
- memcpy(data1, src + size, size / 4);
- memcpy(data2, src + size + size / 4, size / 4);
- } else if (done_param_.surface_type == media::VideoFrame::TYPE_GL_TEXTURE) {
+ } else {
// TODO(hclam): The logic in buffer allocation is pretty much around
- // using shared memory for output buffer which needs to be adjusted. For
- // now we have to add this hack to get the texture id.
- VideoFrame::GlTexture textures[3] = { param.texture, 0, 0 };
+ // using shared memory for output buffer which needs to be adjusted.
+ // Fake the texture ID until we implement it properly.
+ VideoFrame::GlTexture textures[3] = { 0, 0, 0 };
media::VideoFrame::CreateFrameGlTexture(
media::VideoFrame::RGBA, init_param_.width, init_param_.height,
textures,