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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 uint32_t system_code) override {} | 178 uint32_t system_code) override {} |
179 | 179 |
180 void OnVideoResolutionChanged(const Size& size) override {} | 180 void OnVideoResolutionChanged(const Size& size) override {} |
181 | 181 |
182 base::WeakPtr<CastAudioOutputStream::Backend> GetWeakPtr() { | 182 base::WeakPtr<CastAudioOutputStream::Backend> GetWeakPtr() { |
183 return weak_factory_.GetWeakPtr(); | 183 return weak_factory_.GetWeakPtr(); |
184 } | 184 } |
185 | 185 |
186 private: | 186 private: |
187 const ::media::AudioParameters audio_params_; | 187 const ::media::AudioParameters audio_params_; |
188 scoped_ptr<MediaPipelineBackend> backend_; | 188 std::unique_ptr<MediaPipelineBackend> backend_; |
189 scoped_ptr<TaskRunnerImpl> backend_task_runner_; | 189 std::unique_ptr<TaskRunnerImpl> backend_task_runner_; |
190 MediaPipelineBackend::AudioDecoder* decoder_; | 190 MediaPipelineBackend::AudioDecoder* decoder_; |
191 PushBufferCompletionCallback completion_cb_; | 191 PushBufferCompletionCallback completion_cb_; |
192 bool first_start_; | 192 bool first_start_; |
193 bool error_; | 193 bool error_; |
194 scoped_refptr<DecoderBufferBase> backend_buffer_; | 194 scoped_refptr<DecoderBufferBase> backend_buffer_; |
195 base::ThreadChecker thread_checker_; | 195 base::ThreadChecker thread_checker_; |
196 base::WeakPtrFactory<CastAudioOutputStream::Backend> weak_factory_; | 196 base::WeakPtrFactory<CastAudioOutputStream::Backend> weak_factory_; |
197 | 197 |
198 DISALLOW_COPY_AND_ASSIGN(Backend); | 198 DISALLOW_COPY_AND_ASSIGN(Backend); |
199 }; | 199 }; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 audio_task_runner_->PostDelayedTask( | 378 audio_task_runner_->PostDelayedTask( |
379 FROM_HERE, | 379 FROM_HERE, |
380 base::Bind(&CastAudioOutputStream::PushBuffer, | 380 base::Bind(&CastAudioOutputStream::PushBuffer, |
381 weak_factory_.GetWeakPtr()), | 381 weak_factory_.GetWeakPtr()), |
382 delay); | 382 delay); |
383 push_in_progress_ = true; | 383 push_in_progress_ = true; |
384 } | 384 } |
385 | 385 |
386 } // namespace media | 386 } // namespace media |
387 } // namespace chromecast | 387 } // namespace chromecast |
OLD | NEW |