AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::bluetoothImplementations::blueZ::MediaEndpoint Class Reference

#include <MediaEndpoint.h>

Inheritance diagram for alexaClientSDK::bluetoothImplementations::blueZ::MediaEndpoint:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::bluetoothImplementations::blueZ::MediaEndpoint:
Collaboration graph
[legend]

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::FormattedAudioStreamAdaptergetAudioStream ()
 
- 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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MediaEndpoint()

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.

Parameters
connectionDBus connection to register object with.
endpointPathObject path to register object to.

◆ ~MediaEndpoint()

alexaClientSDK::bluetoothImplementations::blueZ::MediaEndpoint::~MediaEndpoint ( )
override

Destructor

Member Function Documentation

◆ getAudioStream()

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.

Returns
An FormattedAudioStreamAdapter object used by MediaEndpoint.

◆ getEndpointPath()

std::string alexaClientSDK::bluetoothImplementations::blueZ::MediaEndpoint::getEndpointPath ( ) const

Get DBus object path of the media endpoint

Returns
Object path of the media endpoint

◆ getStreamingDevicePath()

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.

Returns
Device object path.

◆ onClearConfiguration()

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.

Parameters
argumentsNull
invocationDBus method invocation object used to report execution result.

◆ onMediaTransportStateChanged()

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.

Parameters
newStateA new MediaStreamingState reported by DBus.
devicePathDBus object path of the device reporting the state change.

◆ onRelease()

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.

Parameters
argumentsNull
invocationDBus method invocation object used to report execution result.

◆ onSelectConfiguration()

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

Parameters
argumentsVariant containing the available codec configurations. For SBC this is a 4 byte bitmask.
invocationDBus method invocation object used to report execution result.

◆ onSetConfiguration()

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.

Parameters
argumentsVariant containing the codec configuration bytes (4 bytes for SBC)
invocationDBus method invocation object used to report execution result.

The documentation for this class was generated from the following file:

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0