Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: content/renderer/media/capture_video_decoder.cc

Issue 9718013: Merge FilterStatusCB into PipelineStatusCB. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Keep ResetAndRunCB in filters.h. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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& status_cb) {
Ami GONE FROM CHROMIUM 2012/03/17 17:27:11 s/status_// to match the .h file.
xhwang 2012/03/17 19:20:52 Done.
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 status_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";
202 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); 203 DCHECK(message_loop_proxy_->BelongsToCurrentThread());
203 if (!pending_stop_cb_.is_null()) 204 if (!pending_stop_cb_.is_null())
204 media::ResetAndRunCB(&pending_stop_cb_); 205 media::ResetAndRunCB(&pending_stop_cb_);
205 vc_manager_->RemoveDevice(video_stream_id_, this); 206 vc_manager_->RemoveDevice(video_stream_id_, this);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698