From 425bbb99f4faa4bdf90d9bca09174baa467aeaae Mon Sep 17 00:00:00 2001 From: "mlloyd@chromium.org" Date: Fri, 17 Sep 2010 14:13:05 +0000 Subject: Revert 59785 - Implement FakeGlVideoDecodeEngine using FakeGlVideoDecodeContext Defines UploadToVideoFrame in VideoDecodeContext. FakeGlVideoDecodeEngine now uses FakeGlVideoDecodeContext to video frame allocation and uploading. BUG=53714 TEST=Tree is green Review URL: http://codereview.chromium.org/3312022 TBR=hclam@chromium.org Review URL: http://codereview.chromium.org/3436014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59789 0039d316-1c4b-4281-b951-d872f2087c98 --- media/mf/mft_h264_decoder.cc | 1 - media/mf/mft_h264_decoder.h | 3 +-- media/mf/mft_h264_decoder_example.cc | 6 +++++- media/mf/test/mft_h264_decoder_unittest.cc | 22 +++++++++++----------- 4 files changed, 17 insertions(+), 15 deletions(-) (limited to 'media/mf') diff --git a/media/mf/mft_h264_decoder.cc b/media/mf/mft_h264_decoder.cc index e8d6b05..6d85f70 100644 --- a/media/mf/mft_h264_decoder.cc +++ b/media/mf/mft_h264_decoder.cc @@ -170,7 +170,6 @@ MftH264Decoder::~MftH264Decoder() { void MftH264Decoder::Initialize( MessageLoop* message_loop, VideoDecodeEngine::EventHandler* event_handler, - VideoDecodeContext* context, const VideoCodecConfig& config) { LOG(INFO) << "MftH264Decoder::Initialize"; if (state_ != kUninitialized) { diff --git a/media/mf/mft_h264_decoder.h b/media/mf/mft_h264_decoder.h index 57c9e9f..61e3c65 100644 --- a/media/mf/mft_h264_decoder.h +++ b/media/mf/mft_h264_decoder.h @@ -36,8 +36,7 @@ class MftH264Decoder : public media::VideoDecodeEngine { explicit MftH264Decoder(bool use_dxva, HWND draw_window); ~MftH264Decoder(); virtual void Initialize(MessageLoop* message_loop, - VideoDecodeEngine::EventHandler* event_handler, - VideoDecodeContext* context, + media::VideoDecodeEngine::EventHandler* event_handler, const VideoCodecConfig& config); virtual void Uninitialize(); virtual void Flush(); diff --git a/media/mf/mft_h264_decoder_example.cc b/media/mf/mft_h264_decoder_example.cc index 0ed9553..788a2ca 100644 --- a/media/mf/mft_h264_decoder_example.cc +++ b/media/mf/mft_h264_decoder_example.cc @@ -362,7 +362,11 @@ static int Run(bool use_dxva, bool render, const std::string& input_file) { return -1; } - mft->Initialize(MessageLoop::current(), handler.get(), NULL, config); + mft->Initialize(MessageLoop::current(), handler.get(), config); + if (!handler->info_.success) { + LOG(ERROR) << "Failed to initialize decoder"; + return -1; + } scoped_ptr observer; if (render) { observer.reset(new WindowObserver(reader.get(), mft.get())); diff --git a/media/mf/test/mft_h264_decoder_unittest.cc b/media/mf/test/mft_h264_decoder_unittest.cc index 11959f7..67dc07c 100644 --- a/media/mf/test/mft_h264_decoder_unittest.cc +++ b/media/mf/test/mft_h264_decoder_unittest.cc @@ -207,7 +207,7 @@ TEST_F(MftH264DecoderTest, DecoderInitMissingArgs) { config.height = 600; scoped_ptr decoder(new MftH264Decoder(false, NULL)); ASSERT_TRUE(decoder.get()); - decoder->Initialize(NULL, NULL, NULL, config); + decoder->Initialize(NULL, NULL, config); EXPECT_EQ(MftH264Decoder::kUninitialized, decoder->state()); } @@ -219,7 +219,7 @@ TEST_F(MftH264DecoderTest, DecoderInitNoDxva) { config.height = 600; scoped_ptr decoder(new MftH264Decoder(false, NULL)); ASSERT_TRUE(decoder.get()); - decoder->Initialize(&loop, &handler, NULL, config); + decoder->Initialize(&loop, &handler, config); EXPECT_EQ(1, handler.init_count_); EXPECT_EQ(MftH264Decoder::kNormal, decoder->state()); decoder->Uninitialize(); @@ -235,7 +235,7 @@ TEST_F(MftH264DecoderTest, DecoderInitDxva) { ASSERT_TRUE(hwnd); scoped_ptr decoder(new MftH264Decoder(true, hwnd)); ASSERT_TRUE(decoder.get()); - decoder->Initialize(&loop, &handler, NULL, config); + decoder->Initialize(&loop, &handler, config); EXPECT_EQ(1, handler.init_count_); EXPECT_EQ(MftH264Decoder::kNormal, decoder->state()); decoder->Uninitialize(); @@ -250,7 +250,7 @@ TEST_F(MftH264DecoderTest, DecoderUninit) { config.height = 600; scoped_ptr decoder(new MftH264Decoder(false, NULL)); ASSERT_TRUE(decoder.get()); - decoder->Initialize(&loop, &handler, NULL, config); + decoder->Initialize(&loop, &handler, config); EXPECT_EQ(MftH264Decoder::kNormal, decoder->state()); decoder->Uninitialize(); EXPECT_EQ(1, handler.uninit_count_); @@ -277,7 +277,7 @@ TEST_F(MftH264DecoderTest, InitWithNegativeDimensions) { config.height = -456; scoped_ptr decoder(new MftH264Decoder(false, NULL)); ASSERT_TRUE(decoder.get()); - decoder->Initialize(&loop, &handler, NULL, config); + decoder->Initialize(&loop, &handler, config); EXPECT_EQ(MftH264Decoder::kNormal, decoder->state()); EXPECT_EQ(kDecoderMaxWidth, handler.info_.stream_info.surface_width); EXPECT_EQ(kDecoderMaxHeight, handler.info_.stream_info.surface_height); @@ -292,7 +292,7 @@ TEST_F(MftH264DecoderTest, InitWithTooHighDimensions) { config.height = kDecoderMaxHeight + 1; scoped_ptr decoder(new MftH264Decoder(false, NULL)); ASSERT_TRUE(decoder.get()); - decoder->Initialize(&loop, &handler, NULL, config); + decoder->Initialize(&loop, &handler, config); EXPECT_EQ(MftH264Decoder::kNormal, decoder->state()); EXPECT_EQ(kDecoderMaxWidth, handler.info_.stream_info.surface_width); EXPECT_EQ(kDecoderMaxHeight, handler.info_.stream_info.surface_height); @@ -307,7 +307,7 @@ TEST_F(MftH264DecoderTest, DrainOnEmptyBuffer) { config.height = 768; scoped_ptr decoder(new MftH264Decoder(false, NULL)); ASSERT_TRUE(decoder.get()); - decoder->Initialize(&loop, &handler, NULL, config); + decoder->Initialize(&loop, &handler, config); EXPECT_EQ(MftH264Decoder::kNormal, decoder->state()); scoped_refptr buffer(new DataBuffer(0)); @@ -336,7 +336,7 @@ TEST_F(MftH264DecoderTest, NoOutputOnGarbageInput) { config.height = 768; scoped_ptr decoder(new MftH264Decoder(false, NULL)); ASSERT_TRUE(decoder.get()); - decoder->Initialize(&loop, &handler, NULL, config); + decoder->Initialize(&loop, &handler, config); EXPECT_EQ(MftH264Decoder::kNormal, decoder->state()); handler.SetReader(reader); handler.SetDecoder(decoder.get()); @@ -364,7 +364,7 @@ TEST_F(MftH264DecoderTest, FlushAtStart) { config.height = 768; scoped_ptr decoder(new MftH264Decoder(false, NULL)); ASSERT_TRUE(decoder.get()); - decoder->Initialize(&loop, &handler, NULL, config); + decoder->Initialize(&loop, &handler, config); EXPECT_EQ(MftH264Decoder::kNormal, decoder->state()); decoder->Flush(); @@ -384,7 +384,7 @@ TEST_F(MftH264DecoderTest, NoFlushAtStopped) { config.height = 768; scoped_ptr decoder(new MftH264Decoder(false, NULL)); ASSERT_TRUE(decoder.get()); - decoder->Initialize(&loop, &handler, NULL, config); + decoder->Initialize(&loop, &handler, config); EXPECT_EQ(MftH264Decoder::kNormal, decoder->state()); handler.SetReader(reader); handler.SetDecoder(decoder.get()); @@ -429,7 +429,7 @@ void DecodeValidVideo(const std::string& filename, int num_frames, bool dxva) { ASSERT_TRUE(hwnd); scoped_ptr decoder(new MftH264Decoder(dxva, hwnd)); ASSERT_TRUE(decoder.get()); - decoder->Initialize(&loop, &handler, NULL, config); + decoder->Initialize(&loop, &handler, config); EXPECT_EQ(MftH264Decoder::kNormal, decoder->state()); handler.SetReader(reader); handler.SetDecoder(decoder.get()); -- cgit v1.1