From 71e43a27d4c6018a9502753566d228cbf2dc2ca5 Mon Sep 17 00:00:00 2001 From: "hclam@chromium.org" Date: Fri, 8 Oct 2010 04:52:15 +0000 Subject: Move MFT H264 video decoder implementation and connect it to GpuVideoDecoder Remove media/mf folder and move the video decode engine to media/video. There are some temporary changes in MftH264DecodeEngine to work with GpuVideoDecoder correctly. Removed tests will be added later. Example program will likely be removed permanently due to maintence problem. This patch depends WebKit and ANGLE changes to be able to present video frames onto screen and still have lot of bugs, those problems will be address later. BUG=53714 TEST=Tree is green. This patch doesn't work yet. Review URL: http://codereview.chromium.org/3432030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61918 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/gpu/gpu_video_decoder.cc | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'chrome/gpu/gpu_video_decoder.cc') diff --git a/chrome/gpu/gpu_video_decoder.cc b/chrome/gpu/gpu_video_decoder.cc index 86bcd04..5ae7dfc 100644 --- a/chrome/gpu/gpu_video_decoder.cc +++ b/chrome/gpu/gpu_video_decoder.cc @@ -12,6 +12,12 @@ #include "media/base/data_buffer.h" #include "media/base/video_frame.h" +#if defined(OS_WIN) +#include "chrome/gpu/media/mft_angle_video_device.h" +#include "media/video/mft_h264_decode_engine.h" +#include +#endif + void GpuVideoDecoder::OnChannelConnected(int32 peer_pid) { } @@ -105,7 +111,12 @@ void GpuVideoDecoder::ProduceVideoSample(scoped_refptr buffer) { } void GpuVideoDecoder::ConsumeVideoFrame(scoped_refptr frame) { - int32 frame_id = -1; + if (frame->IsEndOfStream()) { + SendConsumeVideoFrame(kGpuVideoInvalidFrameId, 0, 0, kGpuVideoEndOfStream); + return; + } + + int32 frame_id = kGpuVideoInvalidFrameId; for (VideoFrameMap::iterator i = video_frame_map_.begin(); i != video_frame_map_.end(); ++i) { if (i->second == frame) { @@ -116,8 +127,7 @@ void GpuVideoDecoder::ConsumeVideoFrame(scoped_refptr frame) { DCHECK_NE(-1, frame_id) << "VideoFrame not recognized"; SendConsumeVideoFrame(frame_id, frame->GetTimestamp().InMicroseconds(), - frame->GetDuration().InMicroseconds(), - frame->IsEndOfStream() ? kGpuVideoEndOfStream : 0); + frame->GetDuration().InMicroseconds(), 0); } void* GpuVideoDecoder::GetDevice() { @@ -225,8 +235,13 @@ GpuVideoDecoder::GpuVideoDecoder( // TODO(jiesun): find a better way to determine which VideoDecodeEngine // to return on current platform. +#if defined(OS_WIN) + decode_engine_.reset(new media::MftH264DecodeEngine(true)); + video_device_.reset(new MftAngleVideoDevice()); +#else decode_engine_.reset(new FakeGlVideoDecodeEngine()); video_device_.reset(new FakeGlVideoDevice()); +#endif } void GpuVideoDecoder::OnInitialize(const GpuVideoDecoderInitParam& param) { @@ -235,7 +250,7 @@ void GpuVideoDecoder::OnInitialize(const GpuVideoDecoderInitParam& param) { config_.width = param.width; config_.height = param.height; config_.opaque_context = NULL; - decode_engine_->Initialize(NULL, this, this, config_); + decode_engine_->Initialize(message_loop_, this, this, config_); } void GpuVideoDecoder::OnUninitialize() { -- cgit v1.1