Index: content/renderer/media/capture_video_decoder.cc |
diff --git a/content/renderer/media/capture_video_decoder.cc b/content/renderer/media/capture_video_decoder.cc |
index 211d0e801506c3fb39fb9832d320e4dd003a583b..72d2d1ba581ffcd8ab6c0c405ad2eaf58913e0e0 100644 |
--- a/content/renderer/media/capture_video_decoder.cc |
+++ b/content/renderer/media/capture_video_decoder.cc |
@@ -31,35 +31,19 @@ CaptureVideoDecoder::CaptureVideoDecoder( |
DCHECK(vc_manager); |
} |
-CaptureVideoDecoder::~CaptureVideoDecoder() {} |
- |
-void CaptureVideoDecoder::Initialize( |
- media::DemuxerStream* demuxer_stream, |
- 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), |
- status_cb, statistics_cb)); |
-} |
- |
-void CaptureVideoDecoder::Read(const ReadCB& read_cb) { |
+void CaptureVideoDecoder::Play(const base::Closure& callback) { |
message_loop_proxy_->PostTask( |
FROM_HERE, |
- base::Bind(&CaptureVideoDecoder::ReadOnDecoderThread, |
- this, read_cb)); |
-} |
- |
-const gfx::Size& CaptureVideoDecoder::natural_size() { |
- return natural_size_; |
+ base::Bind(&CaptureVideoDecoder::PlayOnDecoderThread, |
+ this, callback)); |
} |
-void CaptureVideoDecoder::Play(const base::Closure& callback) { |
+void CaptureVideoDecoder::Seek(base::TimeDelta time, |
+ const media::PipelineStatusCB& cb) { |
message_loop_proxy_->PostTask( |
FROM_HERE, |
- base::Bind(&CaptureVideoDecoder::PlayOnDecoderThread, |
- this, callback)); |
+ base::Bind(&CaptureVideoDecoder::SeekOnDecoderThread, |
+ this, time, cb)); |
} |
void CaptureVideoDecoder::Pause(const base::Closure& callback) { |
@@ -83,12 +67,26 @@ void CaptureVideoDecoder::Stop(const base::Closure& callback) { |
this, callback)); |
} |
-void CaptureVideoDecoder::Seek(base::TimeDelta time, |
- const media::PipelineStatusCB& cb) { |
+void CaptureVideoDecoder::Initialize( |
+ media::DemuxerStream* demuxer_stream, |
+ const media::PipelineStatusCB& status_cb, |
+ const media::StatisticsCB& statistics_cb) { |
message_loop_proxy_->PostTask( |
FROM_HERE, |
- base::Bind(&CaptureVideoDecoder::SeekOnDecoderThread, |
- this, time, cb)); |
+ base::Bind(&CaptureVideoDecoder::InitializeOnDecoderThread, |
+ this, make_scoped_refptr(demuxer_stream), |
+ status_cb, statistics_cb)); |
+} |
+ |
+void CaptureVideoDecoder::Read(const ReadCB& read_cb) { |
+ message_loop_proxy_->PostTask( |
+ FROM_HERE, |
+ base::Bind(&CaptureVideoDecoder::ReadOnDecoderThread, |
+ this, read_cb)); |
+} |
+ |
+const gfx::Size& CaptureVideoDecoder::natural_size() { |
+ return natural_size_; |
} |
void CaptureVideoDecoder::OnStarted(media::VideoCapture* capture) { |
@@ -134,26 +132,7 @@ void CaptureVideoDecoder::OnDeviceInfoReceived( |
this, capture, device_info)); |
} |
-void CaptureVideoDecoder::InitializeOnDecoderThread( |
- media::DemuxerStream* demuxer_stream, |
- const media::PipelineStatusCB& status_cb, |
- const media::StatisticsCB& statistics_cb) { |
- DVLOG(1) << "InitializeOnDecoderThread"; |
- DCHECK(message_loop_proxy_->BelongsToCurrentThread()); |
- |
- capture_engine_ = vc_manager_->AddDevice(video_stream_id_, this); |
- |
- statistics_cb_ = statistics_cb; |
- status_cb.Run(media::PIPELINE_OK); |
- state_ = kNormal; |
- capture_engine_->StartCapture(this, capability_); |
-} |
- |
-void CaptureVideoDecoder::ReadOnDecoderThread(const ReadCB& read_cb) { |
- DCHECK(message_loop_proxy_->BelongsToCurrentThread()); |
- CHECK(read_cb_.is_null()); |
- read_cb_ = read_cb; |
-} |
+CaptureVideoDecoder::~CaptureVideoDecoder() {} |
void CaptureVideoDecoder::PlayOnDecoderThread(const base::Closure& callback) { |
DVLOG(1) << "PlayOnDecoderThread"; |
@@ -161,6 +140,16 @@ void CaptureVideoDecoder::PlayOnDecoderThread(const base::Closure& callback) { |
callback.Run(); |
} |
+void CaptureVideoDecoder::SeekOnDecoderThread( |
+ base::TimeDelta time, |
+ const media::PipelineStatusCB& cb) { |
+ DVLOG(1) << "SeekOnDecoderThread"; |
+ DCHECK(message_loop_proxy_->BelongsToCurrentThread()); |
+ |
+ cb.Run(media::PIPELINE_OK); |
+ state_ = kNormal; |
+} |
+ |
void CaptureVideoDecoder::PauseOnDecoderThread(const base::Closure& callback) { |
DVLOG(1) << "PauseOnDecoderThread"; |
DCHECK(message_loop_proxy_->BelongsToCurrentThread()); |
@@ -188,14 +177,25 @@ void CaptureVideoDecoder::StopOnDecoderThread(const base::Closure& callback) { |
capture_engine_->StopCapture(this); |
} |
-void CaptureVideoDecoder::SeekOnDecoderThread( |
- base::TimeDelta time, |
- const media::PipelineStatusCB& cb) { |
- DVLOG(1) << "SeekOnDecoderThread"; |
+void CaptureVideoDecoder::InitializeOnDecoderThread( |
+ media::DemuxerStream* demuxer_stream, |
+ const media::PipelineStatusCB& status_cb, |
+ const media::StatisticsCB& statistics_cb) { |
+ DVLOG(1) << "InitializeOnDecoderThread"; |
DCHECK(message_loop_proxy_->BelongsToCurrentThread()); |
- cb.Run(media::PIPELINE_OK); |
+ capture_engine_ = vc_manager_->AddDevice(video_stream_id_, this); |
+ |
+ statistics_cb_ = statistics_cb; |
+ status_cb.Run(media::PIPELINE_OK); |
state_ = kNormal; |
+ capture_engine_->StartCapture(this, capability_); |
+} |
+ |
+void CaptureVideoDecoder::ReadOnDecoderThread(const ReadCB& read_cb) { |
+ DCHECK(message_loop_proxy_->BelongsToCurrentThread()); |
+ CHECK(read_cb_.is_null()); |
+ read_cb_ = read_cb; |
} |
void CaptureVideoDecoder::OnStoppedOnDecoderThread( |