AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <MediaEndpoint.h>
Public Member Functions | |
MediaEndpoint (std::shared_ptr< DBusConnection > connection, const std::string &endpointPath) | |
~MediaEndpoint () override | |
void | onSetConfiguration (GVariant *arguments, GDBusMethodInvocation *invocation) |
void | onSelectConfiguration (GVariant *arguments, GDBusMethodInvocation *invocation) |
void | onClearConfiguration (GVariant *arguments, GDBusMethodInvocation *invocation) |
void | onRelease (GVariant *arguments, GDBusMethodInvocation *invocation) |
void | onMediaTransportStateChanged (avsCommon::utils::bluetooth::MediaStreamingState newState, const std::string &devicePath) |
std::string | getEndpointPath () const |
std::string | getStreamingDevicePath () const |
std::shared_ptr< avsCommon::utils::bluetooth::FormattedAudioStreamAdapter > | getAudioStream () |
Public Member Functions inherited from alexaClientSDK::bluetoothImplementations::blueZ::DBusObject< MediaEndpoint > | |
virtual | ~DBusObject ()=default |
Public Member Functions inherited from alexaClientSDK::bluetoothImplementations::blueZ::DBusObjectBase | |
virtual | ~DBusObjectBase () |
bool | registerWithDBus () |
void | unregisterObject () |
Additional Inherited Members | |
Public Types inherited from alexaClientSDK::bluetoothImplementations::blueZ::DBusObject< MediaEndpoint > | |
using | commandHandler_t = void(MediaEndpoint ::*)(GVariant *parameters, GDBusMethodInvocation *invocation) |
Protected Member Functions inherited from alexaClientSDK::bluetoothImplementations::blueZ::DBusObject< MediaEndpoint > | |
DBusObject (std::shared_ptr< DBusConnection > connection, std::string xmlInterfaceIntrospection, std::string objectPath, std::unordered_map< std::string, commandHandler_t > methodMap) | |
Protected Member Functions inherited from alexaClientSDK::bluetoothImplementations::blueZ::DBusObjectBase | |
DBusObjectBase (std::shared_ptr< DBusConnection > connection, const std::string &xmlInterfaceIntrospection, const std::string &objectPath, GDBusInterfaceMethodCallFunc methodCallFunc) | |
void | onMethodCalledInternal (const char *methodName) |
A DBus object implementing the MediaEndpoint1 interface of BlueZ. Registering it with DBus allows BlueZ to use it for audio streaming using A2DP. This particular endpoint implements the SINK case, where remote bluetooth device is streaming audio to our SDK.
alexaClientSDK::bluetoothImplementations::blueZ::MediaEndpoint::MediaEndpoint | ( | std::shared_ptr< DBusConnection > | connection, |
const std::string & | endpointPath | ||
) |
Constructor inherited from DBusObject
base class. Prepares a DBus object for registration.
connection | DBus connection to register object with. |
endpointPath | Object path to register object to. |
|
override |
Destructor
std::shared_ptr<avsCommon::utils::bluetooth::FormattedAudioStreamAdapter> alexaClientSDK::bluetoothImplementations::blueZ::MediaEndpoint::getAudioStream | ( | ) |
Get the FormattedAudioStreamAdapter
for the audio stream being received from the remote bluetooth device over A2DP. It is safe to call this method early.
FormattedAudioStreamAdapter
object used by MediaEndpoint
. std::string alexaClientSDK::bluetoothImplementations::blueZ::MediaEndpoint::getEndpointPath | ( | ) | const |
Get DBus object path of the media endpoint
std::string alexaClientSDK::bluetoothImplementations::blueZ::MediaEndpoint::getStreamingDevicePath | ( | ) | const |
Get DBus object path of the device the BlueZ currently uses this media endpoint with for streaming.
void alexaClientSDK::bluetoothImplementations::blueZ::MediaEndpoint::onClearConfiguration | ( | GVariant * | arguments, |
GDBusMethodInvocation * | invocation | ||
) |
A callback called by BlueZ to notify MediaEndpoint that it should reset the codec configuration.
arguments | Null |
invocation | DBus method invocation object used to report execution result. |
void alexaClientSDK::bluetoothImplementations::blueZ::MediaEndpoint::onMediaTransportStateChanged | ( | avsCommon::utils::bluetooth::MediaStreamingState | newState, |
const std::string & | devicePath | ||
) |
A callback called by DeviceManager
to notify MediaEndpoint that BlueZ reported a streaming state change.
newState | A new MediaStreamingState reported by DBus. |
devicePath | DBus object path of the device reporting the state change. |
void alexaClientSDK::bluetoothImplementations::blueZ::MediaEndpoint::onRelease | ( | GVariant * | arguments, |
GDBusMethodInvocation * | invocation | ||
) |
A callback called by BlueZ to notify MediaEndpoint that it is being release and will not be used anymore.
arguments | Null |
invocation | DBus method invocation object used to report execution result. |
void alexaClientSDK::bluetoothImplementations::blueZ::MediaEndpoint::onSelectConfiguration | ( | GVariant * | arguments, |
GDBusMethodInvocation * | invocation | ||
) |
A callback called by BlueZ to asking MediaEndpoint to select the audio code configuration to use for the audio streaming. BlueZ expects this method to return a variant containing the selected configuration. This configuration will then be provided to the onSetConfiguration
callback
arguments | Variant containing the available codec configurations. For SBC this is a 4 byte bitmask. |
invocation | DBus method invocation object used to report execution result. |
void alexaClientSDK::bluetoothImplementations::blueZ::MediaEndpoint::onSetConfiguration | ( | GVariant * | arguments, |
GDBusMethodInvocation * | invocation | ||
) |
A callback called by BlueZ to notify MediaEndpoint of the stream codec configuration selected by both sides.
arguments | Variant containing the codec configuration bytes (4 bytes for SBC) |
invocation | DBus method invocation object used to report execution result. |
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0