| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/media/capture_video_decoder.h" | 5 #include "content/renderer/media/capture_video_decoder.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "content/renderer/media/video_capture_impl_manager.h" | 8 #include "content/renderer/media/video_capture_impl_manager.h" |
| 9 #include "media/base/filter_host.h" | 9 #include "media/base/filter_host.h" |
| 10 #include "media/base/limits.h" | 10 #include "media/base/limits.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 } | 76 } |
| 77 | 77 |
| 78 void CaptureVideoDecoder::Stop(const base::Closure& callback) { | 78 void CaptureVideoDecoder::Stop(const base::Closure& callback) { |
| 79 message_loop_proxy_->PostTask( | 79 message_loop_proxy_->PostTask( |
| 80 FROM_HERE, | 80 FROM_HERE, |
| 81 base::Bind(&CaptureVideoDecoder::StopOnDecoderThread, | 81 base::Bind(&CaptureVideoDecoder::StopOnDecoderThread, |
| 82 this, callback)); | 82 this, callback)); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void CaptureVideoDecoder::Seek(base::TimeDelta time, | 85 void CaptureVideoDecoder::Seek(base::TimeDelta time, |
| 86 const media::FilterStatusCB& cb) { | 86 const media::PipelineStatusCB& cb) { |
| 87 message_loop_proxy_->PostTask( | 87 message_loop_proxy_->PostTask( |
| 88 FROM_HERE, | 88 FROM_HERE, |
| 89 base::Bind(&CaptureVideoDecoder::SeekOnDecoderThread, | 89 base::Bind(&CaptureVideoDecoder::SeekOnDecoderThread, |
| 90 this, time, cb)); | 90 this, time, cb)); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void CaptureVideoDecoder::OnStarted(media::VideoCapture* capture) { | 93 void CaptureVideoDecoder::OnStarted(media::VideoCapture* capture) { |
| 94 NOTIMPLEMENTED(); | 94 NOTIMPLEMENTED(); |
| 95 } | 95 } |
| 96 | 96 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 } | 180 } |
| 181 | 181 |
| 182 void CaptureVideoDecoder::StopOnDecoderThread(const base::Closure& callback) { | 182 void CaptureVideoDecoder::StopOnDecoderThread(const base::Closure& callback) { |
| 183 DVLOG(1) << "StopOnDecoderThread"; | 183 DVLOG(1) << "StopOnDecoderThread"; |
| 184 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); | 184 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); |
| 185 pending_stop_cb_ = callback; | 185 pending_stop_cb_ = callback; |
| 186 state_ = kStopped; | 186 state_ = kStopped; |
| 187 capture_engine_->StopCapture(this); | 187 capture_engine_->StopCapture(this); |
| 188 } | 188 } |
| 189 | 189 |
| 190 void CaptureVideoDecoder::SeekOnDecoderThread(base::TimeDelta time, | 190 void CaptureVideoDecoder::SeekOnDecoderThread( |
| 191 const media::FilterStatusCB& cb) { | 191 base::TimeDelta time, |
| 192 const media::PipelineStatusCB& cb) { |
| 192 DVLOG(1) << "SeekOnDecoderThread"; | 193 DVLOG(1) << "SeekOnDecoderThread"; |
| 193 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); | 194 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); |
| 194 | 195 |
| 195 cb.Run(media::PIPELINE_OK); | 196 cb.Run(media::PIPELINE_OK); |
| 196 state_ = kNormal; | 197 state_ = kNormal; |
| 197 } | 198 } |
| 198 | 199 |
| 199 void CaptureVideoDecoder::OnStoppedOnDecoderThread( | 200 void CaptureVideoDecoder::OnStoppedOnDecoderThread( |
| 200 media::VideoCapture* capture) { | 201 media::VideoCapture* capture) { |
| 201 DVLOG(1) << "OnStoppedOnDecoderThread"; | 202 DVLOG(1) << "OnStoppedOnDecoderThread"; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 capture->FeedBuffer(buf); | 277 capture->FeedBuffer(buf); |
| 277 } | 278 } |
| 278 | 279 |
| 279 void CaptureVideoDecoder::DeliverFrame( | 280 void CaptureVideoDecoder::DeliverFrame( |
| 280 const scoped_refptr<media::VideoFrame>& video_frame) { | 281 const scoped_refptr<media::VideoFrame>& video_frame) { |
| 281 // Reset the callback before running to protect against reentrancy. | 282 // Reset the callback before running to protect against reentrancy. |
| 282 ReadCB read_cb = read_cb_; | 283 ReadCB read_cb = read_cb_; |
| 283 read_cb_.Reset(); | 284 read_cb_.Reset(); |
| 284 read_cb.Run(video_frame); | 285 read_cb.Run(video_frame); |
| 285 } | 286 } |
| OLD | NEW |