summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-29 02:23:31 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-29 02:23:31 +0000
commitf37619e85e12e0692fe106e1f6b3a8ac6267fc74 (patch)
treebc9b9737feaea32c90d3e137c787ce7661b43e77 /chrome/renderer
parent91bfaaef281c73e3792a3c96df37920c8a5370a5 (diff)
downloadchromium_src-f37619e85e12e0692fe106e1f6b3a8ac6267fc74.zip
chromium_src-f37619e85e12e0692fe106e1f6b3a8ac6267fc74.tar.gz
chromium_src-f37619e85e12e0692fe106e1f6b3a8ac6267fc74.tar.bz2
Implement video frame exchange in GpuVideoDecoder and tests
Implement ProduceVideoFrame() in GpuVideoDecoder and unit tests for testing the loginc in GpuVideoDecoder. BUG=53714 TEST=unit_tests --gtest_filter=GpuVideoDecoder* Review URL: http://codereview.chromium.org/3414003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60902 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/gpu_video_decoder_host.cc27
-rw-r--r--chrome/renderer/gpu_video_decoder_host.h3
2 files changed, 8 insertions, 22 deletions
diff --git a/chrome/renderer/gpu_video_decoder_host.cc b/chrome/renderer/gpu_video_decoder_host.cc
index 771c38a..130aa32 100644
--- a/chrome/renderer/gpu_video_decoder_host.cc
+++ b/chrome/renderer/gpu_video_decoder_host.cc
@@ -38,8 +38,6 @@ void GpuVideoDecoderHost::OnMessageReceived(const IPC::Message& msg) {
OnEmptyThisBufferACK)
IPC_MESSAGE_HANDLER(GpuVideoDecoderHostMsg_EmptyThisBufferDone,
OnEmptyThisBufferDone)
- IPC_MESSAGE_HANDLER(GpuVideoDecoderHostMsg_FillThisBufferDone,
- OnFillThisBufferDone)
IPC_MESSAGE_UNHANDLED_ERROR()
IPC_END_MESSAGE_MAP()
}
@@ -109,13 +107,6 @@ 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;
-
- if (!channel_host_ || !channel_host_->Send(
- new GpuVideoDecoderMsg_FillThisBuffer(route_id(), param))) {
- LOG(ERROR) << "GpuVideoDecoderMsg_FillThisBuffer failed";
- }
}
bool GpuVideoDecoderHost::Flush() {
@@ -172,30 +163,24 @@ void GpuVideoDecoderHost::OnEmptyThisBufferDone() {
event_handler_->OnEmptyBufferDone(buffer);
}
-void GpuVideoDecoderHost::OnFillThisBufferDone(
- const GpuVideoDecoderOutputBufferParam& param) {
+void GpuVideoDecoderHost::OnConsumeVideoFrame(int32 frame_id, int64 timestamp,
+ int64 duration, int32 flags) {
scoped_refptr<VideoFrame> frame;
- if (param.flags & GpuVideoDecoderOutputBufferParam::kFlagsEndOfStream) {
+ if (flags & kGpuVideoEndOfStream) {
VideoFrame::CreateEmptyFrame(&frame);
} else {
- // TODO(hclam): The logic in buffer allocation is pretty much around
- // using shared memory for output buffer which needs to be adjusted.
- // Fake the texture ID until we implement it properly.
+ // TODO(hclam): Use |frame_id| to find the VideoFrame.
VideoFrame::GlTexture textures[3] = { 0, 0, 0 };
media::VideoFrame::CreateFrameGlTexture(
media::VideoFrame::RGBA, init_param_.width, init_param_.height,
textures,
- base::TimeDelta::FromMicroseconds(param.timestamp),
- base::TimeDelta::FromMicroseconds(param.duration),
+ base::TimeDelta::FromMicroseconds(timestamp),
+ base::TimeDelta::FromMicroseconds(duration),
&frame);
}
event_handler_->OnFillBufferDone(frame);
- if (!channel_host_ || !channel_host_->Send(
- new GpuVideoDecoderMsg_FillThisBufferDoneACK(route_id()))) {
- LOG(ERROR) << "GpuVideoDecoderMsg_FillThisBufferDoneACK failed";
- }
}
void GpuVideoDecoderHost::OnEmptyThisBufferACK() {
diff --git a/chrome/renderer/gpu_video_decoder_host.h b/chrome/renderer/gpu_video_decoder_host.h
index 1255bf5..cfcdf88 100644
--- a/chrome/renderer/gpu_video_decoder_host.h
+++ b/chrome/renderer/gpu_video_decoder_host.h
@@ -70,7 +70,8 @@ class GpuVideoDecoderHost
void OnUninitializeDone();
void OnFlushDone();
void OnEmptyThisBufferDone();
- void OnFillThisBufferDone(const GpuVideoDecoderOutputBufferParam& param);
+ void OnConsumeVideoFrame(int32 frame_id, int64 timestamp,
+ int64 duration, int32 flags);
void OnEmptyThisBufferACK();
// Helper function.