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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_AUDIO_SINK_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_AUDIO_SINK_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_AUDIO_SINK_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_AUDIO_SINK_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 // Called when the volume of the BluetoothAudioSink object is changed. | 69 // Called when the volume of the BluetoothAudioSink object is changed. |
70 // |audio_sink| indicates the object being changed, and |volume| indicates | 70 // |audio_sink| indicates the object being changed, and |volume| indicates |
71 // the new volume level of that object. | 71 // the new volume level of that object. |
72 virtual void BluetoothAudioSinkVolumeChanged( | 72 virtual void BluetoothAudioSinkVolumeChanged( |
73 BluetoothAudioSink* audio_sink, | 73 BluetoothAudioSink* audio_sink, |
74 uint16_t volume) = 0; | 74 uint16_t volume) = 0; |
75 | 75 |
76 // Called when there is audio data available. |audio_sink| indicates the | 76 // Called when there is audio data available. |audio_sink| indicates the |
77 // object being changed. |data| is the pointer to the audio data and |size| | 77 // object being changed. |data| is the pointer to the audio data and |size| |
78 // is the number of bytes in |data|. This method provides the raw audio data | 78 // is the number of bytes in |data|. |read_mtu| is the max size of the RTP |
79 // which hasn't been processed, so RTP assembling and SBC decoding need to | 79 // packet. This method provides the raw audio data which hasn't been |
80 // be handled in order to get PCM data. | 80 // processed, so RTP assembling and SBC decoding need to be handled in order |
| 81 // to get PCM data. |
81 virtual void BluetoothAudioSinkDataAvailable(BluetoothAudioSink* audio_sink, | 82 virtual void BluetoothAudioSinkDataAvailable(BluetoothAudioSink* audio_sink, |
82 char* data, | 83 char* data, |
83 size_t size) = 0; | 84 size_t size, |
| 85 uint16_t read_mtu) = 0; |
84 }; | 86 }; |
85 | 87 |
86 // The ErrorCallback is used for the methods that can fail in which case it | 88 // The ErrorCallback is used for the methods that can fail in which case it |
87 // is called. | 89 // is called. |
88 typedef base::Callback<void(ErrorCode)> ErrorCallback; | 90 typedef base::Callback<void(ErrorCode)> ErrorCallback; |
89 | 91 |
90 // Possible volumes for media transport are 0-127, and 128 is used to | 92 // Possible volumes for media transport are 0-127, and 128 is used to |
91 // represent invalid volume. | 93 // represent invalid volume. |
92 static const uint16_t kInvalidVolume; | 94 static const uint16_t kInvalidVolume; |
93 | 95 |
(...skipping 24 matching lines...) Expand all Loading... |
118 // unregistered even if the user applications fail to do so. | 120 // unregistered even if the user applications fail to do so. |
119 virtual ~BluetoothAudioSink(); | 121 virtual ~BluetoothAudioSink(); |
120 | 122 |
121 private: | 123 private: |
122 DISALLOW_COPY_AND_ASSIGN(BluetoothAudioSink); | 124 DISALLOW_COPY_AND_ASSIGN(BluetoothAudioSink); |
123 }; | 125 }; |
124 | 126 |
125 } // namespace device | 127 } // namespace device |
126 | 128 |
127 #endif // DEVICE_BLUETOOTH_BLUETOOTH_AUDIO_SINK_H_ | 129 #endif // DEVICE_BLUETOOTH_BLUETOOTH_AUDIO_SINK_H_ |
OLD | NEW |