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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 void CaptureVideoDecoder::PlayOnDecoderThread(const base::Closure& callback) { | 157 void CaptureVideoDecoder::PlayOnDecoderThread(const base::Closure& callback) { |
158 DVLOG(1) << "PlayOnDecoderThread"; | 158 DVLOG(1) << "PlayOnDecoderThread"; |
159 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); | 159 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); |
160 callback.Run(); | 160 callback.Run(); |
161 } | 161 } |
162 | 162 |
163 void CaptureVideoDecoder::PauseOnDecoderThread(const base::Closure& callback) { | 163 void CaptureVideoDecoder::PauseOnDecoderThread(const base::Closure& callback) { |
164 DVLOG(1) << "PauseOnDecoderThread"; | 164 DVLOG(1) << "PauseOnDecoderThread"; |
165 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); | 165 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); |
166 state_ = kPaused; | 166 state_ = kPaused; |
167 media::VideoDecoder::Pause(callback); | 167 callback.Run(); |
168 } | 168 } |
169 | 169 |
170 void CaptureVideoDecoder::FlushOnDecoderThread(const base::Closure& callback) { | 170 void CaptureVideoDecoder::FlushOnDecoderThread(const base::Closure& callback) { |
171 DVLOG(1) << "FlushOnDecoderThread"; | 171 DVLOG(1) << "FlushOnDecoderThread"; |
172 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); | 172 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); |
173 if (!read_cb_.is_null()) { | 173 if (!read_cb_.is_null()) { |
174 scoped_refptr<media::VideoFrame> video_frame = | 174 scoped_refptr<media::VideoFrame> video_frame = |
175 media::VideoFrame::CreateBlackFrame(natural_size_.width(), | 175 media::VideoFrame::CreateBlackFrame(natural_size_.width(), |
176 natural_size_.height()); | 176 natural_size_.height()); |
177 DeliverFrame(video_frame); | 177 DeliverFrame(video_frame); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 capture->FeedBuffer(buf); | 277 capture->FeedBuffer(buf); |
278 } | 278 } |
279 | 279 |
280 void CaptureVideoDecoder::DeliverFrame( | 280 void CaptureVideoDecoder::DeliverFrame( |
281 const scoped_refptr<media::VideoFrame>& video_frame) { | 281 const scoped_refptr<media::VideoFrame>& video_frame) { |
282 // Reset the callback before running to protect against reentrancy. | 282 // Reset the callback before running to protect against reentrancy. |
283 ReadCB read_cb = read_cb_; | 283 ReadCB read_cb = read_cb_; |
284 read_cb_.Reset(); | 284 read_cb_.Reset(); |
285 read_cb.Run(video_frame); | 285 read_cb.Run(video_frame); |
286 } | 286 } |
OLD | NEW |