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 25 matching lines...) Expand all Loading... | |
36 MediaPipelineBackend::AudioDecoder* decoder = backend->CreateAudioDecoder(); | 36 MediaPipelineBackend::AudioDecoder* decoder = backend->CreateAudioDecoder(); |
37 if (!decoder) | 37 if (!decoder) |
38 return nullptr; | 38 return nullptr; |
39 | 39 |
40 AudioConfig audio_config; | 40 AudioConfig audio_config; |
41 audio_config.codec = kCodecPCM; | 41 audio_config.codec = kCodecPCM; |
42 audio_config.sample_format = kSampleFormatS16; | 42 audio_config.sample_format = kSampleFormatS16; |
43 audio_config.bytes_per_channel = audio_params.bits_per_sample() / 8; | 43 audio_config.bytes_per_channel = audio_params.bits_per_sample() / 8; |
44 audio_config.channel_number = audio_params.channels(); | 44 audio_config.channel_number = audio_params.channels(); |
45 audio_config.samples_per_second = audio_params.sample_rate(); | 45 audio_config.samples_per_second = audio_params.sample_rate(); |
46 audio_config.is_encrypted = false; | 46 audio_config.encryption_scheme.is_encrypted = false; |
ddorwin
2015/12/10 18:36:00
The constructor handles this (as well as all other
dougsteed
2015/12/14 21:19:01
Done.
| |
47 | 47 |
48 if (!decoder->SetConfig(audio_config)) | 48 if (!decoder->SetConfig(audio_config)) |
49 return nullptr; | 49 return nullptr; |
50 | 50 |
51 if (!backend->Initialize(delegate)) | 51 if (!backend->Initialize(delegate)) |
52 return nullptr; | 52 return nullptr; |
53 | 53 |
54 return decoder; | 54 return decoder; |
55 } | 55 } |
56 | 56 |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
377 audio_task_runner_->PostDelayedTask( | 377 audio_task_runner_->PostDelayedTask( |
378 FROM_HERE, | 378 FROM_HERE, |
379 base::Bind(&CastAudioOutputStream::PushBuffer, | 379 base::Bind(&CastAudioOutputStream::PushBuffer, |
380 weak_factory_.GetWeakPtr()), | 380 weak_factory_.GetWeakPtr()), |
381 delay); | 381 delay); |
382 push_in_progress_ = true; | 382 push_in_progress_ = true; |
383 } | 383 } |
384 | 384 |
385 } // namespace media | 385 } // namespace media |
386 } // namespace chromecast | 386 } // namespace chromecast |
OLD | NEW |