OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/media/cma/filters/cma_renderer.h" | 5 #include "chromecast/media/cma/filters/cma_renderer.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/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 time_interpolator_->SetUpperBound(base::TimeDelta()); | 60 time_interpolator_->SetUpperBound(base::TimeDelta()); |
61 } | 61 } |
62 | 62 |
63 CmaRenderer::~CmaRenderer() { | 63 CmaRenderer::~CmaRenderer() { |
64 DCHECK(thread_checker_.CalledOnValidThread()); | 64 DCHECK(thread_checker_.CalledOnValidThread()); |
65 if (!init_cb_.is_null()) | 65 if (!init_cb_.is_null()) |
66 base::ResetAndReturn(&init_cb_).Run(::media::PIPELINE_ERROR_ABORT); | 66 base::ResetAndReturn(&init_cb_).Run(::media::PIPELINE_ERROR_ABORT); |
67 else if (!flush_cb_.is_null()) | 67 else if (!flush_cb_.is_null()) |
68 base::ResetAndReturn(&flush_cb_).Run(); | 68 base::ResetAndReturn(&flush_cb_).Run(); |
| 69 |
| 70 if (has_audio_ || has_video_) |
| 71 media_pipeline_->Stop(); |
69 } | 72 } |
70 | 73 |
71 void CmaRenderer::Initialize( | 74 void CmaRenderer::Initialize( |
72 ::media::DemuxerStreamProvider* demuxer_stream_provider, | 75 ::media::DemuxerStreamProvider* demuxer_stream_provider, |
73 const ::media::PipelineStatusCB& init_cb, | 76 const ::media::PipelineStatusCB& init_cb, |
74 const ::media::StatisticsCB& statistics_cb, | 77 const ::media::StatisticsCB& statistics_cb, |
75 const ::media::BufferingStateCB& buffering_state_cb, | 78 const ::media::BufferingStateCB& buffering_state_cb, |
76 const PaintCB& paint_cb, | 79 const PaintCB& paint_cb, |
77 const base::Closure& ended_cb, | 80 const base::Closure& ended_cb, |
78 const ::media::PipelineStatusCB& error_cb, | 81 const ::media::PipelineStatusCB& error_cb, |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 is_pending_transition_ = true; | 462 is_pending_transition_ = true; |
460 } | 463 } |
461 | 464 |
462 void CmaRenderer::CompleteStateTransition(State new_state) { | 465 void CmaRenderer::CompleteStateTransition(State new_state) { |
463 state_ = new_state; | 466 state_ = new_state; |
464 is_pending_transition_ = false; | 467 is_pending_transition_ = false; |
465 } | 468 } |
466 | 469 |
467 } // namespace media | 470 } // namespace media |
468 } // namespace chromecast | 471 } // namespace chromecast |
OLD | NEW |