| 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; |
| 50 | 51 |
| 51 if (!decoder->SetConfig(audio_config)) | 52 if (!decoder->SetConfig(audio_config)) |
| 52 return nullptr; | 53 return nullptr; |
| 53 | 54 |
| 54 if (!backend->Initialize()) | 55 if (!backend->Initialize()) |
| 55 return nullptr; | 56 return nullptr; |
| 56 | 57 |
| 57 return decoder; | 58 return decoder; |
| 58 } | 59 } |
| 59 | 60 |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 audio_task_runner_->PostDelayedTask( | 379 audio_task_runner_->PostDelayedTask( |
| 379 FROM_HERE, | 380 FROM_HERE, |
| 380 base::Bind(&CastAudioOutputStream::PushBuffer, | 381 base::Bind(&CastAudioOutputStream::PushBuffer, |
| 381 weak_factory_.GetWeakPtr()), | 382 weak_factory_.GetWeakPtr()), |
| 382 delay); | 383 delay); |
| 383 push_in_progress_ = true; | 384 push_in_progress_ = true; |
| 384 } | 385 } |
| 385 | 386 |
| 386 } // namespace media | 387 } // namespace media |
| 387 } // namespace chromecast | 388 } // namespace chromecast |
| OLD | NEW |