diff options
author | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-15 23:35:31 +0000 |
---|---|---|
committer | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-15 23:35:31 +0000 |
commit | a4dae8e1ef4fe6988bb63fcbe7184280f60e98e7 (patch) | |
tree | 8ca0f8a9bf392d37fa49ab114924441f91cfeecf | |
parent | 89a985ca961f9e4bf90828f5415d3911db62a8a2 (diff) | |
download | chromium_src-a4dae8e1ef4fe6988bb63fcbe7184280f60e98e7.zip chromium_src-a4dae8e1ef4fe6988bb63fcbe7184280f60e98e7.tar.gz chromium_src-a4dae8e1ef4fe6988bb63fcbe7184280f60e98e7.tar.bz2 |
Callback renaming in media code.
This is a follow up CL of 125959.
- Rename AudioTimeCB and VideoTimeCB to TimeCB, as the context (VideoRenderer/AudioRenderer already provides clear context).
- Rename PipelineStatusCB callback variable names to status_cb if no names with specific meaning (e.g. seek_cb) are given.
- Rename foo_callback to foo_cb (except for media/audio/).
Note that media/audio also contains a lot of FooCallback types and foo_callback names. This will probably be addressed in another CL.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/9704046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127028 0039d316-1c4b-4281-b951-d872f2087c98
37 files changed, 254 insertions, 255 deletions
diff --git a/content/renderer/media/audio_renderer_impl_unittest.cc b/content/renderer/media/audio_renderer_impl_unittest.cc index 5320b1a..a0bb00c 100644 --- a/content/renderer/media/audio_renderer_impl_unittest.cc +++ b/content/renderer/media/audio_renderer_impl_unittest.cc @@ -109,7 +109,7 @@ class AudioRendererImplTest renderer_ = new TestAudioRendererImpl(default_sink.get()); renderer_->Initialize(decoder_, media::NewExpectedStatusCB(media::PIPELINE_OK), - NewUnderflowClosure(), NewAudioTimeClosure()); + NewUnderflowClosure(), NewTimeClosure()); // We need an event to verify that all tasks are done before leaving // our tests. @@ -127,13 +127,13 @@ class AudioRendererImplTest base::Unretained(this)); } - void OnAudioTimeCallback( + void OnTimeCallback( base::TimeDelta current_time, base::TimeDelta max_time) { CHECK(current_time <= max_time); } - media::AudioRenderer::AudioTimeCB NewAudioTimeClosure() { - return base::Bind(&AudioRendererImplTest::OnAudioTimeCallback, + media::AudioRenderer::TimeCB NewTimeClosure() { + return base::Bind(&AudioRendererImplTest::OnTimeCallback, base::Unretained(this)); } diff --git a/content/renderer/media/capture_video_decoder.cc b/content/renderer/media/capture_video_decoder.cc index 263b561..9e13469 100644 --- a/content/renderer/media/capture_video_decoder.cc +++ b/content/renderer/media/capture_video_decoder.cc @@ -34,13 +34,13 @@ CaptureVideoDecoder::~CaptureVideoDecoder() {} void CaptureVideoDecoder::Initialize( media::DemuxerStream* demuxer_stream, - const media::PipelineStatusCB& pipeline_status_cb, + const media::PipelineStatusCB& status_cb, const media::StatisticsCB& statistics_cb) { message_loop_proxy_->PostTask( FROM_HERE, base::Bind(&CaptureVideoDecoder::InitializeOnDecoderThread, this, make_scoped_refptr(demuxer_stream), - pipeline_status_cb, statistics_cb)); + status_cb, statistics_cb)); } void CaptureVideoDecoder::Read(const ReadCB& read_cb) { @@ -135,7 +135,7 @@ void CaptureVideoDecoder::OnDeviceInfoReceived( void CaptureVideoDecoder::InitializeOnDecoderThread( media::DemuxerStream* demuxer_stream, - const media::PipelineStatusCB& pipeline_status_cb, + const media::PipelineStatusCB& status_cb, const media::StatisticsCB& statistics_cb) { DVLOG(1) << "InitializeOnDecoderThread"; DCHECK(message_loop_proxy_->BelongsToCurrentThread()); @@ -143,7 +143,7 @@ void CaptureVideoDecoder::InitializeOnDecoderThread( capture_engine_ = vc_manager_->AddDevice(video_stream_id_, this); statistics_cb_ = statistics_cb; - pipeline_status_cb.Run(media::PIPELINE_OK); + status_cb.Run(media::PIPELINE_OK); state_ = kNormal; capture_engine_->StartCapture(this, capability_); } diff --git a/content/renderer/media/capture_video_decoder.h b/content/renderer/media/capture_video_decoder.h index 6c3ca6b..e408d8d 100644 --- a/content/renderer/media/capture_video_decoder.h +++ b/content/renderer/media/capture_video_decoder.h @@ -42,7 +42,7 @@ class CONTENT_EXPORT CaptureVideoDecoder // Decoder implementation. virtual void Initialize( media::DemuxerStream* demuxer_stream, - const media::PipelineStatusCB& pipeline_status_cb, + const media::PipelineStatusCB& status_cb, const media::StatisticsCB& statistics_cb) OVERRIDE; virtual void Read(const ReadCB& callback) OVERRIDE; virtual const gfx::Size& natural_size() OVERRIDE; @@ -79,7 +79,7 @@ class CONTENT_EXPORT CaptureVideoDecoder void InitializeOnDecoderThread( media::DemuxerStream* demuxer_stream, - const media::PipelineStatusCB& pipeline_status_cb, + const media::PipelineStatusCB& status_cb, const media::StatisticsCB& statistics_cb); void ReadOnDecoderThread(const ReadCB& callback); diff --git a/content/renderer/media/rtc_video_decoder.cc b/content/renderer/media/rtc_video_decoder.cc index b73cde1..e81fca0 100644 --- a/content/renderer/media/rtc_video_decoder.cc +++ b/content/renderer/media/rtc_video_decoder.cc @@ -40,20 +40,20 @@ RTCVideoDecoder::RTCVideoDecoder(MessageLoop* message_loop, RTCVideoDecoder::~RTCVideoDecoder() {} void RTCVideoDecoder::Initialize(DemuxerStream* demuxer_stream, - const PipelineStatusCB& pipeline_status_cb, + 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), - pipeline_status_cb, statistics_cb)); + status_cb, statistics_cb)); return; } DCHECK_EQ(MessageLoop::current(), message_loop_); state_ = kNormal; - pipeline_status_cb.Run(PIPELINE_OK); + status_cb.Run(PIPELINE_OK); // TODO(acolwell): Implement stats. } diff --git a/content/renderer/media/rtc_video_decoder.h b/content/renderer/media/rtc_video_decoder.h index 2ec7a15..eaa60d3 100644 --- a/content/renderer/media/rtc_video_decoder.h +++ b/content/renderer/media/rtc_video_decoder.h @@ -41,7 +41,7 @@ class CONTENT_EXPORT RTCVideoDecoder // Decoder implementation. virtual void Initialize( media::DemuxerStream* demuxer_stream, - const media::PipelineStatusCB& pipeline_status_cb, + const media::PipelineStatusCB& status_cb, const media::StatisticsCB& statistics_cb) OVERRIDE; virtual void Read(const ReadCB& callback) OVERRIDE; virtual const gfx::Size& natural_size() OVERRIDE; diff --git a/media/base/audio_decoder.h b/media/base/audio_decoder.h index 3b41694..e435a1c 100644 --- a/media/base/audio_decoder.h +++ b/media/base/audio_decoder.h @@ -23,7 +23,7 @@ class MEDIA_EXPORT AudioDecoder // callback upon completion. // statistics_cb is used to update global pipeline statistics. virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, - const PipelineStatusCB& callback, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb) = 0; // Request samples to be decoded and returned via the provided callback. diff --git a/media/base/composite_filter.cc b/media/base/composite_filter.cc index 235a810..d766948 100644 --- a/media/base/composite_filter.cc +++ b/media/base/composite_filter.cc @@ -88,71 +88,71 @@ FilterHost* CompositeFilter::host() { return host_impl_.get() ? host_impl_->host() : NULL; } -void CompositeFilter::Play(const base::Closure& play_callback) { +void CompositeFilter::Play(const base::Closure& play_cb) { DCHECK_EQ(message_loop_, MessageLoop::current()); if (IsOperationPending()) { SendErrorToHost(PIPELINE_ERROR_OPERATION_PENDING); - play_callback.Run(); + play_cb.Run(); return; } else if (state_ == kPlaying) { - play_callback.Run(); + play_cb.Run(); return; } else if (!host() || (state_ != kPaused && state_ != kCreated)) { SendErrorToHost(PIPELINE_ERROR_INVALID_STATE); - play_callback.Run(); + play_cb.Run(); return; } ChangeState(kPlayPending); - callback_ = play_callback; + callback_ = play_cb; StartSerialCallSequence(); } -void CompositeFilter::Pause(const base::Closure& pause_callback) { +void CompositeFilter::Pause(const base::Closure& pause_cb) { DCHECK_EQ(message_loop_, MessageLoop::current()); if (IsOperationPending()) { SendErrorToHost(PIPELINE_ERROR_OPERATION_PENDING); - pause_callback.Run(); + pause_cb.Run(); return; } else if (state_ == kPaused) { - pause_callback.Run(); + pause_cb.Run(); return; } else if (!host() || state_ != kPlaying) { SendErrorToHost(PIPELINE_ERROR_INVALID_STATE); - pause_callback.Run(); + pause_cb.Run(); return; } ChangeState(kPausePending); - callback_ = pause_callback; + callback_ = pause_cb; StartSerialCallSequence(); } -void CompositeFilter::Flush(const base::Closure& flush_callback) { +void CompositeFilter::Flush(const base::Closure& flush_cb) { DCHECK_EQ(message_loop_, MessageLoop::current()); if (IsOperationPending()) { SendErrorToHost(PIPELINE_ERROR_OPERATION_PENDING); - flush_callback.Run(); + flush_cb.Run(); return; } else if (!host() || (state_ != kCreated && state_ != kPaused)) { SendErrorToHost(PIPELINE_ERROR_INVALID_STATE); - flush_callback.Run(); + flush_cb.Run(); return; } ChangeState(kFlushPending); - callback_ = flush_callback; + callback_ = flush_cb; StartParallelCallSequence(); } -void CompositeFilter::Stop(const base::Closure& stop_callback) { +void CompositeFilter::Stop(const base::Closure& stop_cb) { DCHECK_EQ(message_loop_, MessageLoop::current()); if (!host()) { SendErrorToHost(PIPELINE_ERROR_INVALID_STATE); - stop_callback.Run(); + stop_cb.Run(); return; } else if (state_ == kStopped) { - stop_callback.Run(); + stop_cb.Run(); return; } @@ -177,7 +177,7 @@ void CompositeFilter::Stop(const base::Closure& stop_callback) { break; default: SendErrorToHost(PIPELINE_ERROR_INVALID_STATE); - stop_callback.Run(); + stop_cb.Run(); return; } @@ -186,7 +186,7 @@ void CompositeFilter::Stop(const base::Closure& stop_callback) { status_cb_.Reset(); } - callback_ = stop_callback; + callback_ = stop_cb; if (state_ == kStopPending) { StartSerialCallSequence(); } diff --git a/media/base/composite_filter.h b/media/base/composite_filter.h index 9821d03f..5bd2e78 100644 --- a/media/base/composite_filter.h +++ b/media/base/composite_filter.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -33,10 +33,10 @@ class MEDIA_EXPORT CompositeFilter : public Filter { // media::Filter methods. virtual void set_host(FilterHost* host) OVERRIDE; virtual FilterHost* host() OVERRIDE; - virtual void Play(const base::Closure& play_callback) OVERRIDE; - virtual void Pause(const base::Closure& pause_callback) OVERRIDE; - virtual void Flush(const base::Closure& flush_callback) OVERRIDE; - virtual void Stop(const base::Closure& stop_callback) OVERRIDE; + virtual void Play(const base::Closure& play_cb) OVERRIDE; + virtual void Pause(const base::Closure& pause_cb) OVERRIDE; + virtual void Flush(const base::Closure& flush_cb) OVERRIDE; + virtual void Stop(const base::Closure& stop_cb) OVERRIDE; virtual void SetPlaybackRate(float playback_rate) OVERRIDE; virtual void Seek( base::TimeDelta time, const FilterStatusCB& seek_cb) OVERRIDE; diff --git a/media/base/composite_filter_unittest.cc b/media/base/composite_filter_unittest.cc index 1072fc8..385d00c 100644 --- a/media/base/composite_filter_unittest.cc +++ b/media/base/composite_filter_unittest.cc @@ -89,16 +89,16 @@ class CompositeFilterTest : public testing::Test { void ExpectInvalidStateFail(MethodToCall method_to_call, base::TimeDelta seek_time = base::TimeDelta()); - // Returns whether |filter_1_callback_| or |filter_1_status_cb_| is set. + // Returns whether |filter_1_cb_| or |filter_1_status_cb_| is set. bool HasFilter1Callback() const; - // Run the callback stored in |filter_1_callback_| or |filter_2_status_cb_|. + // Run the callback stored in |filter_1_cb_| or |filter_2_status_cb_|. void RunFilter1Callback(); - // Returns whether |filter_2_callback_| or |filter_2_status_cb_| is set. + // Returns whether |filter_2_cb_| or |filter_2_status_cb_| is set. bool HasFilter2Callback() const; - // Run the callback stored in |filter_2_callback_| or |filter_2_status_cb_|. + // Run the callback stored in |filter_2_cb_| or |filter_2_status_cb_|. void RunFilter2Callback(); protected: @@ -112,7 +112,7 @@ class CompositeFilterTest : public testing::Test { // Callback passed to |filter_1_| during last Play(), Pause(), Flush(), // or Stop() call. - base::Closure filter_1_callback_; + base::Closure filter_1_cb_; // Status to pass to |filter_1_status_cb_|. PipelineStatus filter_1_status_; @@ -125,7 +125,7 @@ class CompositeFilterTest : public testing::Test { // Callback passed to |filter_2_| during last Play(), Pause(), Flush(), // Stop(), or Seek() call. - base::Closure filter_2_callback_; + base::Closure filter_2_cb_; // Status to pass to |filter_2_status_cb_|. PipelineStatus filter_2_status_; @@ -154,36 +154,36 @@ void CompositeFilterTest::SetupAndAdd2Filters() { composite_->set_host(mock_filter_host_.get()); // Setup |filter_1_| and arrange for methods to set - // |filter_1_callback_| when they are called. + // |filter_1_cb_| when they are called. filter_1_ = new StrictMock<MockFilter>(); - filter_1_callback_.Reset(); + filter_1_cb_.Reset(); filter_1_status_ = PIPELINE_OK; filter_1_status_cb_.Reset(); ON_CALL(*filter_1_, Play(_)) - .WillByDefault(SaveArg<0>(&filter_1_callback_)); + .WillByDefault(SaveArg<0>(&filter_1_cb_)); ON_CALL(*filter_1_, Pause(_)) - .WillByDefault(SaveArg<0>(&filter_1_callback_)); + .WillByDefault(SaveArg<0>(&filter_1_cb_)); ON_CALL(*filter_1_, Flush(_)) - .WillByDefault(SaveArg<0>(&filter_1_callback_)); + .WillByDefault(SaveArg<0>(&filter_1_cb_)); ON_CALL(*filter_1_, Stop(_)) - .WillByDefault(SaveArg<0>(&filter_1_callback_)); + .WillByDefault(SaveArg<0>(&filter_1_cb_)); ON_CALL(*filter_1_, Seek(_,_)) .WillByDefault(SaveArg<1>(&filter_1_status_cb_)); // Setup |filter_2_| and arrange for methods to set - // |filter_2_callback_| when they are called. + // |filter_2_cb_| when they are called. filter_2_ = new StrictMock<MockFilter>(); - filter_2_callback_.Reset(); + filter_2_cb_.Reset(); filter_2_status_ = PIPELINE_OK; filter_2_status_cb_.Reset(); ON_CALL(*filter_2_, Play(_)) - .WillByDefault(SaveArg<0>(&filter_2_callback_)); + .WillByDefault(SaveArg<0>(&filter_2_cb_)); ON_CALL(*filter_2_, Pause(_)) - .WillByDefault(SaveArg<0>(&filter_2_callback_)); + .WillByDefault(SaveArg<0>(&filter_2_cb_)); ON_CALL(*filter_2_, Flush(_)) - .WillByDefault(SaveArg<0>(&filter_2_callback_)); + .WillByDefault(SaveArg<0>(&filter_2_cb_)); ON_CALL(*filter_2_, Stop(_)) - .WillByDefault(SaveArg<0>(&filter_2_callback_)); + .WillByDefault(SaveArg<0>(&filter_2_cb_)); ON_CALL(*filter_2_, Seek(_,_)) .WillByDefault(SaveArg<1>(&filter_2_status_cb_)); @@ -328,8 +328,8 @@ void CompositeFilterTest::ExpectInvalidStateFail(MethodToCall method_to_call, } bool CompositeFilterTest::HasFilter1Callback() const { - CHECK(filter_1_callback_.is_null() || filter_1_status_cb_.is_null()); - return !filter_1_callback_.is_null() || !filter_1_status_cb_.is_null(); + CHECK(filter_1_cb_.is_null() || filter_1_status_cb_.is_null()); + return !filter_1_cb_.is_null() || !filter_1_status_cb_.is_null(); } void CompositeFilterTest::RunFilter1Callback() { @@ -341,15 +341,15 @@ void CompositeFilterTest::RunFilter1Callback() { return; } - EXPECT_TRUE(!filter_1_callback_.is_null()); - base::Closure callback = filter_1_callback_; - filter_1_callback_.Reset(); + EXPECT_TRUE(!filter_1_cb_.is_null()); + base::Closure callback = filter_1_cb_; + filter_1_cb_.Reset(); callback.Run(); } bool CompositeFilterTest::HasFilter2Callback() const { - CHECK(filter_2_callback_.is_null() || filter_2_status_cb_.is_null()); - return !filter_2_callback_.is_null() || !filter_2_status_cb_.is_null(); + CHECK(filter_2_cb_.is_null() || filter_2_status_cb_.is_null()); + return !filter_2_cb_.is_null() || !filter_2_status_cb_.is_null(); } void CompositeFilterTest::RunFilter2Callback() { @@ -361,9 +361,9 @@ void CompositeFilterTest::RunFilter2Callback() { return; } - EXPECT_FALSE(filter_2_callback_.is_null()); - base::Closure callback = filter_2_callback_; - filter_2_callback_.Reset(); + EXPECT_FALSE(filter_2_cb_.is_null()); + base::Closure callback = filter_2_cb_; + filter_2_cb_.Reset(); callback.Run(); } @@ -539,7 +539,7 @@ TEST_F(CompositeFilterTest, TestPauseErrors) { RunFilter1Callback(); - // Make sure |filter_2_callback_| was not set. + // Make sure |filter_2_cb_| was not set. EXPECT_FALSE(HasFilter2Callback()); // Verify that Play/Pause/Flush/Seek fail now that an error occured. diff --git a/media/base/demuxer.cc b/media/base/demuxer.cc index b6b2d18..f3aa340 100644 --- a/media/base/demuxer.cc +++ b/media/base/demuxer.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -22,9 +22,9 @@ void Demuxer::set_host(DemuxerHost* host) { void Demuxer::SetPlaybackRate(float playback_rate) {} -void Demuxer::Seek(base::TimeDelta time, const PipelineStatusCB& callback) { - DCHECK(!callback.is_null()); - callback.Run(PIPELINE_OK); +void Demuxer::Seek(base::TimeDelta time, const PipelineStatusCB& status_cb) { + DCHECK(!status_cb.is_null()); + status_cb.Run(PIPELINE_OK); } void Demuxer::Stop(const base::Closure& callback) { diff --git a/media/base/demuxer.h b/media/base/demuxer.h index f049f6f..d60e793 100644 --- a/media/base/demuxer.h +++ b/media/base/demuxer.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -52,7 +52,7 @@ class MEDIA_EXPORT Demuxer // Carry out any actions required to seek to the given time, executing the // callback upon completion. - virtual void Seek(base::TimeDelta time, const PipelineStatusCB& callback); + virtual void Seek(base::TimeDelta time, const PipelineStatusCB& status_cb); // The pipeline is being stopped either as a result of an error or because // the client called Stop(). diff --git a/media/base/filters.h b/media/base/filters.h index 50dc686..242af5c 100644 --- a/media/base/filters.h +++ b/media/base/filters.h @@ -124,7 +124,7 @@ class MEDIA_EXPORT VideoDecoder : public Filter { // callback upon completion. // statistics_cb is used to update global pipeline statistics. virtual void Initialize(DemuxerStream* stream, - const PipelineStatusCB& callback, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb) = 0; // Request a frame to be decoded and returned via the provided callback. @@ -171,14 +171,14 @@ class MEDIA_EXPORT VideoRenderer : public Filter { public: // Used to update the pipeline's clock time. The parameter is the time that // the clock should not exceed. - typedef base::Callback<void(base::TimeDelta)> VideoTimeCB; + typedef base::Callback<void(base::TimeDelta)> TimeCB; // Initialize a VideoRenderer with the given VideoDecoder, executing the // callback upon completion. virtual void Initialize(VideoDecoder* decoder, - const PipelineStatusCB& callback, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb, - const VideoTimeCB& time_cb) = 0; + const TimeCB& time_cb) = 0; // Returns true if this filter has received and processed an end-of-stream // buffer. @@ -191,18 +191,18 @@ class MEDIA_EXPORT AudioRenderer : public Filter { // Used to update the pipeline's clock time. The first parameter is the // current time, and the second parameter is the time that the clock must not // exceed. - typedef base::Callback<void(base::TimeDelta, base::TimeDelta)> AudioTimeCB; + typedef base::Callback<void(base::TimeDelta, base::TimeDelta)> TimeCB; // Initialize a AudioRenderer with the given AudioDecoder, executing the - // |init_callback| upon completion. |underflow_callback| is called when the + // |init_cb| upon completion. |underflow_cb| is called when the // renderer runs out of data to pass to the audio card during playback. - // If the |underflow_callback| is called ResumeAfterUnderflow() must be called + // If the |underflow_cb| is called ResumeAfterUnderflow() must be called // to resume playback. Pause(), Seek(), or Stop() cancels the underflow // condition. virtual void Initialize(const scoped_refptr<AudioDecoder>& decoder, - const PipelineStatusCB& init_callback, - const base::Closure& underflow_callback, - const AudioTimeCB& time_cb) = 0; + const PipelineStatusCB& init_cb, + const base::Closure& underflow_cb, + const TimeCB& time_cb) = 0; // Returns true if this filter has received and processed an end-of-stream // buffer. diff --git a/media/base/mock_filters.cc b/media/base/mock_filters.cc index 74d80e6..08d663a 100644 --- a/media/base/mock_filters.cc +++ b/media/base/mock_filters.cc @@ -130,7 +130,7 @@ MockFilterCollection::~MockFilterCollection() {} scoped_ptr<FilterCollection> MockFilterCollection::filter_collection( bool include_demuxer, - bool run_build_callback, + bool run_build_cb, bool run_build, PipelineStatus build_status) const { scoped_ptr<FilterCollection> collection(new FilterCollection()); @@ -141,7 +141,7 @@ scoped_ptr<FilterCollection> MockFilterCollection::filter_collection( if (build_status != PIPELINE_OK) demuxer_factory->SetError(build_status); - if (run_build_callback) { + if (run_build_cb) { ON_CALL(*demuxer_factory, Build(_, _)).WillByDefault(Invoke( demuxer_factory.get(), &MockDemuxerFactory::RunBuildCallback)); } // else ignore Build calls. @@ -170,14 +170,14 @@ void RunPipelineStatusCB(PipelineStatus status, const PipelineStatusCB& cb) { cb.Run(status); } -void RunPipelineStatusCB3(::testing::Unused, const PipelineStatusCB& callback, +void RunPipelineStatusCB3(::testing::Unused, const PipelineStatusCB& status_cb, ::testing::Unused) { - callback.Run(PIPELINE_OK); + status_cb.Run(PIPELINE_OK); } -void RunPipelineStatusCB4(::testing::Unused, const PipelineStatusCB& callback, +void RunPipelineStatusCB4(::testing::Unused, const PipelineStatusCB& status_cb, ::testing::Unused, ::testing::Unused) { - callback.Run(PIPELINE_OK); + status_cb.Run(PIPELINE_OK); } void RunStopFilterCallback(const base::Closure& callback) { diff --git a/media/base/mock_filters.h b/media/base/mock_filters.h index d1a472a..3b1d77f 100644 --- a/media/base/mock_filters.h +++ b/media/base/mock_filters.h @@ -187,7 +187,7 @@ class MockVideoDecoder : public VideoDecoder { // VideoDecoder implementation. MOCK_METHOD3(Initialize, void(DemuxerStream* stream, - const PipelineStatusCB& callback, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb)); MOCK_METHOD1(Read, void(const ReadCB& read_cb)); MOCK_METHOD0(natural_size, const gfx::Size&()); @@ -234,9 +234,9 @@ class MockVideoRenderer : public VideoRenderer { // VideoRenderer implementation. MOCK_METHOD4(Initialize, void(VideoDecoder* decoder, - const PipelineStatusCB& callback, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb, - const VideoTimeCB& time_cb)); + const TimeCB& time_cb)); MOCK_METHOD0(HasEnded, bool()); @@ -263,9 +263,9 @@ class MockAudioRenderer : public AudioRenderer { // AudioRenderer implementation. MOCK_METHOD4(Initialize, void(const scoped_refptr<AudioDecoder>& decoder, - const PipelineStatusCB& init_callback, - const base::Closure& underflow_callback, - const AudioTimeCB& time_cb)); + const PipelineStatusCB& init_cb, + const base::Closure& underflow_cb, + const TimeCB& time_cb)); MOCK_METHOD0(HasEnded, bool()); MOCK_METHOD1(SetVolume, void(float volume)); @@ -297,7 +297,7 @@ class MockFilterCollection { } scoped_ptr<FilterCollection> filter_collection( - bool include_demuxer, bool run_build_callback, bool run_build, + bool include_demuxer, bool run_build_cb, bool run_build, PipelineStatus build_status) const; private: @@ -316,9 +316,9 @@ class MockFilterCollection { void RunFilterCallback(::testing::Unused, const base::Closure& callback); void RunFilterStatusCB(::testing::Unused, const FilterStatusCB& cb); void RunPipelineStatusCB(PipelineStatus status, const PipelineStatusCB& cb); -void RunPipelineStatusCB3(::testing::Unused, const PipelineStatusCB& callback, +void RunPipelineStatusCB3(::testing::Unused, const PipelineStatusCB& status_cb, ::testing::Unused); -void RunPipelineStatusCB4(::testing::Unused, const PipelineStatusCB& callback, +void RunPipelineStatusCB4(::testing::Unused, const PipelineStatusCB& status_cb, ::testing::Unused, ::testing::Unused); // Helper gmock function that immediately executes the Closure on behalf of the // provided filter. Can be used when mocking the Stop() method. diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc index 9da3df1..c7754bd 100644 --- a/media/base/pipeline.cc +++ b/media/base/pipeline.cc @@ -90,37 +90,37 @@ Pipeline::~Pipeline() { void Pipeline::Start(scoped_ptr<FilterCollection> collection, const std::string& url, - const PipelineStatusCB& ended_callback, - const PipelineStatusCB& error_callback, - const NetworkEventCB& network_callback, - const PipelineStatusCB& start_callback) { + const PipelineStatusCB& ended_cb, + const PipelineStatusCB& error_cb, + const NetworkEventCB& network_cb, + const PipelineStatusCB& start_cb) { base::AutoLock auto_lock(lock_); CHECK(!running_) << "Media pipeline is already running"; running_ = true; message_loop_->PostTask(FROM_HERE, base::Bind( &Pipeline::StartTask, this, base::Passed(&collection), - url, ended_callback, error_callback, network_callback, start_callback)); + url, ended_cb, error_cb, network_cb, start_cb)); } -void Pipeline::Stop(const PipelineStatusCB& stop_callback) { +void Pipeline::Stop(const PipelineStatusCB& stop_cb) { base::AutoLock auto_lock(lock_); CHECK(running_) << "Media pipeline isn't running"; // Stop the pipeline, which will set |running_| to false on our behalf. message_loop_->PostTask(FROM_HERE, base::Bind( - &Pipeline::StopTask, this, stop_callback)); + &Pipeline::StopTask, this, stop_cb)); } void Pipeline::Seek(base::TimeDelta time, - const PipelineStatusCB& seek_callback) { + const PipelineStatusCB& seek_cb) { base::AutoLock auto_lock(lock_); CHECK(running_) << "Media pipeline isn't running"; download_rate_monitor_.Stop(); message_loop_->PostTask(FROM_HERE, base::Bind( - &Pipeline::SeekTask, this, time, seek_callback)); + &Pipeline::SeekTask, this, time, seek_cb)); } bool Pipeline::IsRunning() const { @@ -381,9 +381,9 @@ void Pipeline::FinishInitialization() { DCHECK_EQ(MessageLoop::current(), message_loop_); // Execute the seek callback, if present. Note that this might be the // initial callback passed into Start(). - if (!seek_callback_.is_null()) { - seek_callback_.Run(status_); - seek_callback_.Reset(); + if (!seek_cb_.is_null()) { + seek_cb_.Run(status_); + seek_cb_.Reset(); } } @@ -602,18 +602,18 @@ void Pipeline::OnUpdateStatistics(const PipelineStatistics& stats) { void Pipeline::StartTask(scoped_ptr<FilterCollection> filter_collection, const std::string& url, - const PipelineStatusCB& ended_callback, - const PipelineStatusCB& error_callback, - const NetworkEventCB& network_callback, - const PipelineStatusCB& start_callback) { + const PipelineStatusCB& ended_cb, + const PipelineStatusCB& error_cb, + const NetworkEventCB& network_cb, + const PipelineStatusCB& start_cb) { DCHECK_EQ(MessageLoop::current(), message_loop_); DCHECK_EQ(kCreated, state_); filter_collection_ = filter_collection.Pass(); url_ = url; - ended_callback_ = ended_callback; - error_callback_ = error_callback; - network_callback_ = network_callback; - seek_callback_ = start_callback; + ended_cb_ = ended_cb; + error_cb_ = error_cb; + network_cb_ = network_cb; + seek_cb_ = start_cb; // Kick off initialization. pipeline_init_state_.reset(new PipelineInitState()); @@ -636,7 +636,7 @@ void Pipeline::StartTask(scoped_ptr<FilterCollection> filter_collection, // // When all required filters have been created and have called their // FilterHost's InitializationComplete() method, the pipeline will update its -// state to kStarted and |init_callback_|, will be executed. +// state to kStarted and |init_cb_|, will be executed. // // TODO(hclam): InitializeTask() is now starting the pipeline asynchronously. It // works like a big state change table. If we no longer need to start filters @@ -746,7 +746,7 @@ void Pipeline::InitializeTask(PipelineStatus last_stage_status) { // TODO(scherkus): beware! this can get posted multiple times since we post // Stop() tasks even if we've already stopped. Perhaps this should no-op for // additional calls, however most of this logic will be changing. -void Pipeline::StopTask(const PipelineStatusCB& stop_callback) { +void Pipeline::StopTask(const PipelineStatusCB& stop_cb) { DCHECK_EQ(MessageLoop::current(), message_loop_); DCHECK(!IsPipelineStopPending()); DCHECK_NE(state_, kStopped); @@ -758,13 +758,13 @@ void Pipeline::StopTask(const PipelineStatusCB& stop_callback) { if (state_ == kStopped) { // Already stopped so just run callback. - stop_callback.Run(status_); + stop_cb.Run(status_); return; } if (IsPipelineTearingDown() && error_caused_teardown_) { // If we are stopping due to SetError(), stop normally instead of - // going to error state and calling |error_callback_|. This converts + // going to error state and calling |error_cb_|. This converts // the teardown in progress from an error teardown into one that acts // like the error never occurred. base::AutoLock auto_lock(lock_); @@ -772,7 +772,7 @@ void Pipeline::StopTask(const PipelineStatusCB& stop_callback) { error_caused_teardown_ = false; } - stop_callback_ = stop_callback; + stop_cb_ = stop_cb; stop_pending_ = true; if (!IsPipelineSeeking() && !IsPipelineTearingDown()) { @@ -855,7 +855,7 @@ void Pipeline::PreloadChangedTask(Preload preload) { } void Pipeline::SeekTask(base::TimeDelta time, - const PipelineStatusCB& seek_callback) { + const PipelineStatusCB& seek_cb) { DCHECK_EQ(MessageLoop::current(), message_loop_); DCHECK(!IsPipelineStopPending()); @@ -880,7 +880,7 @@ void Pipeline::SeekTask(base::TimeDelta time, // kStarted SetState(kPausing); seek_timestamp_ = time; - seek_callback_ = seek_callback; + seek_cb_ = seek_cb; // Kick off seeking! { @@ -926,15 +926,15 @@ void Pipeline::NotifyEndedTask() { clock_->EndOfStream(); } - if (!ended_callback_.is_null()) { - ended_callback_.Run(status_); + if (!ended_cb_.is_null()) { + ended_cb_.Run(status_); } } void Pipeline::NotifyNetworkEventTask(NetworkEvent type) { DCHECK_EQ(MessageLoop::current(), message_loop_); - if (!network_callback_.is_null()) - network_callback_.Run(type); + if (!network_cb_.is_null()) + network_cb_.Run(type); } void Pipeline::DisableAudioRendererTask() { @@ -1098,14 +1098,14 @@ void Pipeline::FinishDestroyingFiltersTask() { pipeline_filter_ = NULL; - if (error_caused_teardown_ && !IsPipelineOk() && !error_callback_.is_null()) - error_callback_.Run(status_); + if (error_caused_teardown_ && !IsPipelineOk() && !error_cb_.is_null()) + error_cb_.Run(status_); if (stop_pending_) { stop_pending_ = false; ResetState(); PipelineStatusCB stop_cb; - std::swap(stop_cb, stop_callback_); + std::swap(stop_cb, stop_cb_); // Notify the client that stopping has finished. if (!stop_cb.is_null()) { stop_cb.Run(status_); diff --git a/media/base/pipeline.h b/media/base/pipeline.h index c960912..659199f 100644 --- a/media/base/pipeline.h +++ b/media/base/pipeline.h @@ -122,12 +122,12 @@ class MEDIA_EXPORT Pipeline // // Pipeline initialization is an inherently asynchronous process. Clients can // either poll the IsInitialized() method (discouraged) or optionally pass in - // |start_callback|, which will be executed when initialization completes. + // |start_cb|, which will be executed when initialization completes. // // The following permanent callbacks will be executed as follows: - // |ended_callback| will be executed whenever the media reaches the end. - // |error_callback_| will be executed whenever an error occurs. - // |network_callback_| will be executed whenever there's a network activity. + // |ended_cb| will be executed whenever the media reaches the end. + // |error_cb_| will be executed whenever an error occurs. + // |network_cb_| will be executed whenever there's a network activity. // // These callbacks are only executed after Start() has been called and until // Stop() has completed. @@ -137,14 +137,14 @@ class MEDIA_EXPORT Pipeline // TODO(scherkus): remove IsInitialized() and force clients to use callbacks. void Start(scoped_ptr<FilterCollection> filter_collection, const std::string& url, - const PipelineStatusCB& ended_callback, - const PipelineStatusCB& error_callback, - const NetworkEventCB& network_callback, - const PipelineStatusCB& start_callback); + const PipelineStatusCB& ended_cb, + const PipelineStatusCB& error_cb, + const NetworkEventCB& network_cb, + const PipelineStatusCB& start_cb); // Asynchronously stops the pipeline and resets it to an uninitialized state. // - // If provided, |stop_callback| will be executed when the pipeline has been + // If provided, |stop_cb| will be executed when the pipeline has been // completely torn down and reset to an uninitialized state. It is acceptable // to call Start() again once the callback has finished executing. // @@ -155,16 +155,16 @@ class MEDIA_EXPORT Pipeline // // TODO(scherkus): ideally clients would destroy the pipeline after calling // Stop() and create a new pipeline as needed. - void Stop(const PipelineStatusCB& stop_callback); + void Stop(const PipelineStatusCB& stop_cb); - // Attempt to seek to the position specified by time. |seek_callback| will be + // Attempt to seek to the position specified by time. |seek_cb| will be // executed when the all filters in the pipeline have processed the seek. // // Clients are expected to call GetCurrentTime() to check whether the seek // succeeded. // // It is an error to call this method if the pipeline has not started. - void Seek(base::TimeDelta time, const PipelineStatusCB& seek_callback); + void Seek(base::TimeDelta time, const PipelineStatusCB& seek_cb); // Returns true if the pipeline has been started via Start(). If IsRunning() // returns true, it is expected that Stop() will be called before destroying @@ -353,10 +353,10 @@ class MEDIA_EXPORT Pipeline // message loop. void StartTask(scoped_ptr<FilterCollection> filter_collection, const std::string& url, - const PipelineStatusCB& ended_callback, - const PipelineStatusCB& error_callback, - const NetworkEventCB& network_callback, - const PipelineStatusCB& start_callback); + const PipelineStatusCB& ended_cb, + const PipelineStatusCB& error_cb, + const NetworkEventCB& network_cb, + const PipelineStatusCB& start_cb); // InitializeTask() performs initialization in multiple passes. It is executed // as a result of calling Start() or InitializationComplete() that advances @@ -366,7 +366,7 @@ class MEDIA_EXPORT Pipeline void InitializeTask(PipelineStatus last_stage_status); // Stops and destroys all filters, placing the pipeline in the kStopped state. - void StopTask(const PipelineStatusCB& stop_callback); + void StopTask(const PipelineStatusCB& stop_cb); // Carries out stopping and destroying all filters, placing the pipeline in // the kError state. @@ -385,7 +385,7 @@ class MEDIA_EXPORT Pipeline void PreloadChangedTask(Preload preload); // Carries out notifying filters that we are seeking to a new timestamp. - void SeekTask(base::TimeDelta time, const PipelineStatusCB& seek_callback); + void SeekTask(base::TimeDelta time, const PipelineStatusCB& seek_cb); // Carries out handling a notification from a filter that it has ended. void NotifyEndedTask(); @@ -591,11 +591,11 @@ class MEDIA_EXPORT Pipeline std::string url_; // Callbacks for various pipeline operations. - PipelineStatusCB seek_callback_; - PipelineStatusCB stop_callback_; - PipelineStatusCB ended_callback_; - PipelineStatusCB error_callback_; - NetworkEventCB network_callback_; + PipelineStatusCB seek_cb_; + PipelineStatusCB stop_cb_; + PipelineStatusCB ended_cb_; + PipelineStatusCB error_cb_; + NetworkEventCB network_cb_; // Reference to the filter(s) that constitute the pipeline. scoped_refptr<Filter> pipeline_filter_; diff --git a/media/base/pipeline_unittest.cc b/media/base/pipeline_unittest.cc index 8008f43..83b3c82 100644 --- a/media/base/pipeline_unittest.cc +++ b/media/base/pipeline_unittest.cc @@ -159,8 +159,8 @@ class PipelineTest : public ::testing::Test { } // Sets up expectations to allow the audio renderer to initialize. - void InitializeAudioRenderer(bool disable_after_init_callback = false) { - if (disable_after_init_callback) { + void InitializeAudioRenderer(bool disable_after_init_cb = false) { + if (disable_after_init_cb) { EXPECT_CALL(*mocks_->audio_renderer(), Initialize( scoped_refptr<AudioDecoder>(mocks_->audio_decoder()), _, _, _)) .WillOnce(DoAll(Invoke(&RunPipelineStatusCB4), @@ -854,25 +854,25 @@ TEST_F(PipelineTest, StartTimeIsNonZero) { class FlexibleCallbackRunner : public base::DelegateSimpleThread::Delegate { public: FlexibleCallbackRunner(base::TimeDelta delay, PipelineStatus status, - const PipelineStatusCB& callback) + const PipelineStatusCB& status_cb) : delay_(delay), status_(status), - callback_(callback) { + status_cb_(status_cb) { if (delay_ < base::TimeDelta()) { - callback_.Run(status_); + status_cb_.Run(status_); return; } } virtual void Run() { if (delay_ < base::TimeDelta()) return; base::PlatformThread::Sleep(delay_); - callback_.Run(status_); + status_cb_.Run(status_); } private: base::TimeDelta delay_; PipelineStatus status_; - PipelineStatusCB callback_; + PipelineStatusCB status_cb_; }; void TestPipelineStatusNotification(base::TimeDelta delay) { diff --git a/media/filters/audio_renderer_base.cc b/media/filters/audio_renderer_base.cc index 0162f66..d04926f 100644 --- a/media/filters/audio_renderer_base.cc +++ b/media/filters/audio_renderer_base.cc @@ -40,13 +40,13 @@ void AudioRendererBase::Play(const base::Closure& callback) { void AudioRendererBase::Pause(const base::Closure& callback) { base::AutoLock auto_lock(lock_); DCHECK(state_ == kPlaying || state_ == kUnderflow || state_ == kRebuffering); - pause_callback_ = callback; + pause_cb_ = callback; state_ = kPaused; // Pause only when we've completed our pending read. if (!pending_read_) { - pause_callback_.Run(); - pause_callback_.Reset(); + pause_cb_.Run(); + pause_cb_.Reset(); } else { state_ = kPaused; } @@ -62,8 +62,8 @@ void AudioRendererBase::Stop(const base::Closure& callback) { base::AutoLock auto_lock(lock_); state_ = kStopped; algorithm_.reset(NULL); - audio_time_cb_.Reset(); - underflow_callback_.Reset(); + time_cb_.Reset(); + underflow_cb_.Reset(); } if (!callback.is_null()) { callback.Run(); @@ -74,7 +74,7 @@ void AudioRendererBase::Seek(base::TimeDelta time, const FilterStatusCB& cb) { base::AutoLock auto_lock(lock_); DCHECK_EQ(kPaused, state_); DCHECK(!pending_read_) << "Pending read must complete before seeking"; - DCHECK(pause_callback_.is_null()); + DCHECK(pause_cb_.is_null()); DCHECK(seek_cb_.is_null()); state_ = kSeeking; seek_cb_ = cb; @@ -90,17 +90,17 @@ void AudioRendererBase::Seek(base::TimeDelta time, const FilterStatusCB& cb) { } void AudioRendererBase::Initialize(const scoped_refptr<AudioDecoder>& decoder, - const PipelineStatusCB& init_callback, - const base::Closure& underflow_callback, - const AudioTimeCB& audio_time_cb) { + const PipelineStatusCB& init_cb, + const base::Closure& underflow_cb, + const TimeCB& time_cb) { DCHECK(decoder); - DCHECK(!init_callback.is_null()); - DCHECK(!underflow_callback.is_null()); - DCHECK(!audio_time_cb.is_null()); + DCHECK(!init_cb.is_null()); + DCHECK(!underflow_cb.is_null()); + DCHECK(!time_cb.is_null()); DCHECK_EQ(kUninitialized, state_); decoder_ = decoder; - underflow_callback_ = underflow_callback; - audio_time_cb_ = audio_time_cb; + underflow_cb_ = underflow_cb; + time_cb_ = time_cb; // Create a callback so our algorithm can request more reads. base::Closure cb = base::Bind(&AudioRendererBase::ScheduleRead_Locked, this); @@ -125,13 +125,13 @@ void AudioRendererBase::Initialize(const scoped_refptr<AudioDecoder>& decoder, // Give the subclass an opportunity to initialize itself. if (!config_ok || !OnInitialize(bits_per_channel, channel_layout, sample_rate)) { - init_callback.Run(PIPELINE_ERROR_INITIALIZATION_FAILED); + init_cb.Run(PIPELINE_ERROR_INITIALIZATION_FAILED); return; } // Finally, execute the start callback. state_ = kPaused; - init_callback.Run(PIPELINE_OK); + init_cb.Run(PIPELINE_OK); } bool AudioRendererBase::HasEnded() { @@ -176,7 +176,7 @@ void AudioRendererBase::DecodedAudioReady(scoped_refptr<Buffer> buffer) { if (buffer && !buffer->IsEndOfStream()) algorithm_->EnqueueBuffer(buffer); DCHECK(!pending_read_); - ResetAndRunCB(&pause_callback_); + ResetAndRunCB(&pause_cb_); return; case kSeeking: if (IsBeforeSeekTime(buffer)) { @@ -253,7 +253,7 @@ uint32 AudioRendererBase::FillBuffer(uint8* dest, OnRenderEndOfStream(); } else if (state_ == kPlaying) { state_ = kUnderflow; - underflow_cb = underflow_callback_; + underflow_cb = underflow_cb_; } } else { // Otherwise fill the buffer. @@ -269,7 +269,7 @@ uint32 AudioRendererBase::FillBuffer(uint8* dest, if (last_fill_buffer_time.InMicroseconds() > 0 && (last_fill_buffer_time != last_fill_buffer_time_ || new_current_time > host()->GetTime())) { - audio_time_cb_.Run(new_current_time, last_fill_buffer_time); + time_cb_.Run(new_current_time, last_fill_buffer_time); } if (!underflow_cb.is_null()) diff --git a/media/filters/audio_renderer_base.h b/media/filters/audio_renderer_base.h index 20997ae..73615a1 100644 --- a/media/filters/audio_renderer_base.h +++ b/media/filters/audio_renderer_base.h @@ -43,9 +43,9 @@ class MEDIA_EXPORT AudioRendererBase : public AudioRenderer { // AudioRenderer implementation. virtual void Initialize(const scoped_refptr<AudioDecoder>& decoder, - const PipelineStatusCB& init_callback, - const base::Closure& underflow_callback, - const AudioTimeCB& audio_time_cb) OVERRIDE; + const PipelineStatusCB& init_cb, + const base::Closure& underflow_cb, + const TimeCB& time_cb) OVERRIDE; virtual bool HasEnded() OVERRIDE; virtual void ResumeAfterUnderflow(bool buffer_more_audio) OVERRIDE; @@ -153,12 +153,12 @@ class MEDIA_EXPORT AudioRendererBase : public AudioRenderer { base::TimeDelta last_fill_buffer_time_; // Filter callbacks. - base::Closure pause_callback_; + base::Closure pause_cb_; FilterStatusCB seek_cb_; - base::Closure underflow_callback_; + base::Closure underflow_cb_; - AudioTimeCB audio_time_cb_; + TimeCB time_cb_; base::TimeDelta seek_timestamp_; diff --git a/media/filters/audio_renderer_base_unittest.cc b/media/filters/audio_renderer_base_unittest.cc index 58bc59f..8b037f8 100644 --- a/media/filters/audio_renderer_base_unittest.cc +++ b/media/filters/audio_renderer_base_unittest.cc @@ -96,7 +96,7 @@ class AudioRendererBaseTest : public ::testing::Test { CHECK(current_time <= max_time); } - AudioRenderer::AudioTimeCB NewAudioTimeClosure() { + AudioRenderer::TimeCB NewAudioTimeClosure() { return base::Bind(&AudioRendererBaseTest::OnAudioTimeCallback, base::Unretained(this)); } diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc index 97c67f6..c5a7001 100644 --- a/media/filters/ffmpeg_audio_decoder.cc +++ b/media/filters/ffmpeg_audio_decoder.cc @@ -71,7 +71,7 @@ FFmpegAudioDecoder::~FFmpegAudioDecoder() { void FFmpegAudioDecoder::Initialize( const scoped_refptr<DemuxerStream>& stream, - const PipelineStatusCB& pipeline_status_cb, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb) { if (!message_loop_) { message_loop_ = message_loop_factory_cb_.Run(); @@ -84,7 +84,7 @@ void FFmpegAudioDecoder::Initialize( message_loop_->PostTask( FROM_HERE, base::Bind(&FFmpegAudioDecoder::DoInitialize, this, - stream, pipeline_status_cb, statistics_cb)); + stream, status_cb, statistics_cb)); } void FFmpegAudioDecoder::Read(const ReadCB& read_cb) { @@ -113,7 +113,7 @@ void FFmpegAudioDecoder::Reset(const base::Closure& closure) { void FFmpegAudioDecoder::DoInitialize( const scoped_refptr<DemuxerStream>& stream, - const PipelineStatusCB& pipeline_status_cb, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb) { demuxer_stream_ = stream; const AudioDecoderConfig& config = stream->audio_decoder_config(); @@ -128,7 +128,7 @@ void FFmpegAudioDecoder::DoInitialize( << " bits per channel: " << config.bits_per_channel() << " samples per second: " << config.samples_per_second(); - pipeline_status_cb.Run(DECODER_ERROR_NOT_SUPPORTED); + status_cb.Run(DECODER_ERROR_NOT_SUPPORTED); return; } @@ -141,7 +141,7 @@ void FFmpegAudioDecoder::DoInitialize( DLOG(ERROR) << "Could not initialize audio decoder: " << codec_context_->codec_id; - pipeline_status_cb.Run(DECODER_ERROR_NOT_SUPPORTED); + status_cb.Run(DECODER_ERROR_NOT_SUPPORTED); return; } @@ -150,7 +150,7 @@ void FFmpegAudioDecoder::DoInitialize( channel_layout_ = config.channel_layout(); samples_per_second_ = config.samples_per_second(); - pipeline_status_cb.Run(PIPELINE_OK); + status_cb.Run(PIPELINE_OK); } void FFmpegAudioDecoder::DoReset(const base::Closure& closure) { diff --git a/media/filters/ffmpeg_audio_decoder.h b/media/filters/ffmpeg_audio_decoder.h index 8654f1936..51d8e00 100644 --- a/media/filters/ffmpeg_audio_decoder.h +++ b/media/filters/ffmpeg_audio_decoder.h @@ -24,7 +24,7 @@ class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder { // AudioDecoder implementation. virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, - const PipelineStatusCB& pipeline_status_cb, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb) OVERRIDE; virtual void Read(const ReadCB& read_cb) OVERRIDE; virtual int bits_per_channel() OVERRIDE; @@ -35,7 +35,7 @@ class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder { private: // Methods running on decoder thread. void DoInitialize(const scoped_refptr<DemuxerStream>& stream, - const PipelineStatusCB& pipeline_status_cb, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb); void DoReset(const base::Closure& closure); void DoRead(const ReadCB& read_cb); diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc index 51724db..de33ded 100644 --- a/media/filters/ffmpeg_demuxer.cc +++ b/media/filters/ffmpeg_demuxer.cc @@ -354,12 +354,11 @@ void FFmpegDemuxer::set_host(DemuxerHost* demuxer_host) { } void FFmpegDemuxer::Initialize(DataSource* data_source, - const PipelineStatusCB& callback) { + const PipelineStatusCB& status_cb) { message_loop_->PostTask( FROM_HERE, base::Bind(&FFmpegDemuxer::InitializeTask, this, - make_scoped_refptr(data_source), - callback)); + make_scoped_refptr(data_source), status_cb)); } scoped_refptr<DemuxerStream> FFmpegDemuxer::GetStream( @@ -452,7 +451,7 @@ MessageLoop* FFmpegDemuxer::message_loop() { } void FFmpegDemuxer::InitializeTask(DataSource* data_source, - const PipelineStatusCB& callback) { + const PipelineStatusCB& status_cb) { DCHECK_EQ(MessageLoop::current(), message_loop_); data_source_ = data_source; @@ -471,7 +470,7 @@ void FFmpegDemuxer::InitializeTask(DataSource* data_source, FFmpegGlue::GetInstance()->RemoveProtocol(this); if (result < 0) { - callback.Run(DEMUXER_ERROR_COULD_NOT_OPEN); + status_cb.Run(DEMUXER_ERROR_COULD_NOT_OPEN); return; } @@ -481,7 +480,7 @@ void FFmpegDemuxer::InitializeTask(DataSource* data_source, // Fully initialize AVFormatContext by parsing the stream a little. result = avformat_find_stream_info(format_context_, NULL); if (result < 0) { - callback.Run(DEMUXER_ERROR_COULD_NOT_PARSE); + status_cb.Run(DEMUXER_ERROR_COULD_NOT_PARSE); return; } @@ -523,7 +522,7 @@ void FFmpegDemuxer::InitializeTask(DataSource* data_source, } if (!found_audio_stream && !found_video_stream) { - callback.Run(DEMUXER_ERROR_NO_SUPPORTED_STREAMS); + status_cb.Run(DEMUXER_ERROR_NO_SUPPORTED_STREAMS); return; } @@ -554,7 +553,7 @@ void FFmpegDemuxer::InitializeTask(DataSource* data_source, if (bitrate > 0) data_source_->SetBitrate(bitrate); - callback.Run(PIPELINE_OK); + status_cb.Run(PIPELINE_OK); } int FFmpegDemuxer::GetBitrate() { diff --git a/media/filters/ffmpeg_demuxer.h b/media/filters/ffmpeg_demuxer.h index 24939ae..0d1fb86 100644 --- a/media/filters/ffmpeg_demuxer.h +++ b/media/filters/ffmpeg_demuxer.h @@ -137,7 +137,7 @@ class MEDIA_EXPORT FFmpegDemuxer : public Demuxer, public FFmpegURLProtocol { virtual void PostDemuxTask(); void Initialize( - DataSource* data_source, const PipelineStatusCB& callback); + DataSource* data_source, const PipelineStatusCB& status_cb); // Demuxer implementation. virtual void Stop(const base::Closure& callback) OVERRIDE; @@ -173,7 +173,7 @@ class MEDIA_EXPORT FFmpegDemuxer : public Demuxer, public FFmpegURLProtocol { // Carries out initialization on the demuxer thread. void InitializeTask( - DataSource* data_source, const PipelineStatusCB& callback); + DataSource* data_source, const PipelineStatusCB& status_cb); // Carries out a seek on the demuxer thread. void SeekTask(base::TimeDelta time, const PipelineStatusCB& cb); diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc index 845fed5..286924d 100644 --- a/media/filters/ffmpeg_video_decoder.cc +++ b/media/filters/ffmpeg_video_decoder.cc @@ -67,7 +67,7 @@ FFmpegVideoDecoder::~FFmpegVideoDecoder() { } void FFmpegVideoDecoder::Initialize(DemuxerStream* demuxer_stream, - const PipelineStatusCB& pipeline_status_cb, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb) { if (!message_loop_) { message_loop_ = message_loop_factory_cb_.Run(); @@ -75,7 +75,7 @@ void FFmpegVideoDecoder::Initialize(DemuxerStream* demuxer_stream, message_loop_->PostTask(FROM_HERE, base::Bind( &FFmpegVideoDecoder::Initialize, this, - make_scoped_refptr(demuxer_stream), pipeline_status_cb, statistics_cb)); + make_scoped_refptr(demuxer_stream), status_cb, statistics_cb)); return; } @@ -83,7 +83,7 @@ void FFmpegVideoDecoder::Initialize(DemuxerStream* demuxer_stream, DCHECK(!demuxer_stream_); if (!demuxer_stream) { - pipeline_status_cb.Run(PIPELINE_ERROR_DECODE); + status_cb.Run(PIPELINE_ERROR_DECODE); return; } @@ -96,7 +96,7 @@ void FFmpegVideoDecoder::Initialize(DemuxerStream* demuxer_stream, // decoder objects. if (!config.IsValidConfig()) { DLOG(ERROR) << "Invalid video stream - " << config.AsHumanReadableString(); - pipeline_status_cb.Run(PIPELINE_ERROR_DECODE); + status_cb.Run(PIPELINE_ERROR_DECODE); return; } @@ -112,12 +112,12 @@ void FFmpegVideoDecoder::Initialize(DemuxerStream* demuxer_stream, AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id); if (!codec) { - pipeline_status_cb.Run(PIPELINE_ERROR_DECODE); + status_cb.Run(PIPELINE_ERROR_DECODE); return; } if (avcodec_open2(codec_context_, codec, NULL) < 0) { - pipeline_status_cb.Run(PIPELINE_ERROR_DECODE); + status_cb.Run(PIPELINE_ERROR_DECODE); return; } @@ -127,7 +127,7 @@ void FFmpegVideoDecoder::Initialize(DemuxerStream* demuxer_stream, natural_size_ = config.natural_size(); frame_rate_numerator_ = config.frame_rate_numerator(); frame_rate_denominator_ = config.frame_rate_denominator(); - pipeline_status_cb.Run(PIPELINE_OK); + status_cb.Run(PIPELINE_OK); } void FFmpegVideoDecoder::Stop(const base::Closure& callback) { diff --git a/media/filters/ffmpeg_video_decoder.h b/media/filters/ffmpeg_video_decoder.h index d00fe828..6d6392c 100644 --- a/media/filters/ffmpeg_video_decoder.h +++ b/media/filters/ffmpeg_video_decoder.h @@ -33,7 +33,7 @@ class MEDIA_EXPORT FFmpegVideoDecoder : public VideoDecoder { // VideoDecoder implementation. virtual void Initialize(DemuxerStream* demuxer_stream, - const PipelineStatusCB& pipeline_status_cb, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb) OVERRIDE; virtual void Read(const ReadCB& read_cb) OVERRIDE; virtual const gfx::Size& natural_size() OVERRIDE; diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc index ef9f4f3..0a45019 100644 --- a/media/filters/gpu_video_decoder.cc +++ b/media/filters/gpu_video_decoder.cc @@ -142,18 +142,18 @@ void GpuVideoDecoder::Flush(const base::Closure& callback) { } void GpuVideoDecoder::Initialize(DemuxerStream* demuxer_stream, - const PipelineStatusCB& pipeline_status_cb, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb) { if (!gvd_loop_proxy_->BelongsToCurrentThread()) { gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind( &GpuVideoDecoder::Initialize, this, - make_scoped_refptr(demuxer_stream), pipeline_status_cb, statistics_cb)); + make_scoped_refptr(demuxer_stream), status_cb, statistics_cb)); return; } DCHECK(!demuxer_stream_); if (!demuxer_stream) { - pipeline_status_cb.Run(PIPELINE_ERROR_DECODE); + status_cb.Run(PIPELINE_ERROR_DECODE); return; } @@ -162,13 +162,13 @@ void GpuVideoDecoder::Initialize(DemuxerStream* demuxer_stream, // decoder objects. if (!config.IsValidConfig()) { DLOG(ERROR) << "Invalid video stream - " << config.AsHumanReadableString(); - pipeline_status_cb.Run(PIPELINE_ERROR_DECODE); + status_cb.Run(PIPELINE_ERROR_DECODE); return; } vda_ = factories_->CreateVideoDecodeAccelerator(config.profile(), this); if (!vda_) { - pipeline_status_cb.Run(DECODER_ERROR_NOT_SUPPORTED); + status_cb.Run(DECODER_ERROR_NOT_SUPPORTED); return; } @@ -181,7 +181,7 @@ void GpuVideoDecoder::Initialize(DemuxerStream* demuxer_stream, config_frame_duration_ = GetFrameDuration(config); DVLOG(1) << "GpuVideoDecoder::Initialize() succeeded."; - pipeline_status_cb.Run(PIPELINE_OK); + status_cb.Run(PIPELINE_OK); } void GpuVideoDecoder::Read(const ReadCB& read_cb) { diff --git a/media/filters/gpu_video_decoder.h b/media/filters/gpu_video_decoder.h index e2bb07f..abbf6e9 100644 --- a/media/filters/gpu_video_decoder.h +++ b/media/filters/gpu_video_decoder.h @@ -66,7 +66,7 @@ class MEDIA_EXPORT GpuVideoDecoder // VideoDecoder implementation. virtual void Initialize(DemuxerStream* demuxer_stream, - const PipelineStatusCB& pipeline_status_cb, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb) OVERRIDE; virtual void Read(const ReadCB& read_cb) OVERRIDE; virtual const gfx::Size& natural_size() OVERRIDE; diff --git a/media/filters/video_frame_generator.cc b/media/filters/video_frame_generator.cc index cce69de..93dbd80 100644 --- a/media/filters/video_frame_generator.cc +++ b/media/filters/video_frame_generator.cc @@ -24,13 +24,13 @@ VideoFrameGenerator::~VideoFrameGenerator() {} void VideoFrameGenerator::Initialize( DemuxerStream* demuxer_stream, - const PipelineStatusCB& pipeline_status_cb, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb) { message_loop_proxy_->PostTask( FROM_HERE, base::Bind(&VideoFrameGenerator::InitializeOnDecoderThread, this, make_scoped_refptr(demuxer_stream), - pipeline_status_cb, statistics_cb)); + status_cb, statistics_cb)); } void VideoFrameGenerator::Read(const ReadCB& read_cb) { @@ -51,12 +51,12 @@ void VideoFrameGenerator::Stop(const base::Closure& callback) { void VideoFrameGenerator::InitializeOnDecoderThread( DemuxerStream* demuxer_stream, - const PipelineStatusCB& pipeline_status_cb, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb) { DVLOG(1) << "InitializeOnDecoderThread"; DCHECK(message_loop_proxy_->BelongsToCurrentThread()); - pipeline_status_cb.Run(PIPELINE_OK); + status_cb.Run(PIPELINE_OK); stopped_ = false; } diff --git a/media/filters/video_frame_generator.h b/media/filters/video_frame_generator.h index 235d61f..320a282 100644 --- a/media/filters/video_frame_generator.h +++ b/media/filters/video_frame_generator.h @@ -34,7 +34,7 @@ class MEDIA_EXPORT VideoFrameGenerator // Decoder implementation. virtual void Initialize( DemuxerStream* demuxer_stream, - const PipelineStatusCB& pipeline_status_cb, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb) OVERRIDE; virtual void Read(const ReadCB& read_cb) OVERRIDE; virtual const gfx::Size& natural_size() OVERRIDE; @@ -44,7 +44,7 @@ class MEDIA_EXPORT VideoFrameGenerator void InitializeOnDecoderThread( DemuxerStream* demuxer_stream, - const PipelineStatusCB& pipeline_status_cb, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb); void ReadOnDecoderThread(const ReadCB& read_cb); diff --git a/media/filters/video_renderer_base.cc b/media/filters/video_renderer_base.cc index ffd942b..b4c2568 100644 --- a/media/filters/video_renderer_base.cc +++ b/media/filters/video_renderer_base.cc @@ -52,7 +52,7 @@ void VideoRendererBase::Pause(const base::Closure& callback) { void VideoRendererBase::Flush(const base::Closure& callback) { base::AutoLock auto_lock(lock_); DCHECK_EQ(state_, kPaused); - flush_callback_ = callback; + flush_cb_ = callback; state_ = kFlushing; AttemptFlush_Locked(); @@ -65,7 +65,7 @@ void VideoRendererBase::Stop(const base::Closure& callback) { state_ = kStopped; statistics_cb_.Reset(); - video_time_cb_.Reset(); + time_cb_.Reset(); if (!pending_paint_ && !pending_paint_with_last_available_) DoStopOrError_Locked(); @@ -102,19 +102,19 @@ void VideoRendererBase::Seek(base::TimeDelta time, const FilterStatusCB& cb) { } void VideoRendererBase::Initialize(VideoDecoder* decoder, - const PipelineStatusCB& pipeline_status_cb, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb, - const VideoTimeCB& video_time_cb) { + const TimeCB& time_cb) { base::AutoLock auto_lock(lock_); DCHECK(decoder); - DCHECK(!pipeline_status_cb.is_null()); + DCHECK(!status_cb.is_null()); DCHECK(!statistics_cb.is_null()); - DCHECK(!video_time_cb.is_null()); + DCHECK(!time_cb.is_null()); DCHECK_EQ(kUninitialized, state_); decoder_ = decoder; statistics_cb_ = statistics_cb; - video_time_cb_ = video_time_cb; + time_cb_ = time_cb; // Notify the pipeline of the video dimensions. host()->SetNaturalVideoSize(decoder_->natural_size()); @@ -132,7 +132,7 @@ void VideoRendererBase::Initialize(VideoDecoder* decoder, if (!base::PlatformThread::Create(0, this, &thread_)) { NOTREACHED() << "Video thread creation failed"; state_ = kError; - pipeline_status_cb.Run(PIPELINE_ERROR_INITIALIZATION_FAILED); + status_cb.Run(PIPELINE_ERROR_INITIALIZATION_FAILED); return; } @@ -141,7 +141,7 @@ void VideoRendererBase::Initialize(VideoDecoder* decoder, // TODO(scherkus): find out if this is necessary, but it seems to help. ::SetThreadPriority(thread_, THREAD_PRIORITY_ABOVE_NORMAL); #endif // defined(OS_WIN) - pipeline_status_cb.Run(PIPELINE_OK); + status_cb.Run(PIPELINE_OK); } bool VideoRendererBase::HasEnded() { @@ -389,7 +389,7 @@ void VideoRendererBase::FrameReady(scoped_refptr<VideoFrame> frame) { ready_frames_.push_back(frame); DCHECK_LE(NumFrames_Locked(), limits::kMaxVideoFrames); if (!frame->IsEndOfStream()) - video_time_cb_.Run(frame->GetTimestamp() + frame->GetDuration()); + time_cb_.Run(frame->GetTimestamp() + frame->GetDuration()); frame_available_.Signal(); PipelineStatistics statistics; @@ -452,7 +452,7 @@ void VideoRendererBase::AttemptFlush_Locked() { if (!pending_paint_ && !pending_read_) { state_ = kFlushed; current_frame_ = NULL; - ResetAndRunCB(&flush_callback_); + ResetAndRunCB(&flush_cb_); } } diff --git a/media/filters/video_renderer_base.h b/media/filters/video_renderer_base.h index 867e178..fe69571 100644 --- a/media/filters/video_renderer_base.h +++ b/media/filters/video_renderer_base.h @@ -53,9 +53,9 @@ class MEDIA_EXPORT VideoRendererBase // VideoRenderer implementation. virtual void Initialize(VideoDecoder* decoder, - const PipelineStatusCB& pipeline_status_cb, + const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb, - const VideoTimeCB& video_time_cb) OVERRIDE; + const TimeCB& time_cb) OVERRIDE; virtual bool HasEnded() OVERRIDE; // PlatformThread::Delegate implementation. @@ -182,10 +182,10 @@ class MEDIA_EXPORT VideoRendererBase float playback_rate_; // Filter callbacks. - base::Closure flush_callback_; + base::Closure flush_cb_; FilterStatusCB seek_cb_; StatisticsCB statistics_cb_; - VideoTimeCB video_time_cb_; + TimeCB time_cb_; base::TimeDelta seek_timestamp_; diff --git a/media/filters/video_renderer_base_unittest.cc b/media/filters/video_renderer_base_unittest.cc index eb83864..30c804b 100644 --- a/media/filters/video_renderer_base_unittest.cc +++ b/media/filters/video_renderer_base_unittest.cc @@ -63,7 +63,7 @@ class VideoRendererBaseTest : public ::testing::Test { .Times(AnyNumber()); EXPECT_CALL(*this, SetOpaqueCBWasCalled(_)) .WillRepeatedly(::testing::Return()); - EXPECT_CALL(*this, VideoTimeCBWasCalled(_)) + EXPECT_CALL(*this, TimeCBWasCalled(_)) .WillRepeatedly(::testing::Return()); } @@ -75,7 +75,7 @@ class VideoRendererBaseTest : public ::testing::Test { } } - MOCK_METHOD1(VideoTimeCBWasCalled, void(base::TimeDelta)); + MOCK_METHOD1(TimeCBWasCalled, void(base::TimeDelta)); MOCK_CONST_METHOD1(SetOpaqueCBWasCalled, void(bool)); @@ -106,7 +106,7 @@ class VideoRendererBaseTest : public ::testing::Test { renderer_->Initialize(decoder_, NewExpectedStatusCB(PIPELINE_OK), NewStatisticsCB(), - NewVideoTimeCB()); + NewTimeCB()); // Now seek to trigger prerolling. Seek(0); @@ -269,8 +269,8 @@ class VideoRendererBaseTest : public ::testing::Test { base::Unretained(&statistics_cb_object_)); } - VideoRenderer::VideoTimeCB NewVideoTimeCB() { - return base::Bind(&VideoRendererBaseTest::VideoTimeCBWasCalled, + VideoRenderer::TimeCB NewTimeCB() { + return base::Bind(&VideoRendererBaseTest::TimeCBWasCalled, base::Unretained(this)); } diff --git a/webkit/media/simple_data_source.cc b/webkit/media/simple_data_source.cc index dfdba68..3761148 100644 --- a/webkit/media/simple_data_source.cc +++ b/webkit/media/simple_data_source.cc @@ -63,9 +63,9 @@ void SimpleDataSource::Stop(const base::Closure& callback) { void SimpleDataSource::Initialize( const GURL& url, - const media::PipelineStatusCB& callback) { + const media::PipelineStatusCB& status_cb) { DCHECK(MessageLoop::current() == render_loop_); - DCHECK(!callback.is_null()); + DCHECK(!status_cb.is_null()); // Reference to prevent destruction while inside the |initialize_cb_| // call. This is a temporary fix to prevent crashes caused by holding the @@ -75,7 +75,7 @@ void SimpleDataSource::Initialize( base::AutoLock auto_lock(lock_); DCHECK_EQ(state_, UNINITIALIZED); state_ = INITIALIZING; - initialize_cb_ = callback; + initialize_cb_ = status_cb; // Validate the URL. url_ = url; diff --git a/webkit/media/simple_data_source.h b/webkit/media/simple_data_source.h index 8662181..b8ca0d4 100644 --- a/webkit/media/simple_data_source.h +++ b/webkit/media/simple_data_source.h @@ -86,7 +86,7 @@ class SimpleDataSource // webkit_glue::WebDataSource implementation. virtual void Initialize(const GURL& url, - const media::PipelineStatusCB& callback) OVERRIDE; + const media::PipelineStatusCB& status_cb) OVERRIDE; virtual bool HasSingleOrigin() OVERRIDE; virtual void Abort() OVERRIDE; diff --git a/webkit/media/simple_data_source_unittest.cc b/webkit/media/simple_data_source_unittest.cc index e49c489..5d00f13 100644 --- a/webkit/media/simple_data_source_unittest.cc +++ b/webkit/media/simple_data_source_unittest.cc @@ -68,7 +68,7 @@ class SimpleDataSourceTest : public testing::Test { } void InitializeDataSource(const char* url, - const media::PipelineStatusCB& callback) { + const media::PipelineStatusCB& status_cb) { gurl_ = GURL(url); url_loader_ = new NiceMock<MockWebURLLoader>(); @@ -80,7 +80,7 @@ class SimpleDataSourceTest : public testing::Test { data_source_->set_host(&host_); data_source_->SetURLLoaderForTest(url_loader_); - data_source_->Initialize(gurl_, callback); + data_source_->Initialize(gurl_, status_cb); MessageLoop::current()->RunAllPending(); } diff --git a/webkit/media/web_data_source.h b/webkit/media/web_data_source.h index e2f9b1f..1ed4257 100644 --- a/webkit/media/web_data_source.h +++ b/webkit/media/web_data_source.h @@ -25,7 +25,7 @@ class WebDataSource : public media::DataSource { // // Method called on the render thread. virtual void Initialize(const GURL& url, - const media::PipelineStatusCB& callback) = 0; + const media::PipelineStatusCB& status_cb) = 0; // Returns true if the media resource has a single origin, false otherwise. // |