diff options
author | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-03 00:30:39 +0000 |
---|---|---|
committer | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-03 00:30:39 +0000 |
commit | e1d75490aebae7cefd4be491dff0facde1bb2d53 (patch) | |
tree | 7a9d929cd7b348da09efe494495f79a6981c1e5b /content/renderer/media | |
parent | f7b0633c3475362a1e6933277304df5b7e8af4c7 (diff) | |
download | chromium_src-e1d75490aebae7cefd4be491dff0facde1bb2d53.zip chromium_src-e1d75490aebae7cefd4be491dff0facde1bb2d53.tar.gz chromium_src-e1d75490aebae7cefd4be491dff0facde1bb2d53.tar.bz2 |
Remove VideoDecoder from the Filter heirarchy.
This is the second step to move VideoDecoder out of Filter hierarchy (See r128289). VideoDecoder is not a Filter any more and Seek()/Pause()/Play() methods are removed from its definition and all implementations.
BUG=108340
TEST=media_unittest,content_unittest,normal html5 video playback
Review URL: http://codereview.chromium.org/9724011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135051 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/media')
-rw-r--r-- | content/renderer/media/capture_video_decoder.cc | 110 | ||||
-rw-r--r-- | content/renderer/media/capture_video_decoder.h | 41 | ||||
-rw-r--r-- | content/renderer/media/capture_video_decoder_unittest.cc | 28 | ||||
-rw-r--r-- | content/renderer/media/rtc_video_decoder.cc | 91 | ||||
-rw-r--r-- | content/renderer/media/rtc_video_decoder.h | 28 | ||||
-rw-r--r-- | content/renderer/media/rtc_video_decoder_unittest.cc | 29 |
6 files changed, 92 insertions, 235 deletions
diff --git a/content/renderer/media/capture_video_decoder.cc b/content/renderer/media/capture_video_decoder.cc index 72d2d1ba..cecfd22 100644 --- a/content/renderer/media/capture_video_decoder.cc +++ b/content/renderer/media/capture_video_decoder.cc @@ -7,7 +7,7 @@ #include "base/bind.h" #include "base/callback_helpers.h" #include "content/renderer/media/video_capture_impl_manager.h" -#include "media/base/filter_host.h" +#include "media/base/demuxer_stream.h" #include "media/base/limits.h" #include "media/base/video_util.h" @@ -31,58 +31,33 @@ CaptureVideoDecoder::CaptureVideoDecoder( DCHECK(vc_manager); } -void CaptureVideoDecoder::Play(const base::Closure& callback) { - message_loop_proxy_->PostTask( - FROM_HERE, - base::Bind(&CaptureVideoDecoder::PlayOnDecoderThread, - this, callback)); -} - -void CaptureVideoDecoder::Seek(base::TimeDelta time, - const media::PipelineStatusCB& cb) { - message_loop_proxy_->PostTask( - FROM_HERE, - base::Bind(&CaptureVideoDecoder::SeekOnDecoderThread, - this, time, cb)); -} - -void CaptureVideoDecoder::Pause(const base::Closure& callback) { - message_loop_proxy_->PostTask( - FROM_HERE, - base::Bind(&CaptureVideoDecoder::PauseOnDecoderThread, - this, callback)); -} - -void CaptureVideoDecoder::Flush(const base::Closure& callback) { +void CaptureVideoDecoder::Initialize( + const scoped_refptr<media::DemuxerStream>& stream, + const media::PipelineStatusCB& status_cb, + const media::StatisticsCB& statistics_cb) { message_loop_proxy_->PostTask( FROM_HERE, - base::Bind(&CaptureVideoDecoder::FlushOnDecoderThread, - this, callback)); + base::Bind(&CaptureVideoDecoder::InitializeOnDecoderThread, + this, stream, status_cb, statistics_cb)); } -void CaptureVideoDecoder::Stop(const base::Closure& callback) { +void CaptureVideoDecoder::Read(const ReadCB& read_cb) { message_loop_proxy_->PostTask( FROM_HERE, - base::Bind(&CaptureVideoDecoder::StopOnDecoderThread, - this, callback)); + base::Bind(&CaptureVideoDecoder::ReadOnDecoderThread, + this, read_cb)); } -void CaptureVideoDecoder::Initialize( - media::DemuxerStream* demuxer_stream, - const media::PipelineStatusCB& status_cb, - const media::StatisticsCB& statistics_cb) { +void CaptureVideoDecoder::Reset(const base::Closure& closure) { message_loop_proxy_->PostTask( FROM_HERE, - base::Bind(&CaptureVideoDecoder::InitializeOnDecoderThread, - this, make_scoped_refptr(demuxer_stream), - status_cb, statistics_cb)); + base::Bind(&CaptureVideoDecoder::ResetOnDecoderThread, this, closure)); } -void CaptureVideoDecoder::Read(const ReadCB& read_cb) { +void CaptureVideoDecoder::Stop(const base::Closure& closure) { message_loop_proxy_->PostTask( FROM_HERE, - base::Bind(&CaptureVideoDecoder::ReadOnDecoderThread, - this, read_cb)); + base::Bind(&CaptureVideoDecoder::StopOnDecoderThread, this, closure)); } const gfx::Size& CaptureVideoDecoder::natural_size() { @@ -134,31 +109,29 @@ void CaptureVideoDecoder::OnDeviceInfoReceived( CaptureVideoDecoder::~CaptureVideoDecoder() {} -void CaptureVideoDecoder::PlayOnDecoderThread(const base::Closure& callback) { - DVLOG(1) << "PlayOnDecoderThread"; +void CaptureVideoDecoder::InitializeOnDecoderThread( + const scoped_refptr<media::DemuxerStream>& /* stream */, + const media::PipelineStatusCB& status_cb, + const media::StatisticsCB& statistics_cb) { + DVLOG(1) << "InitializeOnDecoderThread"; DCHECK(message_loop_proxy_->BelongsToCurrentThread()); - callback.Run(); -} -void CaptureVideoDecoder::SeekOnDecoderThread( - base::TimeDelta time, - const media::PipelineStatusCB& cb) { - DVLOG(1) << "SeekOnDecoderThread"; - DCHECK(message_loop_proxy_->BelongsToCurrentThread()); + capture_engine_ = vc_manager_->AddDevice(video_stream_id_, this); - cb.Run(media::PIPELINE_OK); + statistics_cb_ = statistics_cb; + status_cb.Run(media::PIPELINE_OK); state_ = kNormal; + capture_engine_->StartCapture(this, capability_); } -void CaptureVideoDecoder::PauseOnDecoderThread(const base::Closure& callback) { - DVLOG(1) << "PauseOnDecoderThread"; +void CaptureVideoDecoder::ReadOnDecoderThread(const ReadCB& read_cb) { DCHECK(message_loop_proxy_->BelongsToCurrentThread()); - state_ = kPaused; - callback.Run(); + CHECK(read_cb_.is_null()); + read_cb_ = read_cb; } -void CaptureVideoDecoder::FlushOnDecoderThread(const base::Closure& callback) { - DVLOG(1) << "FlushOnDecoderThread"; +void CaptureVideoDecoder::ResetOnDecoderThread(const base::Closure& closure) { + DVLOG(1) << "ResetOnDecoderThread"; DCHECK(message_loop_proxy_->BelongsToCurrentThread()); if (!read_cb_.is_null()) { scoped_refptr<media::VideoFrame> video_frame = @@ -166,38 +139,17 @@ void CaptureVideoDecoder::FlushOnDecoderThread(const base::Closure& callback) { natural_size_.height()); DeliverFrame(video_frame); } - media::VideoDecoder::Flush(callback); + closure.Run(); } -void CaptureVideoDecoder::StopOnDecoderThread(const base::Closure& callback) { +void CaptureVideoDecoder::StopOnDecoderThread(const base::Closure& closure) { DVLOG(1) << "StopOnDecoderThread"; DCHECK(message_loop_proxy_->BelongsToCurrentThread()); - pending_stop_cb_ = callback; + pending_stop_cb_ = closure; state_ = kStopped; capture_engine_->StopCapture(this); } -void CaptureVideoDecoder::InitializeOnDecoderThread( - media::DemuxerStream* demuxer_stream, - const media::PipelineStatusCB& status_cb, - const media::StatisticsCB& statistics_cb) { - DVLOG(1) << "InitializeOnDecoderThread"; - DCHECK(message_loop_proxy_->BelongsToCurrentThread()); - - capture_engine_ = vc_manager_->AddDevice(video_stream_id_, this); - - statistics_cb_ = statistics_cb; - status_cb.Run(media::PIPELINE_OK); - state_ = kNormal; - capture_engine_->StartCapture(this, capability_); -} - -void CaptureVideoDecoder::ReadOnDecoderThread(const ReadCB& read_cb) { - DCHECK(message_loop_proxy_->BelongsToCurrentThread()); - CHECK(read_cb_.is_null()); - read_cb_ = read_cb; -} - void CaptureVideoDecoder::OnStoppedOnDecoderThread( media::VideoCapture* capture) { DVLOG(1) << "OnStoppedOnDecoderThread"; diff --git a/content/renderer/media/capture_video_decoder.h b/content/renderer/media/capture_video_decoder.h index cafd533f..daa6c2c 100644 --- a/content/renderer/media/capture_video_decoder.h +++ b/content/renderer/media/capture_video_decoder.h @@ -7,16 +7,17 @@ #include "base/time.h" #include "content/common/content_export.h" -#include "media/base/demuxer_stream.h" -#include "media/base/filters.h" #include "media/base/pipeline_status.h" -#include "media/base/video_frame.h" +#include "media/base/video_decoder.h" #include "media/video/capture/video_capture.h" #include "media/video/capture/video_capture_types.h" namespace base { class MessageLoopProxy; } +namespace media { +class VideoFrame; +} class VideoCaptureImplManager; // A filter takes raw frames from video capture engine and passes them to media @@ -31,20 +32,13 @@ class CONTENT_EXPORT CaptureVideoDecoder VideoCaptureImplManager* vc_manager, const media::VideoCaptureCapability& capability); - // Filter implementation. - virtual void Play(const base::Closure& callback) OVERRIDE; - virtual void Seek(base::TimeDelta time, - const media::PipelineStatusCB& cb) OVERRIDE; - virtual void Pause(const base::Closure& callback) OVERRIDE; - virtual void Flush(const base::Closure& callback) OVERRIDE; - virtual void Stop(const base::Closure& callback) OVERRIDE; - - // Decoder implementation. - virtual void Initialize( - media::DemuxerStream* demuxer_stream, - const media::PipelineStatusCB& status_cb, - const media::StatisticsCB& statistics_cb) OVERRIDE; - virtual void Read(const ReadCB& callback) OVERRIDE; + // media::VideoDecoder implementation. + virtual void Initialize(const scoped_refptr<media::DemuxerStream>& stream, + const media::PipelineStatusCB& status_cb, + const media::StatisticsCB& statistics_cb) OVERRIDE; + virtual void Read(const ReadCB& read_cb) OVERRIDE; + virtual void Reset(const base::Closure& closure) OVERRIDE; + virtual void Stop(const base::Closure& closure) OVERRIDE; virtual const gfx::Size& natural_size() OVERRIDE; // VideoCapture::EventHandler implementation. @@ -73,18 +67,13 @@ class CONTENT_EXPORT CaptureVideoDecoder kPaused }; - void PlayOnDecoderThread(const base::Closure& callback); - void SeekOnDecoderThread(base::TimeDelta time, - const media::PipelineStatusCB& cb); - void PauseOnDecoderThread(const base::Closure& callback); - void FlushOnDecoderThread(const base::Closure& callback); - void StopOnDecoderThread(const base::Closure& callback); - void InitializeOnDecoderThread( - media::DemuxerStream* demuxer_stream, + const scoped_refptr<media::DemuxerStream>& stream, const media::PipelineStatusCB& status_cb, const media::StatisticsCB& statistics_cb); - void ReadOnDecoderThread(const ReadCB& callback); + void ReadOnDecoderThread(const ReadCB& read_cb); + void ResetOnDecoderThread(const base::Closure& closure); + void StopOnDecoderThread(const base::Closure& closure); void OnStoppedOnDecoderThread(media::VideoCapture* capture); void OnBufferReadyOnDecoderThread( diff --git a/content/renderer/media/capture_video_decoder_unittest.cc b/content/renderer/media/capture_video_decoder_unittest.cc index c87bd56..6853caf 100644 --- a/content/renderer/media/capture_video_decoder_unittest.cc +++ b/content/renderer/media/capture_video_decoder_unittest.cc @@ -6,7 +6,6 @@ #include "content/renderer/media/capture_video_decoder.h" #include "content/renderer/media/video_capture_impl.h" #include "content/renderer/media/video_capture_impl_manager.h" -#include "media/base/filters.h" #include "media/base/limits.h" #include "media/base/mock_callback.h" #include "media/base/mock_filters.h" @@ -140,21 +139,6 @@ class CaptureVideoDecoderTest : public ::testing::Test { message_loop_->RunAllPending(); } - void Play() { - decoder_->Play(media::NewExpectedClosure()); - message_loop_->RunAllPending(); - } - - void Flush() { - // Issue a read. - EXPECT_CALL(*this, FrameReady(media::VideoDecoder::kOk, _)); - decoder_->Read(read_cb_); - - decoder_->Pause(media::NewExpectedClosure()); - decoder_->Flush(media::NewExpectedClosure()); - message_loop_->RunAllPending(); - } - void Stop() { EXPECT_CALL(*vc_impl_, StopCapture(capture_client())) .Times(1) @@ -185,14 +169,18 @@ class CaptureVideoDecoderTest : public ::testing::Test { DISALLOW_COPY_AND_ASSIGN(CaptureVideoDecoderTest); }; -TEST_F(CaptureVideoDecoderTest, Play) { - // Test basic initialize, play, and teardown sequence. +TEST_F(CaptureVideoDecoderTest, ReadAndReset) { + // Test basic initialize and teardown sequence. Initialize(); // Natural size should be initialized to default capability. EXPECT_EQ(kWidth, decoder_->natural_size().width()); EXPECT_EQ(kHeight, decoder_->natural_size().height()); - Play(); - Flush(); + + EXPECT_CALL(*this, FrameReady(media::VideoDecoder::kOk, _)); + decoder_->Read(read_cb_); + decoder_->Reset(media::NewExpectedClosure()); + message_loop_->RunAllPending(); + Stop(); } diff --git a/content/renderer/media/rtc_video_decoder.cc b/content/renderer/media/rtc_video_decoder.cc index ea15a02..7f9e095 100644 --- a/content/renderer/media/rtc_video_decoder.cc +++ b/content/renderer/media/rtc_video_decoder.cc @@ -10,7 +10,6 @@ #include "base/callback.h" #include "base/message_loop.h" #include "media/base/demuxer.h" -#include "media/base/filters.h" #include "media/base/limits.h" #include "media/base/video_frame.h" #include "media/base/video_util.h" @@ -20,7 +19,6 @@ using media::CopyUPlane; using media::CopyVPlane; using media::CopyYPlane; using media::DemuxerStream; -using media::PipelineStatusCB; using media::kNoTimestamp; using media::PIPELINE_OK; using media::PipelineStatusCB; @@ -36,51 +34,41 @@ RTCVideoDecoder::RTCVideoDecoder(MessageLoop* message_loop, got_first_frame_(false) { } -void RTCVideoDecoder::Play(const base::Closure& callback) { +void RTCVideoDecoder::Initialize(const scoped_refptr<DemuxerStream>& stream, + const PipelineStatusCB& status_cb, + const StatisticsCB& statistics_cb) { if (MessageLoop::current() != message_loop_) { - message_loop_->PostTask(FROM_HERE, - base::Bind(&RTCVideoDecoder::Play, this, callback)); + message_loop_->PostTask( + FROM_HERE, + base::Bind(&RTCVideoDecoder::Initialize, this, + stream, status_cb, statistics_cb)); return; } DCHECK_EQ(MessageLoop::current(), message_loop_); - - callback.Run(); -} - -void RTCVideoDecoder::Seek(base::TimeDelta time, const PipelineStatusCB& cb) { - if (MessageLoop::current() != message_loop_) { - message_loop_->PostTask(FROM_HERE, - base::Bind(&RTCVideoDecoder::Seek, this, - time, cb)); - return; - } - - DCHECK_EQ(MessageLoop::current(), message_loop_); state_ = kNormal; - cb.Run(PIPELINE_OK); + status_cb.Run(PIPELINE_OK); + + // TODO(acolwell): Implement stats. } -void RTCVideoDecoder::Pause(const base::Closure& callback) { +void RTCVideoDecoder::Read(const ReadCB& read_cb) { if (MessageLoop::current() != message_loop_) { - message_loop_->PostTask(FROM_HERE, - base::Bind(&RTCVideoDecoder::Pause, - this, callback)); + message_loop_->PostTask( + FROM_HERE, + base::Bind(&RTCVideoDecoder::Read, this, read_cb)); return; } - DCHECK_EQ(MessageLoop::current(), message_loop_); - - state_ = kPaused; - - callback.Run(); + base::AutoLock auto_lock(lock_); + CHECK(read_cb_.is_null()); + read_cb_ = read_cb; } -void RTCVideoDecoder::Flush(const base::Closure& callback) { +void RTCVideoDecoder::Reset(const base::Closure& closure) { if (MessageLoop::current() != message_loop_) { message_loop_->PostTask(FROM_HERE, - base::Bind(&RTCVideoDecoder::Flush, - this, callback)); + base::Bind(&RTCVideoDecoder::Reset, this, closure)); return; } @@ -101,14 +89,13 @@ void RTCVideoDecoder::Flush(const base::Closure& callback) { read_cb.Run(kOk, video_frame); } - VideoDecoder::Flush(callback); + closure.Run(); } -void RTCVideoDecoder::Stop(const base::Closure& callback) { +void RTCVideoDecoder::Stop(const base::Closure& closure) { if (MessageLoop::current() != message_loop_) { message_loop_->PostTask(FROM_HERE, - base::Bind(&RTCVideoDecoder::Stop, - this, callback)); + base::Bind(&RTCVideoDecoder::Stop, this, closure)); return; } @@ -116,39 +103,7 @@ void RTCVideoDecoder::Stop(const base::Closure& callback) { state_ = kStopped; - VideoDecoder::Stop(callback); -} - -void RTCVideoDecoder::Initialize(DemuxerStream* demuxer_stream, - const PipelineStatusCB& status_cb, - const StatisticsCB& statistics_cb) { - if (MessageLoop::current() != message_loop_) { - message_loop_->PostTask( - FROM_HERE, - base::Bind(&RTCVideoDecoder::Initialize, this, - make_scoped_refptr(demuxer_stream), - status_cb, statistics_cb)); - return; - } - - DCHECK_EQ(MessageLoop::current(), message_loop_); - state_ = kNormal; - status_cb.Run(PIPELINE_OK); - - // TODO(acolwell): Implement stats. -} - -void RTCVideoDecoder::Read(const ReadCB& callback) { - if (MessageLoop::current() != message_loop_) { - message_loop_->PostTask( - FROM_HERE, - base::Bind(&RTCVideoDecoder::Read, this, callback)); - return; - } - DCHECK_EQ(MessageLoop::current(), message_loop_); - base::AutoLock auto_lock(lock_); - CHECK(read_cb_.is_null()); - read_cb_ = callback; + closure.Run(); } const gfx::Size& RTCVideoDecoder::natural_size() { diff --git a/content/renderer/media/rtc_video_decoder.h b/content/renderer/media/rtc_video_decoder.h index ca615431..8317049 100644 --- a/content/renderer/media/rtc_video_decoder.h +++ b/content/renderer/media/rtc_video_decoder.h @@ -12,8 +12,7 @@ #include "base/synchronization/lock.h" #include "base/time.h" #include "content/common/content_export.h" -#include "media/base/filters.h" -#include "media/base/video_frame.h" +#include "media/base/video_decoder.h" #include "third_party/libjingle/source/talk/session/phone/mediachannel.h" #include "third_party/libjingle/source/talk/session/phone/videorenderer.h" @@ -29,20 +28,13 @@ class CONTENT_EXPORT RTCVideoDecoder public: RTCVideoDecoder(MessageLoop* message_loop, const std::string& url); - // Filter implementation. - virtual void Play(const base::Closure& callback) OVERRIDE; - virtual void Seek(base::TimeDelta time, - const media::PipelineStatusCB& cb) OVERRIDE; - virtual void Pause(const base::Closure& callback) OVERRIDE; - virtual void Flush(const base::Closure& callback) OVERRIDE; - virtual void Stop(const base::Closure& callback) OVERRIDE; - - // Decoder implementation. - virtual void Initialize( - media::DemuxerStream* demuxer_stream, - const media::PipelineStatusCB& status_cb, - const media::StatisticsCB& statistics_cb) OVERRIDE; - virtual void Read(const ReadCB& callback) OVERRIDE; + // media::VideoDecoder implementation. + virtual void Initialize(const scoped_refptr<media::DemuxerStream>& stream, + const media::PipelineStatusCB& status_cb, + const media::StatisticsCB& statistics_cb) OVERRIDE; + virtual void Read(const ReadCB& read_cb) OVERRIDE; + virtual void Reset(const base::Closure& clusure) OVERRIDE; + virtual void Stop(const base::Closure& clusure) OVERRIDE; virtual const gfx::Size& natural_size() OVERRIDE; // cricket::VideoRenderer implementation @@ -55,15 +47,13 @@ class CONTENT_EXPORT RTCVideoDecoder private: friend class RTCVideoDecoderTest; FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, Initialize_Successful); - FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoSeek); - FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoFlush); + FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoReset); FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoRenderFrame); FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, DoSetSize); enum DecoderState { kUnInitialized, kNormal, - kPaused, kStopped }; diff --git a/content/renderer/media/rtc_video_decoder_unittest.cc b/content/renderer/media/rtc_video_decoder_unittest.cc index 5380e99..a2f94ba 100644 --- a/content/renderer/media/rtc_video_decoder_unittest.cc +++ b/content/renderer/media/rtc_video_decoder_unittest.cc @@ -133,7 +133,7 @@ class RTCVideoDecoderTest : public testing::Test { DCHECK(decoder_); - EXPECT_CALL(stats_callback_object_, OnStatistics(_)) + EXPECT_CALL(statistics_cb_, OnStatistics(_)) .Times(AnyNumber()); } @@ -151,7 +151,7 @@ class RTCVideoDecoderTest : public testing::Test { StatisticsCB NewStatisticsCB() { return base::Bind(&MockStatisticsCB::OnStatistics, - base::Unretained(&stats_callback_object_)); + base::Unretained(&statistics_cb_)); } MOCK_METHOD2(FrameReady, void(media::VideoDecoder::DecoderStatus status, @@ -160,7 +160,7 @@ class RTCVideoDecoderTest : public testing::Test { // Fixture members. scoped_refptr<RTCVideoDecoder> decoder_; scoped_refptr<MockVideoRenderer> renderer_; - MockStatisticsCB stats_callback_object_; + MockStatisticsCB statistics_cb_; MessageLoop message_loop_; media::VideoDecoder::ReadCB read_cb_; @@ -182,35 +182,18 @@ TEST_F(RTCVideoDecoderTest, Initialize_Successful) { EXPECT_EQ(kHeight, decoder_->natural_size().height()); } -TEST_F(RTCVideoDecoderTest, DoSeek) { - const base::TimeDelta kZero; - - InitializeDecoderSuccessfully(); - - // Expect seek and verify the results. - decoder_->Seek(kZero, NewExpectedStatusCB(PIPELINE_OK)); - - message_loop_.RunAllPending(); - EXPECT_EQ(RTCVideoDecoder::kNormal, decoder_->state_); -} - -TEST_F(RTCVideoDecoderTest, DoFlush) { - const base::TimeDelta kZero; - +TEST_F(RTCVideoDecoderTest, DoReset) { InitializeDecoderSuccessfully(); EXPECT_CALL(*this, FrameReady(media::VideoDecoder::kOk, _)); decoder_->Read(read_cb_); - decoder_->Pause(media::NewExpectedClosure()); - decoder_->Flush(media::NewExpectedClosure()); + decoder_->Reset(media::NewExpectedClosure()); message_loop_.RunAllPending(); - EXPECT_EQ(RTCVideoDecoder::kPaused, decoder_->state_); + EXPECT_EQ(RTCVideoDecoder::kNormal, decoder_->state_); } TEST_F(RTCVideoDecoderTest, DoRenderFrame) { - const base::TimeDelta kZero; - InitializeDecoderSuccessfully(); NullVideoFrame video_frame; |