Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CHROMEOS_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_AUDIO_SINK_CHROMEOS_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_AUDIO_SINK_CHROMEOS_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_AUDIO_SINK_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 15 #include "chromeos/dbus/bluetooth_media_client.h" | 15 #include "chromeos/dbus/bluetooth_media_client.h" |
| 16 #include "chromeos/dbus/bluetooth_media_endpoint_service_provider.h" | 16 #include "chromeos/dbus/bluetooth_media_endpoint_service_provider.h" |
| 17 #include "chromeos/dbus/bluetooth_media_transport_client.h" | 17 #include "chromeos/dbus/bluetooth_media_transport_client.h" |
| 18 #include "dbus/file_descriptor.h" | 18 #include "dbus/file_descriptor.h" |
| 19 #include "dbus/object_path.h" | 19 #include "dbus/object_path.h" |
| 20 #include "device/bluetooth/bluetooth_adapter.h" | 20 #include "device/bluetooth/bluetooth_adapter.h" |
| 21 #include "device/bluetooth/bluetooth_adapter_chromeos.h" | 21 #include "device/bluetooth/bluetooth_adapter_chromeos.h" |
| 22 #include "device/bluetooth/bluetooth_audio_sink.h" | 22 #include "device/bluetooth/bluetooth_audio_sink.h" |
| 23 #include "device/bluetooth/bluetooth_export.h" | 23 #include "device/bluetooth/bluetooth_export.h" |
| 24 | 24 |
| 25 namespace chromeos { | 25 namespace chromeos { |
| 26 | 26 |
| 27 class BluetoothAdapterChromeOS; | |
|
armansito
2015/01/27 04:38:06
I don't see you dealing with BluetoothAdapterChrom
Miao
2015/01/28 02:05:02
Removed.
| |
| 28 | |
| 27 class DEVICE_BLUETOOTH_EXPORT BluetoothAudioSinkChromeOS | 29 class DEVICE_BLUETOOTH_EXPORT BluetoothAudioSinkChromeOS |
| 28 : public device::BluetoothAudioSink, | 30 : public device::BluetoothAudioSink, |
| 29 public device::BluetoothAdapter::Observer, | 31 public device::BluetoothAdapter::Observer, |
| 30 public BluetoothMediaClient::Observer, | 32 public BluetoothMediaClient::Observer, |
| 31 public BluetoothMediaTransportClient::Observer, | 33 public BluetoothMediaTransportClient::Observer, |
| 32 public BluetoothMediaEndpointServiceProvider::Delegate { | 34 public BluetoothMediaEndpointServiceProvider::Delegate { |
| 33 public: | 35 public: |
| 34 explicit BluetoothAudioSinkChromeOS(BluetoothAdapterChromeOS* adapter); | 36 explicit BluetoothAudioSinkChromeOS(BluetoothAdapterChromeOS* adapter); |
| 35 | 37 |
| 36 // device::BluetoothAudioSink overrides. | 38 // device::BluetoothAudioSink overrides. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 private: | 83 private: |
| 82 ~BluetoothAudioSinkChromeOS() override; | 84 ~BluetoothAudioSinkChromeOS() override; |
| 83 | 85 |
| 84 // Called when the state property of BluetoothMediaTransport has been updated. | 86 // Called when the state property of BluetoothMediaTransport has been updated. |
| 85 void StateChanged(device::BluetoothAudioSink::State state); | 87 void StateChanged(device::BluetoothAudioSink::State state); |
| 86 | 88 |
| 87 // Called when the volume property of BluetoothMediaTransport has been | 89 // Called when the volume property of BluetoothMediaTransport has been |
| 88 // updated. | 90 // updated. |
| 89 void VolumeChanged(uint16_t volume); | 91 void VolumeChanged(uint16_t volume); |
| 90 | 92 |
| 93 // Called when the registration of Media Endpoint Done. | |
|
armansito
2015/01/27 04:38:06
s/Done/has succeeded/
Miao
2015/01/28 02:05:01
Done.
| |
| 94 void OnRegisterSucceeded(const base::Closure& callback); | |
| 95 | |
| 96 // Called when the registration of Media Endpoint failed. | |
| 97 void OnRegisterFailed(const BluetoothAudioSink::ErrorCallback& error_back, | |
| 98 const std::string& error_name, | |
| 99 const std::string& error_message); | |
| 100 | |
| 91 // Reads from the file descriptor acquired via Media Transport object and | 101 // Reads from the file descriptor acquired via Media Transport object and |
| 92 // notify |observer_| while the audio data is available. | 102 // notify |observer_| while the audio data is available. |
| 93 void ReadFromFD(); | 103 void ReadFromFD(); |
| 94 | 104 |
| 95 // The connection state between the BluetoothAudioSinkChromeOS and the remote | 105 // The connection state between the BluetoothAudioSinkChromeOS and the remote |
| 96 // device. | 106 // device. |
| 97 device::BluetoothAudioSink::State state_; | 107 device::BluetoothAudioSink::State state_; |
| 98 | 108 |
| 99 // Indicates whether the adapter is present. | 109 // Indicates whether the adapter is present. |
| 100 bool present_; | 110 bool present_; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 // Note: This should remain the last member so it'll be destroyed and | 151 // Note: This should remain the last member so it'll be destroyed and |
| 142 // invalidate its weak pointers before any other members are destroyed. | 152 // invalidate its weak pointers before any other members are destroyed. |
| 143 base::WeakPtrFactory<BluetoothAudioSinkChromeOS> weak_ptr_factory_; | 153 base::WeakPtrFactory<BluetoothAudioSinkChromeOS> weak_ptr_factory_; |
| 144 | 154 |
| 145 DISALLOW_COPY_AND_ASSIGN(BluetoothAudioSinkChromeOS); | 155 DISALLOW_COPY_AND_ASSIGN(BluetoothAudioSinkChromeOS); |
| 146 }; | 156 }; |
| 147 | 157 |
| 148 } // namespace chromeos | 158 } // namespace chromeos |
| 149 | 159 |
| 150 #endif // DEVICE_BLUETOOTH_BLUETOOTH_AUDIO_SINK_CHROMEOS_H_ | 160 #endif // DEVICE_BLUETOOTH_BLUETOOTH_AUDIO_SINK_CHROMEOS_H_ |
| OLD | NEW |