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

Side by Side Diff: media/filters/video_frame_stream.cc

Issue 165733002: Add DecryptingDemuxerStream::Stop(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "media/filters/video_frame_stream.h" 5 #include "media/filters/video_frame_stream.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 weak_factory_.InvalidateWeakPtrs(); 138 weak_factory_.InvalidateWeakPtrs();
139 139
140 // Post callbacks to prevent reentrance into this object. 140 // Post callbacks to prevent reentrance into this object.
141 if (!read_cb_.is_null()) 141 if (!read_cb_.is_null())
142 task_runner_->PostTask(FROM_HERE, base::Bind( 142 task_runner_->PostTask(FROM_HERE, base::Bind(
143 base::ResetAndReturn(&read_cb_), ABORTED, scoped_refptr<VideoFrame>())); 143 base::ResetAndReturn(&read_cb_), ABORTED, scoped_refptr<VideoFrame>()));
144 if (!reset_cb_.is_null()) 144 if (!reset_cb_.is_null())
145 task_runner_->PostTask(FROM_HERE, base::ResetAndReturn(&reset_cb_)); 145 task_runner_->PostTask(FROM_HERE, base::ResetAndReturn(&reset_cb_));
146 146
147 if (decrypting_demuxer_stream_) { 147 if (decrypting_demuxer_stream_) {
148 decrypting_demuxer_stream_->Reset(base::Bind( 148 decrypting_demuxer_stream_->Stop(base::Bind(
149 &VideoFrameStream::StopDecoder, weak_factory_.GetWeakPtr())); 149 &VideoFrameStream::StopDecoder, weak_factory_.GetWeakPtr()));
150 return; 150 return;
151 } 151 }
152 152
153 // We may not have a |decoder_| if Stop() was called during initialization. 153 // We may not have a |decoder_| if Stop() was called during initialization.
154 if (decoder_) { 154 if (decoder_) {
155 StopDecoder(); 155 StopDecoder();
156 return; 156 return;
157 } 157 }
158 158
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 DCHECK(!stop_cb_.is_null()); 445 DCHECK(!stop_cb_.is_null());
446 446
447 state_ = STATE_STOPPED; 447 state_ = STATE_STOPPED;
448 stream_ = NULL; 448 stream_ = NULL;
449 decoder_.reset(); 449 decoder_.reset();
450 decrypting_demuxer_stream_.reset(); 450 decrypting_demuxer_stream_.reset();
451 base::ResetAndReturn(&stop_cb_).Run(); 451 base::ResetAndReturn(&stop_cb_).Run();
452 } 452 }
453 453
454 } // namespace media 454 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698