| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 SatisfyRead(VideoDecoder::kOk, NULL); | 198 SatisfyRead(VideoDecoder::kOk, NULL); |
| 199 } | 199 } |
| 200 | 200 |
| 201 void VideoFrameStream::Decode(const scoped_refptr<DecoderBuffer>& buffer) { | 201 void VideoFrameStream::Decode(const scoped_refptr<DecoderBuffer>& buffer) { |
| 202 DCHECK(state_ == STATE_NORMAL || state_ == STATE_FLUSHING_DECODER) << state_; | 202 DCHECK(state_ == STATE_NORMAL || state_ == STATE_FLUSHING_DECODER) << state_; |
| 203 DCHECK(!read_cb_.is_null()); | 203 DCHECK(!read_cb_.is_null()); |
| 204 DCHECK(reset_cb_.is_null()); | 204 DCHECK(reset_cb_.is_null()); |
| 205 DCHECK(stop_cb_.is_null()); | 205 DCHECK(stop_cb_.is_null()); |
| 206 DCHECK(buffer); | 206 DCHECK(buffer); |
| 207 | 207 |
| 208 int buffer_size = buffer->IsEndOfStream() ? 0 : buffer->GetDataSize(); | 208 int buffer_size = buffer->end_of_stream() ? 0 : buffer->data_size(); |
| 209 decoder_->Decode(buffer, base::Bind(&VideoFrameStream::OnFrameReady, | 209 decoder_->Decode(buffer, base::Bind(&VideoFrameStream::OnFrameReady, |
| 210 weak_this_, buffer_size)); | 210 weak_this_, buffer_size)); |
| 211 } | 211 } |
| 212 | 212 |
| 213 void VideoFrameStream::FlushDecoder() { | 213 void VideoFrameStream::FlushDecoder() { |
| 214 Decode(DecoderBuffer::CreateEOSBuffer()); | 214 Decode(DecoderBuffer::CreateEOSBuffer()); |
| 215 } | 215 } |
| 216 | 216 |
| 217 void VideoFrameStream::OnFrameReady(int buffer_size, | 217 void VideoFrameStream::OnFrameReady(int buffer_size, |
| 218 const VideoDecoder::Status status, | 218 const VideoDecoder::Status status, |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 DCHECK(!stop_cb_.is_null()); | 411 DCHECK(!stop_cb_.is_null()); |
| 412 | 412 |
| 413 state_ = STATE_STOPPED; | 413 state_ = STATE_STOPPED; |
| 414 stream_ = NULL; | 414 stream_ = NULL; |
| 415 decoder_.reset(); | 415 decoder_.reset(); |
| 416 decrypting_demuxer_stream_.reset(); | 416 decrypting_demuxer_stream_.reset(); |
| 417 base::ResetAndReturn(&stop_cb_).Run(); | 417 base::ResetAndReturn(&stop_cb_).Run(); |
| 418 } | 418 } |
| 419 | 419 |
| 420 } // namespace media | 420 } // namespace media |
| OLD | NEW |