| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_renderer_impl.h" | 5 #include "media/filters/video_renderer_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 } | 315 } |
| 316 | 316 |
| 317 // Already-queued VideoFrameStream ReadCB's can fire after various state | 317 // Already-queued VideoFrameStream ReadCB's can fire after various state |
| 318 // transitions have happened; in that case just drop those frames immediately. | 318 // transitions have happened; in that case just drop those frames immediately. |
| 319 if (state_ == kFlushing) | 319 if (state_ == kFlushing) |
| 320 return; | 320 return; |
| 321 | 321 |
| 322 DCHECK_EQ(state_, kPlaying); | 322 DCHECK_EQ(state_, kPlaying); |
| 323 | 323 |
| 324 // Can happen when demuxers are preparing for a new Seek(). | 324 // Can happen when demuxers are preparing for a new Seek(). |
| 325 if (!frame) { | 325 if (!frame.get()) { |
| 326 DCHECK_EQ(status, VideoFrameStream::DEMUXER_READ_ABORTED); | 326 DCHECK_EQ(status, VideoFrameStream::DEMUXER_READ_ABORTED); |
| 327 return; | 327 return; |
| 328 } | 328 } |
| 329 | 329 |
| 330 if (frame->end_of_stream()) { | 330 if (frame->end_of_stream()) { |
| 331 DCHECK(!received_end_of_stream_); | 331 DCHECK(!received_end_of_stream_); |
| 332 received_end_of_stream_ = true; | 332 received_end_of_stream_ = true; |
| 333 } else { | 333 } else { |
| 334 // Maintain the latest frame decoded so the correct frame is displayed after | 334 // Maintain the latest frame decoded so the correct frame is displayed after |
| 335 // prerolling has completed. | 335 // prerolling has completed. |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 task_runner_->PostTask(FROM_HERE, base::Bind(statistics_cb_, statistics)); | 474 task_runner_->PostTask(FROM_HERE, base::Bind(statistics_cb_, statistics)); |
| 475 | 475 |
| 476 frames_decoded_ = 0; | 476 frames_decoded_ = 0; |
| 477 frames_dropped_ = 0; | 477 frames_dropped_ = 0; |
| 478 } | 478 } |
| 479 | 479 |
| 480 frame_available_.TimedWait(wait_duration); | 480 frame_available_.TimedWait(wait_duration); |
| 481 } | 481 } |
| 482 | 482 |
| 483 } // namespace media | 483 } // namespace media |
| OLD | NEW |