AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerFactoryInterface Class Referenceabstract

#include <MediaPlayerFactoryInterface.h>

Inheritance diagram for alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerFactoryInterface:
Inheritance graph
[legend]

Public Member Functions

virtual ~MediaPlayerFactoryInterface ()=default
 
virtual Fingerprint getFingerprint ()=0
 
virtual std::shared_ptr< MediaPlayerInterfaceacquireMediaPlayer ()=0
 
virtual bool releaseMediaPlayer (std::shared_ptr< MediaPlayerInterface > mediaPlayer)=0
 
virtual bool isMediaPlayerAvailable ()=0
 
virtual void addObserver (std::shared_ptr< MediaPlayerFactoryObserverInterface > observer)=0
 
virtual void removeObserver (std::shared_ptr< MediaPlayerFactoryObserverInterface > observer)=0
 

Detailed Description

A MediaPlayerFactoryInterface allows access to MediaPlayerInterface instances as needed (and if available). This is a capability needed to support pre-buffering.

Deprecated:
Use PooledMediaResourceProviderInterface instead.

Instances are not expected to be Thread-safe.

Constructor & Destructor Documentation

◆ ~MediaPlayerFactoryInterface()

virtual alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerFactoryInterface::~MediaPlayerFactoryInterface ( )
virtualdefault

Destructor.

Member Function Documentation

◆ acquireMediaPlayer()

virtual std::shared_ptr<MediaPlayerInterface> alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerFactoryInterface::acquireMediaPlayer ( )
pure virtual

Acquire an instance of a MediaPlayerInterface, if available.

Returns
an instance of of MediaPlayerInterface, or nullptr if none available.

Implemented in alexaClientSDK::avsCommon::utils::mediaPlayer::PooledMediaResourceProvider, and alexaClientSDK::mediaPlayer::PooledMediaPlayerFactory.

◆ addObserver()

virtual void alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerFactoryInterface::addObserver ( std::shared_ptr< MediaPlayerFactoryObserverInterface observer)
pure virtual

Register an MediaPlayerFactoryObserverInterface to this Factory.

Parameters
observerThe MediaPlayerFactoryObserverInterface instance to add

◆ getFingerprint()

virtual Fingerprint alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerFactoryInterface::getFingerprint ( )
pure virtual

◆ isMediaPlayerAvailable()

virtual bool alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerFactoryInterface::isMediaPlayerAvailable ( )
pure virtual

Returns true if a MediaPlayerInterface instance is available (i.e. if a call to acquireMediaPlayer would return a valid Player) The return value is valid until the next call to acquireMediaPlayer() or releaseMediaPlayer()

Returns
true if a MediaPlayerInterface instance is available.

Implemented in alexaClientSDK::avsCommon::utils::mediaPlayer::PooledMediaResourceProvider, and alexaClientSDK::mediaPlayer::PooledMediaPlayerFactory.

◆ releaseMediaPlayer()

virtual bool alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerFactoryInterface::releaseMediaPlayer ( std::shared_ptr< MediaPlayerInterface mediaPlayer)
pure virtual

Return a MediaPlayerInterface instance to the Factory. This MUST be an instance acquired from acquireMediaPlayer in this Factory. See MediaPlayerFactoryObserverInterface::onReadyToProvideNextPlayer()

Parameters
mediaPlayeran instance of of MediaPlayerInterface returned from a call to acquireMediaPlayer
Returns
true for success, false if mediaPlayer is empty or not acquired from this Factory

◆ removeObserver()

virtual void alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerFactoryInterface::removeObserver ( std::shared_ptr< MediaPlayerFactoryObserverInterface observer)
pure virtual

Unregister an MediaPlayerFactoryObserverInterface to this Factory.

Parameters
observerThe MediaPlayerFactoryObserverInterface instance to remove

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