| 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 CHROMEOS_DBUS_BLUETOOTH_MEDIA_TRANSPORT_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_BLUETOOTH_MEDIA_TRANSPORT_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_BLUETOOTH_MEDIA_TRANSPORT_CLIENT_H_ | 6 #define CHROMEOS_DBUS_BLUETOOTH_MEDIA_TRANSPORT_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // from the system. | 66 // from the system. |
| 67 virtual void MediaTransportRemoved(const dbus::ObjectPath& object_path) {} | 67 virtual void MediaTransportRemoved(const dbus::ObjectPath& object_path) {} |
| 68 | 68 |
| 69 // Called when the Media Transport with object path |object_path| has | 69 // Called when the Media Transport with object path |object_path| has |
| 70 // a change in the value of the property with name |property_name|. | 70 // a change in the value of the property with name |property_name|. |
| 71 virtual void MediaTransportPropertyChanged( | 71 virtual void MediaTransportPropertyChanged( |
| 72 const dbus::ObjectPath& object_path, | 72 const dbus::ObjectPath& object_path, |
| 73 const std::string& property_name) {} | 73 const std::string& property_name) {} |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 // TODO(mcchou): Move all static constants to service_constants.h. |
| 77 // Constants used for the names of Media Transport's properties. |
| 78 static const char kDeviceProperty[]; |
| 79 static const char kUUIDProperty[]; |
| 80 static const char kCodecProperty[]; |
| 81 static const char kConfigurationProperty[]; |
| 82 static const char kStateProperty[]; |
| 83 static const char kDelayProperty[]; |
| 84 static const char kVolumeProperty[]; |
| 85 |
| 86 // All possible states of a valid media transport object. |
| 87 static const char kStateIdle[]; |
| 88 static const char kStatePending[]; |
| 89 static const char kStateActive[]; |
| 90 |
| 76 ~BluetoothMediaTransportClient() override; | 91 ~BluetoothMediaTransportClient() override; |
| 77 | 92 |
| 78 // The ErrorCallback is used by media transport API methods to indicate | 93 // The ErrorCallback is used by media transport API methods to indicate |
| 79 // failure. It receives two arguments: the name of the error in |error_name| | 94 // failure. It receives two arguments: the name of the error in |error_name| |
| 80 // and an optional message in |error_message|. | 95 // and an optional message in |error_message|. |
| 81 typedef base::Callback<void(const std::string& error_name, | 96 typedef base::Callback<void(const std::string& error_name, |
| 82 const std::string& error_message)> ErrorCallback; | 97 const std::string& error_message)> ErrorCallback; |
| 83 | 98 |
| 84 // The AcquireCallback is used by |Acquire| method of media tansport API tp | 99 // The AcquireCallback is used by |Acquire| method of media tansport API tp |
| 85 // indicate the success of the method. | 100 // indicate the success of the method. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 108 const AcquireCallback& callback, | 123 const AcquireCallback& callback, |
| 109 const ErrorCallback& error_callback) = 0; | 124 const ErrorCallback& error_callback) = 0; |
| 110 | 125 |
| 111 // Releases the file descriptor of the transport. | 126 // Releases the file descriptor of the transport. |
| 112 virtual void Release(const dbus::ObjectPath& object_path, | 127 virtual void Release(const dbus::ObjectPath& object_path, |
| 113 const base::Closure& callback, | 128 const base::Closure& callback, |
| 114 const ErrorCallback& error_callback) = 0; | 129 const ErrorCallback& error_callback) = 0; |
| 115 | 130 |
| 116 static BluetoothMediaTransportClient* Create(); | 131 static BluetoothMediaTransportClient* Create(); |
| 117 | 132 |
| 118 // Constants used to indicate exceptional error conditions. | |
| 119 static const char kNoResponseError[]; | |
| 120 static const char kUnexpectedResponse[]; | |
| 121 | |
| 122 protected: | 133 protected: |
| 123 BluetoothMediaTransportClient(); | 134 BluetoothMediaTransportClient(); |
| 124 | 135 |
| 125 private: | 136 private: |
| 126 DISALLOW_COPY_AND_ASSIGN(BluetoothMediaTransportClient); | 137 DISALLOW_COPY_AND_ASSIGN(BluetoothMediaTransportClient); |
| 127 }; | 138 }; |
| 128 | 139 |
| 129 } // namespace chromeos | 140 } // namespace chromeos |
| 130 | 141 |
| 131 #endif // CHROMEOS_DBUS_BLUETOOTH_MEDIA_TRANSPORT_CLIENT_H_ | 142 #endif // CHROMEOS_DBUS_BLUETOOTH_MEDIA_TRANSPORT_CLIENT_H_ |
| OLD | NEW |