summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-17 22:09:28 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-17 22:09:28 +0000
commit128740bbcd5abb0c75254e6eb57b46192c1f47d1 (patch)
tree635b88468f502fdf65828766735de711e86170e2 /media
parent6973e1cbd7434f30ed00c49a23838a82f90e8a0f (diff)
downloadchromium_src-128740bbcd5abb0c75254e6eb57b46192c1f47d1.zip
chromium_src-128740bbcd5abb0c75254e6eb57b46192c1f47d1.tar.gz
chromium_src-128740bbcd5abb0c75254e6eb57b46192c1f47d1.tar.bz2
Renamed FilterHost::Error() and Pipeline::GetTime() to more appropriate names.
BUG=17107 TEST=none Review URL: http://codereview.chromium.org/155711 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21013 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/base/filter_host.h2
-rw-r--r--media/base/filter_host_impl.cc6
-rw-r--r--media/base/filter_host_impl.h2
-rw-r--r--media/base/mock_filter_host.h2
-rw-r--r--media/base/mock_filters.h6
-rw-r--r--media/base/pipeline.h5
-rw-r--r--media/base/pipeline_impl.cc10
-rw-r--r--media/base/pipeline_impl.h11
-rw-r--r--media/base/pipeline_impl_unittest.cc10
-rw-r--r--media/filters/audio_renderer_base.cc4
-rw-r--r--media/filters/audio_renderer_base_unittest.cc2
-rw-r--r--media/filters/decoder_base.h2
-rw-r--r--media/filters/ffmpeg_audio_decoder.cc4
-rw-r--r--media/filters/ffmpeg_demuxer.cc6
-rw-r--r--media/filters/ffmpeg_demuxer_unittest.cc8
-rw-r--r--media/filters/ffmpeg_video_decoder.cc2
-rw-r--r--media/filters/ffmpeg_video_decoder_unittest.cc8
-rw-r--r--media/filters/file_data_source.cc2
-rw-r--r--media/filters/video_renderer_base.cc8
-rw-r--r--media/filters/video_renderer_base_unittest.cc6
-rw-r--r--media/player/movie.cc2
21 files changed, 55 insertions, 53 deletions
diff --git a/media/base/filter_host.h b/media/base/filter_host.h
index 982b3e5..5e70797 100644
--- a/media/base/filter_host.h
+++ b/media/base/filter_host.h
@@ -26,7 +26,7 @@ class FilterHost {
public:
// Stops execution of the pipeline due to a fatal error. Do not call this
// method with PIPELINE_OK or PIPELINE_STOPPING (used internally by pipeline).
- virtual void Error(PipelineError error) = 0;
+ virtual void SetError(PipelineError error) = 0;
// Gets the current time in microseconds.
virtual base::TimeDelta GetTime() const = 0;
diff --git a/media/base/filter_host_impl.cc b/media/base/filter_host_impl.cc
index 4192afd..93e3ca7 100644
--- a/media/base/filter_host_impl.cc
+++ b/media/base/filter_host_impl.cc
@@ -6,12 +6,12 @@
namespace media {
-void FilterHostImpl::Error(PipelineError error) {
- pipeline_internal_->Error(error);
+void FilterHostImpl::SetError(PipelineError error) {
+ pipeline_internal_->SetError(error);
}
base::TimeDelta FilterHostImpl::GetTime() const {
- return pipeline()->GetTime();
+ return pipeline()->GetCurrentTime();
}
void FilterHostImpl::SetTime(base::TimeDelta time) {
diff --git a/media/base/filter_host_impl.h b/media/base/filter_host_impl.h
index cb33a48..a619654 100644
--- a/media/base/filter_host_impl.h
+++ b/media/base/filter_host_impl.h
@@ -16,7 +16,7 @@ namespace media {
class FilterHostImpl : public FilterHost {
public:
// FilterHost interface.
- virtual void Error(PipelineError error);
+ virtual void SetError(PipelineError error);
virtual base::TimeDelta GetTime() const;
virtual void SetTime(base::TimeDelta time);
virtual void SetDuration(base::TimeDelta duration);
diff --git a/media/base/mock_filter_host.h b/media/base/mock_filter_host.h
index c926437..8bab1b5 100644
--- a/media/base/mock_filter_host.h
+++ b/media/base/mock_filter_host.h
@@ -28,7 +28,7 @@ class MockFilterHost : public FilterHost {
// FilterHost implementation.
MOCK_METHOD0(InitializationComplete, void());
- MOCK_METHOD1(Error, void(PipelineError error));
+ MOCK_METHOD1(SetError, void(PipelineError error));
MOCK_CONST_METHOD0(GetTime, base::TimeDelta());
MOCK_METHOD1(SetTime, void(base::TimeDelta time));
MOCK_METHOD1(SetDuration, void(base::TimeDelta duration));
diff --git a/media/base/mock_filters.h b/media/base/mock_filters.h
index 6d8c8a9..8c44996 100644
--- a/media/base/mock_filters.h
+++ b/media/base/mock_filters.h
@@ -332,9 +332,9 @@ void RunFilterCallback(::testing::Unused, FilterCallback* callback);
// methods.
void DestroyFilterCallback(::testing::Unused, FilterCallback* callback);
-// Helper gmock action that calls Error() on behalf of the provided filter.
-ACTION_P2(Error, filter, error) {
- filter->host()->Error(error);
+// Helper gmock action that calls SetError() on behalf of the provided filter.
+ACTION_P2(SetError, filter, error) {
+ filter->host()->SetError(error);
}
} // namespace media
diff --git a/media/base/pipeline.h b/media/base/pipeline.h
index d6f6241..83e30ef 100644
--- a/media/base/pipeline.h
+++ b/media/base/pipeline.h
@@ -81,7 +81,8 @@ class Pipeline {
// Attempt to seek to the position specified by time. |seek_callback| will be
// executed when the all filters in the pipeline have processed the seek.
//
- // Clients are expected to call GetTime() to check whether the seek succeeded.
+ // Clients are expected to call GetCurrentTime() to check whether the seek
+ // succeeded.
virtual void Seek(base::TimeDelta time, PipelineCallback* seek_callback) = 0;
// Returns true if the pipeline has been started via Start(). If IsRunning()
@@ -125,7 +126,7 @@ class Pipeline {
// Gets the current pipeline time. For a pipeline "time" progresses from 0 to
// the end of the media.
- virtual base::TimeDelta GetTime() const = 0;
+ virtual base::TimeDelta GetCurrentTime() const = 0;
// Get the approximate amount of playable data buffered so far in micro-
// seconds.
diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc
index 7ef051d..1da8366 100644
--- a/media/base/pipeline_impl.cc
+++ b/media/base/pipeline_impl.cc
@@ -170,7 +170,7 @@ void PipelineImpl::SetVolume(float volume) {
}
}
-base::TimeDelta PipelineImpl::GetTime() const {
+base::TimeDelta PipelineImpl::GetCurrentTime() const {
AutoLock auto_lock(lock_);
return time_;
}
@@ -336,7 +336,7 @@ void PipelineInternal::SetTime(base::TimeDelta time) {
// Called from any thread. Sets the pipeline |error_| member and destroys all
// filters.
-void PipelineInternal::Error(PipelineError error) {
+void PipelineInternal::SetError(PipelineError error) {
message_loop_->PostTask(FROM_HERE,
NewRunnableMethod(this, &PipelineInternal::ErrorTask, error));
}
@@ -444,7 +444,7 @@ void PipelineInternal::InitializeTask() {
if (state_ == kInitVideoRenderer) {
if (!IsPipelineOk() || pipeline_->rendered_mime_types_.empty()) {
- Error(PIPELINE_ERROR_COULD_NOT_RENDER);
+ SetError(PIPELINE_ERROR_COULD_NOT_RENDER);
return;
}
@@ -583,7 +583,7 @@ void PipelineInternal::CreateFilter(FilterFactory* filter_factory,
// Create the filter.
scoped_refptr<Filter> filter = filter_factory->Create<Filter>(media_format);
if (!filter) {
- Error(PIPELINE_ERROR_REQUIRED_FILTER_MISSING);
+ SetError(PIPELINE_ERROR_REQUIRED_FILTER_MISSING);
return;
}
@@ -592,7 +592,7 @@ void PipelineInternal::CreateFilter(FilterFactory* filter_factory,
scoped_ptr<base::Thread> thread(new base::Thread(GetThreadName<Filter>()));
if (!thread.get() || !thread->Start()) {
NOTREACHED() << "Could not start filter thread";
- Error(PIPELINE_ERROR_INITIALIZATION_FAILED);
+ SetError(PIPELINE_ERROR_INITIALIZATION_FAILED);
return;
}
diff --git a/media/base/pipeline_impl.h b/media/base/pipeline_impl.h
index e9f44d5..6b97c94 100644
--- a/media/base/pipeline_impl.h
+++ b/media/base/pipeline_impl.h
@@ -45,7 +45,7 @@ class PipelineImpl : public Pipeline {
virtual void SetPlaybackRate(float playback_rate);
virtual float GetVolume() const;
virtual void SetVolume(float volume);
- virtual base::TimeDelta GetTime() const;
+ virtual base::TimeDelta GetCurrentTime() const;
virtual base::TimeDelta GetBufferedTime() const;
virtual base::TimeDelta GetDuration() const;
virtual int64 GetBufferedBytes() const;
@@ -195,9 +195,10 @@ class PipelineInternal : public base::RefCountedThreadSafe<PipelineInternal> {
// that have registered a time update callback.
void SetTime(base::TimeDelta time);
- // Called by a FilterHostImpl on behalf of a filter calling FilterHost::Error.
- // If the pipeline is running a nested message loop, it will be exited.
- void Error(PipelineError error);
+ // Called by a FilterHostImpl on behalf of a filter calling
+ // FilterHost::SetError(). If the pipeline is running a nested message loop,
+ // it will be exited.
+ void SetError(PipelineError error);
// Simple accessor used by the FilterHostImpl class to get access to the
// pipeline object.
@@ -263,7 +264,7 @@ class PipelineInternal : public base::RefCountedThreadSafe<PipelineInternal> {
// - StopTask() resets the pipeline to a fresh state, where as ErrorTask()
// leaves the pipeline as is for client inspection.
// - StopTask() can be scheduled by the client calling Stop(), where as
- // ErrorTask() is scheduled as a result of a filter calling Error().
+ // ErrorTask() is scheduled as a result of a filter calling SetError().
void StopTask(PipelineCallback* stop_callback);
void ErrorTask(PipelineError error);
diff --git a/media/base/pipeline_impl_unittest.cc b/media/base/pipeline_impl_unittest.cc
index d6bd285..c3e63e5 100644
--- a/media/base/pipeline_impl_unittest.cc
+++ b/media/base/pipeline_impl_unittest.cc
@@ -179,10 +179,10 @@ TEST_F(PipelineImplTest, NotStarted) {
EXPECT_EQ(1.0f, pipeline_.GetVolume());
pipeline_.SetVolume(-1.0f);
EXPECT_EQ(1.0f, pipeline_.GetVolume());
- pipeline_.SetVolume(1.0f);
- EXPECT_EQ(1.0f, pipeline_.GetVolume());
+ pipeline_.SetVolume(0.0f);
+ EXPECT_EQ(0.0f, pipeline_.GetVolume());
- EXPECT_TRUE(kZero == pipeline_.GetTime());
+ EXPECT_TRUE(kZero == pipeline_.GetCurrentTime());
EXPECT_TRUE(kZero == pipeline_.GetBufferedTime());
EXPECT_TRUE(kZero == pipeline_.GetDuration());
@@ -233,8 +233,8 @@ TEST_F(PipelineImplTest, RequiredFilterMissing) {
TEST_F(PipelineImplTest, URLNotFound) {
EXPECT_CALL(*mocks_->data_source(), Initialize("", NotNull()))
- .WillOnce(DoAll(Error(mocks_->data_source(),
- PIPELINE_ERROR_URL_NOT_FOUND),
+ .WillOnce(DoAll(SetError(mocks_->data_source(),
+ PIPELINE_ERROR_URL_NOT_FOUND),
Invoke(&RunFilterCallback)));
EXPECT_CALL(*mocks_->data_source(), Stop());
diff --git a/media/filters/audio_renderer_base.cc b/media/filters/audio_renderer_base.cc
index d0bad99..675fdd6 100644
--- a/media/filters/audio_renderer_base.cc
+++ b/media/filters/audio_renderer_base.cc
@@ -67,7 +67,7 @@ void AudioRendererBase::Initialize(AudioDecoder* decoder,
// Defer initialization until all scheduled reads have completed.
if (!OnInitialize(decoder_->media_format())) {
- host()->Error(PIPELINE_ERROR_INITIALIZATION_FAILED);
+ host()->SetError(PIPELINE_ERROR_INITIALIZATION_FAILED);
initialize_callback_->Run();
initialize_callback_.reset();
}
@@ -96,7 +96,7 @@ void AudioRendererBase::OnReadComplete(Buffer* buffer_in) {
if (queue_.empty()) {
// If we say we have initialized but buffer queue is empty, raise an
// error.
- host()->Error(PIPELINE_ERROR_NO_DATA);
+ host()->SetError(PIPELINE_ERROR_NO_DATA);
} else {
initialized_ = true;
}
diff --git a/media/filters/audio_renderer_base_unittest.cc b/media/filters/audio_renderer_base_unittest.cc
index ed0d138..3fb6a4f 100644
--- a/media/filters/audio_renderer_base_unittest.cc
+++ b/media/filters/audio_renderer_base_unittest.cc
@@ -89,7 +89,7 @@ TEST_F(AudioRendererBaseTest, Initialize_Failed) {
.WillOnce(Return(false));
// We expect to receive an error.
- EXPECT_CALL(host_, Error(PIPELINE_ERROR_INITIALIZATION_FAILED));
+ EXPECT_CALL(host_, SetError(PIPELINE_ERROR_INITIALIZATION_FAILED));
// We expect our callback to be executed.
EXPECT_CALL(callback_, OnFilterCallback());
diff --git a/media/filters/decoder_base.h b/media/filters/decoder_base.h
index 3e1ba52c..6d6aa67 100644
--- a/media/filters/decoder_base.h
+++ b/media/filters/decoder_base.h
@@ -157,7 +157,7 @@ class DecoderBase : public Decoder {
// Delegate to subclass first.
if (!OnInitialize(demuxer_stream_)) {
- this->host()->Error(PIPELINE_ERROR_DECODE);
+ this->host()->SetError(PIPELINE_ERROR_DECODE);
callback->Run();
return;
}
diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc
index 422709a..8ee6fa8 100644
--- a/media/filters/ffmpeg_audio_decoder.cc
+++ b/media/filters/ffmpeg_audio_decoder.cc
@@ -67,7 +67,7 @@ bool FFmpegAudioDecoder::OnInitialize(DemuxerStream* demuxer_stream) {
// Prepare the output buffer.
output_buffer_.reset(static_cast<uint8*>(av_malloc(kOutputBufferSize)));
if (!output_buffer_.get()) {
- host()->Error(PIPELINE_ERROR_OUT_OF_MEMORY);
+ host()->SetError(PIPELINE_ERROR_OUT_OF_MEMORY);
return false;
}
return true;
@@ -101,7 +101,7 @@ void FFmpegAudioDecoder::OnDecode(Buffer* input) {
if (result < 0 ||
output_buffer_size < 0 ||
static_cast<size_t>(output_buffer_size) > kOutputBufferSize) {
- host()->Error(PIPELINE_ERROR_DECODE);
+ host()->SetError(PIPELINE_ERROR_DECODE);
return;
}
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index 8526b4e..bf595e2 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -313,7 +313,7 @@ void FFmpegDemuxer::InititalizeTask(DataSource* data_source,
FFmpegGlue::get()->RemoveDataSource(data_source);
if (result < 0) {
- host()->Error(DEMUXER_ERROR_COULD_NOT_OPEN);
+ host()->SetError(DEMUXER_ERROR_COULD_NOT_OPEN);
callback->Run();
return;
}
@@ -328,7 +328,7 @@ void FFmpegDemuxer::InititalizeTask(DataSource* data_source,
// Fully initialize AVFormatContext by parsing the stream a little.
result = av_find_stream_info(format_context_);
if (result < 0) {
- host()->Error(DEMUXER_ERROR_COULD_NOT_PARSE);
+ host()->SetError(DEMUXER_ERROR_COULD_NOT_PARSE);
callback->Run();
return;
}
@@ -351,7 +351,7 @@ void FFmpegDemuxer::InititalizeTask(DataSource* data_source,
}
}
if (streams_.empty()) {
- host()->Error(DEMUXER_ERROR_NO_SUPPORTED_STREAMS);
+ host()->SetError(DEMUXER_ERROR_NO_SUPPORTED_STREAMS);
callback->Run();
return;
}
diff --git a/media/filters/ffmpeg_demuxer_unittest.cc b/media/filters/ffmpeg_demuxer_unittest.cc
index 18cec27..6f05004 100644
--- a/media/filters/ffmpeg_demuxer_unittest.cc
+++ b/media/filters/ffmpeg_demuxer_unittest.cc
@@ -197,7 +197,7 @@ TEST_F(FFmpegDemuxerTest, Initialize_OpenFails) {
// Simulate av_open_input_file() failing.
EXPECT_CALL(*MockFFmpeg::get(), AVOpenInputFile(_, _, NULL, 0, NULL))
.WillOnce(Return(-1));
- EXPECT_CALL(host_, Error(DEMUXER_ERROR_COULD_NOT_OPEN));
+ EXPECT_CALL(host_, SetError(DEMUXER_ERROR_COULD_NOT_OPEN));
EXPECT_CALL(callback_, OnFilterCallback());
EXPECT_CALL(callback_, OnCallbackDestroyed());
@@ -212,7 +212,7 @@ TEST_F(FFmpegDemuxerTest, Initialize_ParseFails) {
EXPECT_CALL(*MockFFmpeg::get(), AVFindStreamInfo(&format_context_))
.WillOnce(Return(AVERROR_IO));
EXPECT_CALL(*MockFFmpeg::get(), AVCloseInputFile(&format_context_));
- EXPECT_CALL(host_, Error(DEMUXER_ERROR_COULD_NOT_PARSE));
+ EXPECT_CALL(host_, SetError(DEMUXER_ERROR_COULD_NOT_PARSE));
EXPECT_CALL(callback_, OnFilterCallback());
EXPECT_CALL(callback_, OnCallbackDestroyed());
@@ -226,7 +226,7 @@ TEST_F(FFmpegDemuxerTest, Initialize_NoStreams) {
SCOPED_TRACE("");
InitializeDemuxerMocks();
}
- EXPECT_CALL(host_, Error(DEMUXER_ERROR_NO_SUPPORTED_STREAMS));
+ EXPECT_CALL(host_, SetError(DEMUXER_ERROR_NO_SUPPORTED_STREAMS));
EXPECT_CALL(callback_, OnFilterCallback());
EXPECT_CALL(callback_, OnCallbackDestroyed());
format_context_.nb_streams = 0;
@@ -241,7 +241,7 @@ TEST_F(FFmpegDemuxerTest, Initialize_DataStreamOnly) {
SCOPED_TRACE("");
InitializeDemuxerMocks();
}
- EXPECT_CALL(host_, Error(DEMUXER_ERROR_NO_SUPPORTED_STREAMS));
+ EXPECT_CALL(host_, SetError(DEMUXER_ERROR_NO_SUPPORTED_STREAMS));
EXPECT_CALL(callback_, OnFilterCallback());
EXPECT_CALL(callback_, OnCallbackDestroyed());
EXPECT_EQ(format_context_.streams[0], &streams_[AV_STREAM_DATA]);
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc
index c396c00..ab91ec9 100644
--- a/media/filters/ffmpeg_video_decoder.cc
+++ b/media/filters/ffmpeg_video_decoder.cc
@@ -337,7 +337,7 @@ VideoSurface::Format FFmpegVideoDecoder::GetSurfaceFormat(
}
void FFmpegVideoDecoder::SignalPipelineError() {
- host()->Error(PIPELINE_ERROR_DECODE);
+ host()->SetError(PIPELINE_ERROR_DECODE);
state_ = kDecodeFinished;
}
diff --git a/media/filters/ffmpeg_video_decoder_unittest.cc b/media/filters/ffmpeg_video_decoder_unittest.cc
index cfba730..9102b6c 100644
--- a/media/filters/ffmpeg_video_decoder_unittest.cc
+++ b/media/filters/ffmpeg_video_decoder_unittest.cc
@@ -161,7 +161,7 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_QueryInterfaceFails) {
// Test QueryInterface returning NULL.
EXPECT_CALL(*demuxer_, QueryInterface(AVStreamProvider::interface_id()))
.WillOnce(ReturnNull());
- EXPECT_CALL(host_, Error(PIPELINE_ERROR_DECODE));
+ EXPECT_CALL(host_, SetError(PIPELINE_ERROR_DECODE));
EXPECT_CALL(callback_, OnFilterCallback());
EXPECT_CALL(callback_, OnCallbackDestroyed());
@@ -178,7 +178,7 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_FindDecoderFails) {
.WillOnce(Return(&stream_));
EXPECT_CALL(*MockFFmpeg::get(), AVCodecFindDecoder(CODEC_ID_NONE))
.WillOnce(ReturnNull());
- EXPECT_CALL(host_, Error(PIPELINE_ERROR_DECODE));
+ EXPECT_CALL(host_, SetError(PIPELINE_ERROR_DECODE));
EXPECT_CALL(callback_, OnFilterCallback());
EXPECT_CALL(callback_, OnCallbackDestroyed());
@@ -197,7 +197,7 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_InitThreadFails) {
.WillOnce(Return(&codec_));
EXPECT_CALL(*MockFFmpeg::get(), AVCodecThreadInit(&codec_context_, 2))
.WillOnce(Return(-1));
- EXPECT_CALL(host_, Error(PIPELINE_ERROR_DECODE));
+ EXPECT_CALL(host_, SetError(PIPELINE_ERROR_DECODE));
EXPECT_CALL(callback_, OnFilterCallback());
EXPECT_CALL(callback_, OnCallbackDestroyed());
@@ -218,7 +218,7 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_OpenDecoderFails) {
.WillOnce(Return(0));
EXPECT_CALL(*MockFFmpeg::get(), AVCodecOpen(&codec_context_, &codec_))
.WillOnce(Return(-1));
- EXPECT_CALL(host_, Error(PIPELINE_ERROR_DECODE));
+ EXPECT_CALL(host_, SetError(PIPELINE_ERROR_DECODE));
EXPECT_CALL(callback_, OnFilterCallback());
EXPECT_CALL(callback_, OnCallbackDestroyed());
diff --git a/media/filters/file_data_source.cc b/media/filters/file_data_source.cc
index 8ac4499..36e0582 100644
--- a/media/filters/file_data_source.cc
+++ b/media/filters/file_data_source.cc
@@ -34,7 +34,7 @@ void FileDataSource::Initialize(const std::string& url,
}
if (!file_) {
file_size_ = 0;
- host()->Error(PIPELINE_ERROR_URL_NOT_FOUND);
+ host()->SetError(PIPELINE_ERROR_URL_NOT_FOUND);
callback->Run();
return;
}
diff --git a/media/filters/video_renderer_base.cc b/media/filters/video_renderer_base.cc
index 3ca45dc..b9f687a 100644
--- a/media/filters/video_renderer_base.cc
+++ b/media/filters/video_renderer_base.cc
@@ -107,7 +107,7 @@ void VideoRendererBase::Initialize(VideoDecoder* decoder,
int width = 0;
int height = 0;
if (!ParseMediaFormat(decoder->media_format(), &width, &height)) {
- host()->Error(PIPELINE_ERROR_INITIALIZATION_FAILED);
+ host()->SetError(PIPELINE_ERROR_INITIALIZATION_FAILED);
initialize_callback_->Run();
initialize_callback_.reset();
return;
@@ -118,7 +118,7 @@ void VideoRendererBase::Initialize(VideoDecoder* decoder,
// TODO(scherkus): do we trust subclasses not to do something silly while
// we're holding the lock?
if (!OnInitialize(decoder)) {
- host()->Error(PIPELINE_ERROR_INITIALIZATION_FAILED);
+ host()->SetError(PIPELINE_ERROR_INITIALIZATION_FAILED);
initialize_callback_->Run();
initialize_callback_.reset();
return;
@@ -127,7 +127,7 @@ void VideoRendererBase::Initialize(VideoDecoder* decoder,
// Create our video thread.
if (!PlatformThread::Create(0, this, &thread_)) {
NOTREACHED() << "Video thread creation failed";
- host()->Error(PIPELINE_ERROR_INITIALIZATION_FAILED);
+ host()->SetError(PIPELINE_ERROR_INITIALIZATION_FAILED);
initialize_callback_->Run();
initialize_callback_.reset();
return;
@@ -262,7 +262,7 @@ void VideoRendererBase::OnReadComplete(VideoFrame* frame) {
// We should have initialized but there's no decoded frames in the queue.
// Raise an error.
state_ = ERRORED;
- host()->Error(PIPELINE_ERROR_NO_DATA);
+ host()->SetError(PIPELINE_ERROR_NO_DATA);
initialize_callback_->Run();
initialize_callback_.reset();
} else {
diff --git a/media/filters/video_renderer_base_unittest.cc b/media/filters/video_renderer_base_unittest.cc
index 691815d..f232cde 100644
--- a/media/filters/video_renderer_base_unittest.cc
+++ b/media/filters/video_renderer_base_unittest.cc
@@ -91,7 +91,7 @@ TEST_F(VideoRendererBaseTest, Initialize_BadMediaFormat) {
scoped_refptr<MockVideoDecoder> bad_decoder = new MockVideoDecoder();
// We expect to receive an error.
- EXPECT_CALL(host_, Error(PIPELINE_ERROR_INITIALIZATION_FAILED));
+ EXPECT_CALL(host_, SetError(PIPELINE_ERROR_INITIALIZATION_FAILED));
// We expect our callback to be executed.
EXPECT_CALL(callback_, OnFilterCallback());
@@ -114,7 +114,7 @@ TEST_F(VideoRendererBaseTest, Initialize_Failed) {
.WillOnce(Return(false));
// We expect to receive an error.
- EXPECT_CALL(host_, Error(PIPELINE_ERROR_INITIALIZATION_FAILED));
+ EXPECT_CALL(host_, SetError(PIPELINE_ERROR_INITIALIZATION_FAILED));
// We expect our callback to be executed.
EXPECT_CALL(callback_, OnFilterCallback());
@@ -141,7 +141,7 @@ TEST_F(VideoRendererBaseTest, Initialize_NoData) {
EXPECT_CALL(*renderer_, CheckPoint(0));
// We'll provide end-of-stream immediately, which results in an error.
- EXPECT_CALL(host_, Error(PIPELINE_ERROR_NO_DATA));
+ EXPECT_CALL(host_, SetError(PIPELINE_ERROR_NO_DATA));
// Then we expect our callback to be executed.
EXPECT_CALL(callback_, OnFilterCallback());
diff --git a/media/player/movie.cc b/media/player/movie.cc
index 2bb4001..3554730 100644
--- a/media/player/movie.cc
+++ b/media/player/movie.cc
@@ -121,7 +121,7 @@ float Movie::GetDuration() {
float Movie::GetPosition() {
float position = 0.f;
if (pipeline_.get())
- position = (pipeline_->GetTime()).InMicroseconds() / 1000000.0f;
+ position = (pipeline_->GetCurrentTime()).InMicroseconds() / 1000000.0f;
return position;
}