Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: device/bluetooth/bluetooth_audio_sink.h

Issue 993273002: device/bluetooth: Add I/O watcher for audio data retrieval triggered by state change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_bluetooth_media_transport_client.cc ('k') | device/bluetooth/bluetooth_audio_sink_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698