diff options
Diffstat (limited to 'media/filters')
-rw-r--r-- | media/filters/audio_renderer_base.cc | 14 | ||||
-rw-r--r-- | media/filters/audio_renderer_base.h | 4 | ||||
-rw-r--r-- | media/filters/ffmpeg_glue.cc | 14 | ||||
-rw-r--r-- | media/filters/ffmpeg_glue.h | 4 | ||||
-rw-r--r-- | media/filters/file_data_source.cc | 6 | ||||
-rw-r--r-- | media/filters/file_data_source.h | 4 | ||||
-rw-r--r-- | media/filters/video_renderer_base.cc | 30 |
7 files changed, 38 insertions, 38 deletions
diff --git a/media/filters/audio_renderer_base.cc b/media/filters/audio_renderer_base.cc index d330521..9d7783f 100644 --- a/media/filters/audio_renderer_base.cc +++ b/media/filters/audio_renderer_base.cc @@ -28,7 +28,7 @@ AudioRendererBase::~AudioRendererBase() { } void AudioRendererBase::Play(FilterCallback* callback) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); DCHECK_EQ(kPaused, state_); scoped_ptr<FilterCallback> c(callback); state_ = kPlaying; @@ -36,7 +36,7 @@ void AudioRendererBase::Play(FilterCallback* callback) { } void AudioRendererBase::Pause(FilterCallback* callback) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); DCHECK_EQ(kPlaying, state_); pause_callback_.reset(callback); state_ = kPaused; @@ -53,7 +53,7 @@ void AudioRendererBase::Pause(FilterCallback* callback) { void AudioRendererBase::Stop(FilterCallback* callback) { OnStop(); { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); state_ = kStopped; algorithm_.reset(NULL); } @@ -64,7 +64,7 @@ void AudioRendererBase::Stop(FilterCallback* callback) { } void AudioRendererBase::Seek(base::TimeDelta time, FilterCallback* callback) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); DCHECK_EQ(kPaused, state_); DCHECK_EQ(0u, pending_reads_) << "Pending reads should have completed"; state_ = kSeeking; @@ -129,7 +129,7 @@ void AudioRendererBase::Initialize(AudioDecoder* decoder, } bool AudioRendererBase::HasEnded() { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); if (rendered_end_of_stream_) { DCHECK(algorithm_->IsQueueEmpty()) << "Audio queue should be empty if we have rendered end of stream"; @@ -138,7 +138,7 @@ bool AudioRendererBase::HasEnded() { } void AudioRendererBase::ConsumeAudioSamples(scoped_refptr<Buffer> buffer_in) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); DCHECK(state_ == kPaused || state_ == kSeeking || state_ == kPlaying); DCHECK_GT(pending_reads_, 0u); --pending_reads_; @@ -191,7 +191,7 @@ uint32 AudioRendererBase::FillBuffer(uint8* dest, base::TimeDelta last_fill_buffer_time; size_t dest_written = 0; { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); // Mute audio by returning 0 when not playing. if (state_ != kPlaying) { diff --git a/media/filters/audio_renderer_base.h b/media/filters/audio_renderer_base.h index c0af81a..6c77acb 100644 --- a/media/filters/audio_renderer_base.h +++ b/media/filters/audio_renderer_base.h @@ -20,7 +20,7 @@ #include <deque> -#include "base/lock.h" +#include "base/synchronization/lock.h" #include "media/base/buffers.h" #include "media/base/filters.h" #include "media/filters/audio_renderer_algorithm_base.h" @@ -102,7 +102,7 @@ class AudioRendererBase : public AudioRenderer { // Algorithm for scaling audio. scoped_ptr<AudioRendererAlgorithmBase> algorithm_; - Lock lock_; + base::Lock lock_; // Simple state tracking variable. enum State { diff --git a/media/filters/ffmpeg_glue.cc b/media/filters/ffmpeg_glue.cc index 663fff7..fede662 100644 --- a/media/filters/ffmpeg_glue.cc +++ b/media/filters/ffmpeg_glue.cc @@ -88,21 +88,21 @@ int CloseContext(URLContext* h) { int LockManagerOperation(void** lock, enum AVLockOp op) { switch (op) { case AV_LOCK_CREATE: - *lock = new Lock(); + *lock = new base::Lock(); if (!*lock) return 1; return 0; case AV_LOCK_OBTAIN: - static_cast<Lock*>(*lock)->Acquire(); + static_cast<base::Lock*>(*lock)->Acquire(); return 0; case AV_LOCK_RELEASE: - static_cast<Lock*>(*lock)->Release(); + static_cast<base::Lock*>(*lock)->Release(); return 0; case AV_LOCK_DESTROY: - delete static_cast<Lock*>(*lock); + delete static_cast<base::Lock*>(*lock); *lock = NULL; return 0; } @@ -151,7 +151,7 @@ FFmpegGlue* FFmpegGlue::GetInstance() { } std::string FFmpegGlue::AddProtocol(FFmpegURLProtocol* protocol) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); std::string key = GetProtocolKey(protocol); if (protocols_.find(key) == protocols_.end()) { protocols_[key] = protocol; @@ -160,7 +160,7 @@ std::string FFmpegGlue::AddProtocol(FFmpegURLProtocol* protocol) { } void FFmpegGlue::RemoveProtocol(FFmpegURLProtocol* protocol) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); for (ProtocolMap::iterator cur, iter = protocols_.begin(); iter != protocols_.end();) { cur = iter; @@ -173,7 +173,7 @@ void FFmpegGlue::RemoveProtocol(FFmpegURLProtocol* protocol) { void FFmpegGlue::GetProtocol(const std::string& key, FFmpegURLProtocol** protocol) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); ProtocolMap::iterator iter = protocols_.find(key); if (iter == protocols_.end()) { *protocol = NULL; diff --git a/media/filters/ffmpeg_glue.h b/media/filters/ffmpeg_glue.h index 4f991d1..aa12670 100644 --- a/media/filters/ffmpeg_glue.h +++ b/media/filters/ffmpeg_glue.h @@ -29,8 +29,8 @@ #include <map> #include <string> -#include "base/lock.h" #include "base/singleton.h" +#include "base/synchronization/lock.h" namespace media { @@ -93,7 +93,7 @@ class FFmpegGlue { std::string GetProtocolKey(FFmpegURLProtocol* protocol); // Mutual exclusion while adding/removing items from the map. - Lock lock_; + base::Lock lock_; // Map between keys and FFmpegProtocol references. typedef std::map<std::string, FFmpegURLProtocol*> ProtocolMap; diff --git a/media/filters/file_data_source.cc b/media/filters/file_data_source.cc index 3fd1a04..64c61fb 100644 --- a/media/filters/file_data_source.cc +++ b/media/filters/file_data_source.cc @@ -50,7 +50,7 @@ void FileDataSource::Initialize(const std::string& url, } void FileDataSource::Stop(FilterCallback* callback) { - AutoLock l(lock_); + base::AutoLock l(lock_); if (file_) { file_util::CloseFile(file_); file_ = NULL; @@ -69,7 +69,7 @@ const MediaFormat& FileDataSource::media_format() { void FileDataSource::Read(int64 position, size_t size, uint8* data, ReadCallback* read_callback) { DCHECK(file_); - AutoLock l(lock_); + base::AutoLock l(lock_); scoped_ptr<ReadCallback> callback(read_callback); if (file_) { #if defined(OS_WIN) @@ -101,7 +101,7 @@ void FileDataSource::Read(int64 position, size_t size, uint8* data, bool FileDataSource::GetSize(int64* size_out) { DCHECK(size_out); DCHECK(file_); - AutoLock l(lock_); + base::AutoLock l(lock_); *size_out = file_size_; return (NULL != file_); } diff --git a/media/filters/file_data_source.h b/media/filters/file_data_source.h index f6aed76..7be9a5a 100644 --- a/media/filters/file_data_source.h +++ b/media/filters/file_data_source.h @@ -8,7 +8,7 @@ #include <string> #include "base/gtest_prod_util.h" -#include "base/lock.h" +#include "base/synchronization/lock.h" #include "media/base/filters.h" namespace media { @@ -54,7 +54,7 @@ class FileDataSource : public DataSource { // TODO(ralphl): Ideally this would use asynchronous I/O or we will know // that we will block for a short period of time in reads. Otherwise, we can // hang the pipeline Stop. - Lock lock_; + base::Lock lock_; DISALLOW_COPY_AND_ASSIGN(FileDataSource); }; diff --git a/media/filters/video_renderer_base.cc b/media/filters/video_renderer_base.cc index c870df5..410e18f 100644 --- a/media/filters/video_renderer_base.cc +++ b/media/filters/video_renderer_base.cc @@ -39,7 +39,7 @@ VideoRendererBase::VideoRendererBase() } VideoRendererBase::~VideoRendererBase() { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); DCHECK(state_ == kUninitialized || state_ == kStopped); } @@ -78,7 +78,7 @@ bool VideoRendererBase::ParseMediaFormat( } void VideoRendererBase::Play(FilterCallback* callback) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); DCHECK_EQ(kPrerolled, state_); scoped_ptr<FilterCallback> c(callback); state_ = kPlaying; @@ -86,7 +86,7 @@ void VideoRendererBase::Play(FilterCallback* callback) { } void VideoRendererBase::Pause(FilterCallback* callback) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); DCHECK(state_ != kUninitialized || state_ == kError); AutoCallbackRunner done_runner(callback); state_ = kPaused; @@ -95,7 +95,7 @@ void VideoRendererBase::Pause(FilterCallback* callback) { void VideoRendererBase::Flush(FilterCallback* callback) { DCHECK_EQ(state_, kPaused); - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); flush_callback_.reset(callback); state_ = kFlushing; @@ -107,7 +107,7 @@ void VideoRendererBase::Stop(FilterCallback* callback) { DCHECK_EQ(pending_reads_, 0); { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); state_ = kStopped; // Clean up our thread if present. @@ -116,7 +116,7 @@ void VideoRendererBase::Stop(FilterCallback* callback) { // thread waiting for a read to complete. frame_available_.Signal(); { - AutoUnlock auto_unlock(lock_); + base::AutoUnlock auto_unlock(lock_); base::PlatformThread::Join(thread_); } thread_ = base::kNullThreadHandle; @@ -128,12 +128,12 @@ void VideoRendererBase::Stop(FilterCallback* callback) { } void VideoRendererBase::SetPlaybackRate(float playback_rate) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); playback_rate_ = playback_rate; } void VideoRendererBase::Seek(base::TimeDelta time, FilterCallback* callback) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); // There is a race condition between filters to receive SeekTask(). // It turns out we could receive buffer from decoder before seek() // is called on us. so we do the following: @@ -158,7 +158,7 @@ void VideoRendererBase::Seek(base::TimeDelta time, FilterCallback* callback) { void VideoRendererBase::Initialize(VideoDecoder* decoder, FilterCallback* callback) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); DCHECK(decoder); DCHECK(callback); DCHECK_EQ(kUninitialized, state_); @@ -210,7 +210,7 @@ void VideoRendererBase::Initialize(VideoDecoder* decoder, } bool VideoRendererBase::HasEnded() { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); return state_ == kEnded; } @@ -220,7 +220,7 @@ void VideoRendererBase::ThreadMain() { base::TimeDelta remaining_time; for (;;) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); const base::TimeDelta kIdleTimeDelta = base::TimeDelta::FromMilliseconds(kIdleMilliseconds); @@ -317,7 +317,7 @@ void VideoRendererBase::ThreadMain() { ScheduleRead_Locked(); } if (new_frame_available) { - AutoUnlock auto_unlock(lock_); + base::AutoUnlock auto_unlock(lock_); // Notify subclass that |current_frame_| has been updated. OnFrameAvailable(); } @@ -326,7 +326,7 @@ void VideoRendererBase::ThreadMain() { } void VideoRendererBase::GetCurrentFrame(scoped_refptr<VideoFrame>* frame_out) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); DCHECK(!pending_paint_ && !pending_paint_with_last_available_); if (!current_frame_.get() || current_frame_->IsEndOfStream()) { @@ -352,7 +352,7 @@ void VideoRendererBase::GetCurrentFrame(scoped_refptr<VideoFrame>* frame_out) { } void VideoRendererBase::PutCurrentFrame(scoped_refptr<VideoFrame> frame) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); // Note that we do not claim |pending_paint_| when we return NULL frame, in // that case, |current_frame_| could be changed before PutCurrentFrame. @@ -376,7 +376,7 @@ void VideoRendererBase::PutCurrentFrame(scoped_refptr<VideoFrame> frame) { } void VideoRendererBase::ConsumeVideoFrame(scoped_refptr<VideoFrame> frame) { - AutoLock auto_lock(lock_); + base::AutoLock auto_lock(lock_); // Decoder could reach seek state before our Seek() get called. // We will enter kSeeking |