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/audio/cast_audio_output_stream.h" | 5 #include "chromecast/media/audio/cast_audio_output_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/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 } | 168 } |
169 | 169 |
170 void OnEndOfStream(MediaPipelineBackend::Decoder* decoder) override {} | 170 void OnEndOfStream(MediaPipelineBackend::Decoder* decoder) override {} |
171 | 171 |
172 void OnDecoderError(MediaPipelineBackend::Decoder* decoder) override { | 172 void OnDecoderError(MediaPipelineBackend::Decoder* decoder) override { |
173 error_ = true; | 173 error_ = true; |
174 if (!completion_cb_.is_null()) | 174 if (!completion_cb_.is_null()) |
175 OnPushBufferComplete(decoder_, MediaPipelineBackend::kBufferFailed); | 175 OnPushBufferComplete(decoder_, MediaPipelineBackend::kBufferFailed); |
176 } | 176 } |
177 | 177 |
| 178 void OnKeyStatusChanged(const std::string& key_id, |
| 179 CastKeyStatus key_status, |
| 180 uint32_t system_code) override {} |
| 181 |
178 base::WeakPtr<CastAudioOutputStream::Backend> GetWeakPtr() { | 182 base::WeakPtr<CastAudioOutputStream::Backend> GetWeakPtr() { |
179 return weak_factory_.GetWeakPtr(); | 183 return weak_factory_.GetWeakPtr(); |
180 } | 184 } |
181 | 185 |
182 private: | 186 private: |
183 const ::media::AudioParameters audio_params_; | 187 const ::media::AudioParameters audio_params_; |
184 scoped_ptr<MediaPipelineBackend> backend_; | 188 scoped_ptr<MediaPipelineBackend> backend_; |
185 scoped_ptr<TaskRunnerImpl> backend_task_runner_; | 189 scoped_ptr<TaskRunnerImpl> backend_task_runner_; |
186 MediaPipelineBackend::AudioDecoder* decoder_; | 190 MediaPipelineBackend::AudioDecoder* decoder_; |
187 PushBufferCompletionCallback completion_cb_; | 191 PushBufferCompletionCallback completion_cb_; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 audio_task_runner_->PostDelayedTask( | 377 audio_task_runner_->PostDelayedTask( |
374 FROM_HERE, | 378 FROM_HERE, |
375 base::Bind(&CastAudioOutputStream::PushBuffer, | 379 base::Bind(&CastAudioOutputStream::PushBuffer, |
376 weak_factory_.GetWeakPtr()), | 380 weak_factory_.GetWeakPtr()), |
377 delay); | 381 delay); |
378 push_in_progress_ = true; | 382 push_in_progress_ = true; |
379 } | 383 } |
380 | 384 |
381 } // namespace media | 385 } // namespace media |
382 } // namespace chromecast | 386 } // namespace chromecast |
OLD | NEW |