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

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 // Callled when there is audio data available. |audio_sink| indicates the
armansito 2015/03/12 03:42:55 nit: Called
Miao 2015/03/12 22:33:32 Done.
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 the bytes in |data|.
armansito 2015/03/12 03:42:55 I would explain here that this method provides the
armansito 2015/03/12 03:42:55 nit: s/number of the bytes/number of bytes/
Miao 2015/03/12 22:33:31 Done.
79 virtual void BluetoothAudioSinkDataAvailable(BluetoothAudioSink* audio_sink,
80 char* data,
81 size_t size) = 0;
79 }; 82 };
80 83
81 // The ErrorCallback is used for the methods that can fail in which case it 84 // The ErrorCallback is used for the methods that can fail in which case it
82 // is called. 85 // is called.
83 typedef base::Callback<void(ErrorCode)> ErrorCallback; 86 typedef base::Callback<void(ErrorCode)> ErrorCallback;
84 87
85 // Possible volumes for media transport are 0-127, and 128 is used to 88 // Possible volumes for media transport are 0-127, and 128 is used to
86 // represent invalid volume. 89 // represent invalid volume.
87 static const uint16_t kInvalidVolume; 90 static const uint16_t kInvalidVolume;
88 91
(...skipping 24 matching lines...) Expand all
113 // unregistered even if the user applications fail to do so. 116 // unregistered even if the user applications fail to do so.
114 virtual ~BluetoothAudioSink(); 117 virtual ~BluetoothAudioSink();
115 118
116 private: 119 private:
117 DISALLOW_COPY_AND_ASSIGN(BluetoothAudioSink); 120 DISALLOW_COPY_AND_ASSIGN(BluetoothAudioSink);
118 }; 121 };
119 122
120 } // namespace device 123 } // namespace device
121 124
122 #endif // DEVICE_BLUETOOTH_BLUETOOTH_AUDIO_SINK_H_ 125 #endif // DEVICE_BLUETOOTH_BLUETOOTH_AUDIO_SINK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698