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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 BluetoothAudioSink* audio_sink, | 66 BluetoothAudioSink* audio_sink, |
67 BluetoothAudioSink::State state) = 0; | 67 BluetoothAudioSink::State state) = 0; |
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 // TODO(mcchou): Add method to monitor the availability of audio data during | 76 // Called when there is audio data available. |audio_sink| indicates the |
77 // the streaming. This method should associate with BluetoothAudioSink | 77 // object being changed. |data| is the pointer to the audio data and |size| |
78 // specific IOBuffer wrapping fd, read_mtu and write_mtu. | 78 // is the number of bytes in |data|. This method provides the raw audio data |
| 79 // which hasn't been processed, so RTP assembling and SBC decoding need to |
| 80 // be handled in order to get PCM data. |
| 81 virtual void BluetoothAudioSinkDataAvailable(BluetoothAudioSink* audio_sink, |
| 82 char* data, |
| 83 size_t size) = 0; |
79 }; | 84 }; |
80 | 85 |
81 // The ErrorCallback is used for the methods that can fail in which case it | 86 // The ErrorCallback is used for the methods that can fail in which case it |
82 // is called. | 87 // is called. |
83 typedef base::Callback<void(ErrorCode)> ErrorCallback; | 88 typedef base::Callback<void(ErrorCode)> ErrorCallback; |
84 | 89 |
85 // Possible volumes for media transport are 0-127, and 128 is used to | 90 // Possible volumes for media transport are 0-127, and 128 is used to |
86 // represent invalid volume. | 91 // represent invalid volume. |
87 static const uint16_t kInvalidVolume; | 92 static const uint16_t kInvalidVolume; |
88 | 93 |
(...skipping 24 matching lines...) Expand all Loading... |
113 // unregistered even if the user applications fail to do so. | 118 // unregistered even if the user applications fail to do so. |
114 virtual ~BluetoothAudioSink(); | 119 virtual ~BluetoothAudioSink(); |
115 | 120 |
116 private: | 121 private: |
117 DISALLOW_COPY_AND_ASSIGN(BluetoothAudioSink); | 122 DISALLOW_COPY_AND_ASSIGN(BluetoothAudioSink); |
118 }; | 123 }; |
119 | 124 |
120 } // namespace device | 125 } // namespace device |
121 | 126 |
122 #endif // DEVICE_BLUETOOTH_BLUETOOTH_AUDIO_SINK_H_ | 127 #endif // DEVICE_BLUETOOTH_BLUETOOTH_AUDIO_SINK_H_ |
OLD | NEW |