| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 | 266 |
| 267 // Drop decoding result if Reset() was called during decoding. | 267 // Drop decoding result if Reset() was called during decoding. |
| 268 // The resetting process will be handled when the decoder is reset. | 268 // The resetting process will be handled when the decoder is reset. |
| 269 if (!reset_cb_.is_null()) { | 269 if (!reset_cb_.is_null()) { |
| 270 AbortRead(); | 270 AbortRead(); |
| 271 return; | 271 return; |
| 272 } | 272 } |
| 273 | 273 |
| 274 // Decoder flushed. Reinitialize the video decoder. | 274 // Decoder flushed. Reinitialize the video decoder. |
| 275 if (state_ == STATE_FLUSHING_DECODER && | 275 if (state_ == STATE_FLUSHING_DECODER && |
| 276 status == VideoDecoder::kOk && frame->IsEndOfStream()) { | 276 status == VideoDecoder::kOk && frame->end_of_stream()) { |
| 277 ReinitializeDecoder(); | 277 ReinitializeDecoder(); |
| 278 return; | 278 return; |
| 279 } | 279 } |
| 280 | 280 |
| 281 if (status == VideoDecoder::kNotEnoughData) { | 281 if (status == VideoDecoder::kNotEnoughData) { |
| 282 if (state_ == STATE_NORMAL) | 282 if (state_ == STATE_NORMAL) |
| 283 ReadFromDemuxerStream(); | 283 ReadFromDemuxerStream(); |
| 284 else if (state_ == STATE_FLUSHING_DECODER) | 284 else if (state_ == STATE_FLUSHING_DECODER) |
| 285 FlushDecoder(); | 285 FlushDecoder(); |
| 286 return; | 286 return; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 DCHECK(!stop_cb_.is_null()); | 441 DCHECK(!stop_cb_.is_null()); |
| 442 | 442 |
| 443 state_ = STATE_STOPPED; | 443 state_ = STATE_STOPPED; |
| 444 stream_ = NULL; | 444 stream_ = NULL; |
| 445 decoder_.reset(); | 445 decoder_.reset(); |
| 446 decrypting_demuxer_stream_.reset(); | 446 decrypting_demuxer_stream_.reset(); |
| 447 base::ResetAndReturn(&stop_cb_).Run(); | 447 base::ResetAndReturn(&stop_cb_).Run(); |
| 448 } | 448 } |
| 449 | 449 |
| 450 } // namespace media | 450 } // namespace media |
| OLD | NEW |