mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1102703: (8/10) Porting bluetooth interface of bluez 5.26 (a2dp) r=btian, f=tzimmermann
This commit is contained in:
parent
ab37e51ad8
commit
6d06d39873
@ -262,6 +262,52 @@ BluetoothDaemonA2dpModule::AudioStateNtf(
|
||||
AudioStateInitOp(aPDU));
|
||||
}
|
||||
|
||||
// Init operator class for AudioConfigNotification
|
||||
class BluetoothDaemonA2dpModule::AudioConfigInitOp MOZ_FINAL
|
||||
: private PDUInitOp
|
||||
{
|
||||
public:
|
||||
AudioConfigInitOp(BluetoothDaemonPDU& aPDU)
|
||||
: PDUInitOp(aPDU)
|
||||
{ }
|
||||
|
||||
nsresult
|
||||
operator () (nsString& aArg1, uint32_t aArg2, uint8_t aArg3) const
|
||||
{
|
||||
BluetoothDaemonPDU& pdu = GetPDU();
|
||||
|
||||
/* Read address */
|
||||
nsresult rv = UnpackPDU(
|
||||
pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg1));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* Read sample rate */
|
||||
rv = UnpackPDU(pdu, aArg2);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* Read channel count */
|
||||
rv = UnpackPDU(pdu, aArg3);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
WarnAboutTrailingData();
|
||||
return NS_OK;
|
||||
}
|
||||
};
|
||||
|
||||
void
|
||||
BluetoothDaemonA2dpModule::AudioConfigNtf(
|
||||
const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
|
||||
{
|
||||
AudioConfigNotification::Dispatch(
|
||||
&BluetoothA2dpNotificationHandler::AudioConfigNotification,
|
||||
AudioConfigInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonA2dpModule::HandleNtf(
|
||||
const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
|
||||
@ -271,6 +317,9 @@ BluetoothDaemonA2dpModule::HandleNtf(
|
||||
const BluetoothDaemonPDUHeader&, BluetoothDaemonPDU&) = {
|
||||
INIT_ARRAY_AT(0, &BluetoothDaemonA2dpModule::ConnectionStateNtf),
|
||||
INIT_ARRAY_AT(1, &BluetoothDaemonA2dpModule::AudioStateNtf),
|
||||
#if ANDROID_VERSION >= 21
|
||||
INIT_ARRAY_AT(2, &BluetoothDaemonA2dpModule::AudioConfigNtf),
|
||||
#endif
|
||||
};
|
||||
|
||||
MOZ_ASSERT(!NS_IsMainThread());
|
||||
|
@ -105,8 +105,14 @@ protected:
|
||||
const nsAString&>
|
||||
AudioStateNotification;
|
||||
|
||||
class AudioStateInitOp;
|
||||
typedef BluetoothNotificationRunnable3<NotificationHandlerWrapper, void,
|
||||
nsString, uint32_t, uint8_t,
|
||||
const nsAString&, uint32_t, uint8_t>
|
||||
AudioConfigNotification;
|
||||
|
||||
class ConnectionStateInitOp;
|
||||
class AudioStateInitOp;
|
||||
class AudioConfigInitOp;
|
||||
|
||||
void ConnectionStateNtf(const BluetoothDaemonPDUHeader& aHeader,
|
||||
BluetoothDaemonPDU& aPDU);
|
||||
@ -114,6 +120,9 @@ protected:
|
||||
void AudioStateNtf(const BluetoothDaemonPDUHeader& aHeader,
|
||||
BluetoothDaemonPDU& aPDU);
|
||||
|
||||
void AudioConfigNtf(const BluetoothDaemonPDUHeader& aHeader,
|
||||
BluetoothDaemonPDU& aPDU);
|
||||
|
||||
void HandleNtf(const BluetoothDaemonPDUHeader& aHeader,
|
||||
BluetoothDaemonPDU& aPDU,
|
||||
void* aUserData);
|
||||
|
Loading…
Reference in New Issue
Block a user