OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/backend/alsa/media_pipeline_backend_alsa.h" | 5 #include "chromecast/media/cma/backend/alsa/media_pipeline_backend_alsa.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "chromecast/base/task_runner_impl.h" | 9 #include "chromecast/base/task_runner_impl.h" |
10 #include "chromecast/media/cma/backend/alsa/audio_decoder_alsa.h" | 10 #include "chromecast/media/cma/backend/alsa/audio_decoder_alsa.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 bool MediaPipelineBackendAlsa::Resume() { | 75 bool MediaPipelineBackendAlsa::Resume() { |
76 DCHECK_EQ(kStatePaused, state_); | 76 DCHECK_EQ(kStatePaused, state_); |
77 if (audio_decoder_ && !audio_decoder_->Resume()) | 77 if (audio_decoder_ && !audio_decoder_->Resume()) |
78 return false; | 78 return false; |
79 state_ = kStatePlaying; | 79 state_ = kStatePlaying; |
80 return true; | 80 return true; |
81 } | 81 } |
82 | 82 |
83 bool MediaPipelineBackendAlsa::SetPlaybackRate(float rate) { | 83 bool MediaPipelineBackendAlsa::SetPlaybackRate(float rate) { |
84 // TODO(kmackay) Implement this for rates other than 1.0. | 84 if (audio_decoder_) { |
85 if (rate != 1.0) | 85 return audio_decoder_->SetPlaybackRate(rate); |
86 NOTIMPLEMENTED() << " unhandled rate: " << rate; | 86 } |
87 return true; | 87 return true; |
88 } | 88 } |
89 | 89 |
90 int64_t MediaPipelineBackendAlsa::GetCurrentPts() { | 90 int64_t MediaPipelineBackendAlsa::GetCurrentPts() { |
91 if (audio_decoder_) | 91 if (audio_decoder_) |
92 return audio_decoder_->current_pts(); | 92 return audio_decoder_->current_pts(); |
93 return std::numeric_limits<int64_t>::min(); | 93 return std::numeric_limits<int64_t>::min(); |
94 } | 94 } |
95 | 95 |
96 bool MediaPipelineBackendAlsa::Primary() const { | 96 bool MediaPipelineBackendAlsa::Primary() const { |
97 return (params_.audio_type != | 97 return (params_.audio_type != |
98 MediaPipelineDeviceParams::kAudioStreamSoundEffects); | 98 MediaPipelineDeviceParams::kAudioStreamSoundEffects); |
99 } | 99 } |
100 | 100 |
101 const scoped_refptr<base::SingleThreadTaskRunner>& | 101 const scoped_refptr<base::SingleThreadTaskRunner>& |
102 MediaPipelineBackendAlsa::GetTaskRunner() const { | 102 MediaPipelineBackendAlsa::GetTaskRunner() const { |
103 return static_cast<TaskRunnerImpl*>(params_.task_runner)->runner(); | 103 return static_cast<TaskRunnerImpl*>(params_.task_runner)->runner(); |
104 } | 104 } |
105 | 105 |
106 } // namespace media | 106 } // namespace media |
107 } // namespace chromecast | 107 } // namespace chromecast |
OLD | NEW |