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 29 matching lines...) Expand all Loading... |
40 if (!decoder) | 40 if (!decoder) |
41 return nullptr; | 41 return nullptr; |
42 decoder->SetDelegate(delegate); | 42 decoder->SetDelegate(delegate); |
43 | 43 |
44 AudioConfig audio_config; | 44 AudioConfig audio_config; |
45 audio_config.codec = kCodecPCM; | 45 audio_config.codec = kCodecPCM; |
46 audio_config.sample_format = kSampleFormatS16; | 46 audio_config.sample_format = kSampleFormatS16; |
47 audio_config.bytes_per_channel = audio_params.bits_per_sample() / 8; | 47 audio_config.bytes_per_channel = audio_params.bits_per_sample() / 8; |
48 audio_config.channel_number = audio_params.channels(); | 48 audio_config.channel_number = audio_params.channels(); |
49 audio_config.samples_per_second = audio_params.sample_rate(); | 49 audio_config.samples_per_second = audio_params.sample_rate(); |
50 audio_config.is_encrypted = false; | |
51 | 50 |
52 if (!decoder->SetConfig(audio_config)) | 51 if (!decoder->SetConfig(audio_config)) |
53 return nullptr; | 52 return nullptr; |
54 | 53 |
55 if (!backend->Initialize()) | 54 if (!backend->Initialize()) |
56 return nullptr; | 55 return nullptr; |
57 | 56 |
58 return decoder; | 57 return decoder; |
59 } | 58 } |
60 | 59 |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 audio_task_runner_->PostDelayedTask( | 378 audio_task_runner_->PostDelayedTask( |
380 FROM_HERE, | 379 FROM_HERE, |
381 base::Bind(&CastAudioOutputStream::PushBuffer, | 380 base::Bind(&CastAudioOutputStream::PushBuffer, |
382 weak_factory_.GetWeakPtr()), | 381 weak_factory_.GetWeakPtr()), |
383 delay); | 382 delay); |
384 push_in_progress_ = true; | 383 push_in_progress_ = true; |
385 } | 384 } |
386 | 385 |
387 } // namespace media | 386 } // namespace media |
388 } // namespace chromecast | 387 } // namespace chromecast |
OLD | NEW |