| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "device/bluetooth/bluetooth_audio_sink.h" | 5 #include "device/bluetooth/bluetooth_audio_sink.h" |
| 6 | 6 |
| 7 namespace { | 7 namespace { |
| 8 | 8 |
| 9 // SBC codec(0x00) is the mandatory codec for A2DP audio sink. | 9 // SBC codec(0x00) is the mandatory codec for A2DP audio sink. |
| 10 // |capabilities| includes the mandatory support for A2DP audio sink. | 10 // |capabilities| includes the mandatory support for A2DP audio sink. |
| 11 // [Octet0]: 0x3f | 11 // [Octet0]: 0x3f |
| 12 // Sampling frequency [0 0 1 1]: supports 44100 Hz and 48000 Hz. | 12 // Sampling frequency [0 0 1 1]: supports 44100 Hz and 48000 Hz. |
| 13 // Channel mode [1 1 1 1]: supports Mono, Dual Channel, Stereo, and Joint | 13 // Channel mode [1 1 1 1]: supports Mono, Dual Channel, Stereo, and Joint |
| 14 // Stereo. | 14 // Stereo. |
| 15 // [Octet1]: 0xff | 15 // [Octet1]: 0xff |
| 16 // Block length [1, 1, 1, 1]: supports block length of 4, 8, 12 and 16. | 16 // Block length [1, 1, 1, 1]: supports block length of 4, 8, 12 and 16. |
| 17 // Subbands [1, 1]: supports 4 and 8 subbands. | 17 // Subbands [1, 1]: supports 4 and 8 subbands. |
| 18 // Allocation Method [1, 1]: supports SNR and Loudness. | 18 // Allocation Method [1, 1]: supports SNR and Loudness. |
| 19 // [Octet2]: 0x12 | 19 // [Octet2]: 0x12 |
| 20 // Minimum bitpool value: 18 is the bitpool value for Mono. | 20 // Minimum bitpool value: 18 is the bitpool value for Mono. |
| 21 // [Octet3]: 0x35 | 21 // [Octet3]: 0x35 |
| 22 // Maximum bitpool value: 53 is the bitpool value for Joint Stereo. | 22 // Maximum bitpool value: 53 is the bitpool value for Joint Stereo. |
| 23 const uint8_t kDefaultCodec = 0x00; | 23 const uint8_t kDefaultCodec = 0x00; |
| 24 const uint8_t kDefaultCapabilities[] = {0x3f, 0xff, 0x12, 0x35}; | 24 const uint8_t kDefaultCapabilities[] = {0x3f, 0xff, 0x12, 0x35}; |
| 25 | 25 |
| 26 } // namespace | 26 } // namespace |
| 27 | 27 |
| 28 namespace device { | 28 namespace device { |
| 29 | 29 |
| 30 // static |
| 31 const uint16_t BluetoothAudioSink::kInvalidVolume = 128; |
| 32 |
| 30 BluetoothAudioSink::Options::Options() : codec(kDefaultCodec) { | 33 BluetoothAudioSink::Options::Options() : codec(kDefaultCodec) { |
| 31 capabilities.assign(kDefaultCapabilities, | 34 capabilities.assign(kDefaultCapabilities, |
| 32 kDefaultCapabilities + sizeof(kDefaultCapabilities)); | 35 kDefaultCapabilities + sizeof(kDefaultCapabilities)); |
| 33 } | 36 } |
| 34 | 37 |
| 35 BluetoothAudioSink::Options::~Options() { | 38 BluetoothAudioSink::Options::~Options() { |
| 36 } | 39 } |
| 37 | 40 |
| 38 BluetoothAudioSink::BluetoothAudioSink() { | 41 BluetoothAudioSink::BluetoothAudioSink() { |
| 39 } | 42 } |
| 40 | 43 |
| 41 BluetoothAudioSink::~BluetoothAudioSink() { | 44 BluetoothAudioSink::~BluetoothAudioSink() { |
| 42 } | 45 } |
| 43 | 46 |
| 44 } // namespace device | 47 } // namespace device |
| OLD | NEW |