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/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 return; | 134 return; |
135 } | 135 } |
136 | 136 |
137 state_ = STATE_STOPPED; | 137 state_ = STATE_STOPPED; |
138 stream_ = NULL; | 138 stream_ = NULL; |
139 decoder_.reset(); | 139 decoder_.reset(); |
140 decrypting_demuxer_stream_.reset(); | 140 decrypting_demuxer_stream_.reset(); |
141 message_loop_->PostTask(FROM_HERE, base::ResetAndReturn(&stop_cb_)); | 141 message_loop_->PostTask(FROM_HERE, base::ResetAndReturn(&stop_cb_)); |
142 } | 142 } |
143 | 143 |
144 bool VideoFrameStream::HasOutputFrameAvailable() const { | 144 bool VideoFrameStream::CanReadWithoutStalling() const { |
145 DCHECK(message_loop_->BelongsToCurrentThread()); | 145 DCHECK(message_loop_->BelongsToCurrentThread()); |
146 return decoder_->HasOutputFrameAvailable(); | 146 return decoder_->CanReadWithoutStalling(); |
147 } | 147 } |
148 | 148 |
149 void VideoFrameStream::Read(const DemuxerStream::ReadCB& demuxer_read_cb) { | 149 void VideoFrameStream::Read(const DemuxerStream::ReadCB& demuxer_read_cb) { |
150 DCHECK(message_loop_->BelongsToCurrentThread()); | 150 DCHECK(message_loop_->BelongsToCurrentThread()); |
151 | 151 |
152 if (state_ == STATE_FLUSHING_DECODER) { | 152 if (state_ == STATE_FLUSHING_DECODER) { |
153 message_loop_->PostTask(FROM_HERE, base::Bind( | 153 message_loop_->PostTask(FROM_HERE, base::Bind( |
154 demuxer_read_cb, DemuxerStream::kOk, DecoderBuffer::CreateEOSBuffer())); | 154 demuxer_read_cb, DemuxerStream::kOk, DecoderBuffer::CreateEOSBuffer())); |
155 return; | 155 return; |
156 } | 156 } |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 DCHECK(!stop_cb_.is_null()); | 358 DCHECK(!stop_cb_.is_null()); |
359 | 359 |
360 state_ = STATE_STOPPED; | 360 state_ = STATE_STOPPED; |
361 stream_ = NULL; | 361 stream_ = NULL; |
362 decoder_.reset(); | 362 decoder_.reset(); |
363 decrypting_demuxer_stream_.reset(); | 363 decrypting_demuxer_stream_.reset(); |
364 base::ResetAndReturn(&stop_cb_).Run(); | 364 base::ResetAndReturn(&stop_cb_).Run(); |
365 } | 365 } |
366 | 366 |
367 } // namespace media | 367 } // namespace media |
OLD | NEW |