| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |