|
void | onPrefetchStatusChange (SLuint32 event) |
|
| ~AndroidSLESMediaPlayer () |
|
std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface > | getSpeaker () |
|
|
void | setEqualizerBandLevels (acsdkEqualizerInterfaces::EqualizerBandLevelMap bandLevelMap) override |
|
int | getMinimumBandLevel () override |
|
int | getMaximumBandLevel () override |
|
|
|
SourceId | setSource (std::shared_ptr< avsCommon::avs::attachment::AttachmentReader > attachmentReader, const avsCommon::utils::AudioFormat *format=nullptr, const avsCommon::utils::mediaPlayer::SourceConfig &config=avsCommon::utils::mediaPlayer::emptySourceConfig()) override |
|
SourceId | setSource (std::shared_ptr< avsCommon::avs::attachment::AttachmentReader > attachmentReader, std::chrono::milliseconds offsetAdjustment, const avsCommon::utils::AudioFormat *format=nullptr, const avsCommon::utils::mediaPlayer::SourceConfig &config=avsCommon::utils::mediaPlayer::emptySourceConfig()) override |
|
SourceId | setSource (const std::string &url, std::chrono::milliseconds offset, const avsCommon::utils::mediaPlayer::SourceConfig &config=avsCommon::utils::mediaPlayer::emptySourceConfig(), bool repeat=false, const avsCommon::utils::mediaPlayer::PlaybackContext &playbackContext=avsCommon::utils::mediaPlayer::PlaybackContext()) override |
|
SourceId | setSource (std::shared_ptr< std::istream > stream, bool repeat=false, const avsCommon::utils::mediaPlayer::SourceConfig &config=avsCommon::utils::mediaPlayer::emptySourceConfig(), avsCommon::utils::MediaType format=avsCommon::utils::MediaType::UNKNOWN) override |
|
bool | play (SourceId id) override |
|
bool | stop (SourceId id) override |
|
bool | pause (SourceId id) override |
|
bool | resume (SourceId id) override |
|
std::chrono::milliseconds | getOffset (SourceId id) override |
|
uint64_t | getNumBytesBuffered () override |
|
avsCommon::utils::Optional< avsCommon::utils::mediaPlayer::MediaPlayerState > | getMediaPlayerState (SourceId id) override |
|
void | addObserver (std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface > playerObserver) override |
|
void | removeObserver (std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface > playerObserver) override |
|
virtual | ~MediaPlayerInterface ()=default |
|
virtual SourceId | setSource (std::shared_ptr< avsCommon::avs::attachment::AttachmentReader > attachmentReader, const avsCommon::utils::AudioFormat *format=nullptr, const SourceConfig &config=emptySourceConfig())=0 |
|
virtual SourceId | setSource (std::shared_ptr< avsCommon::avs::attachment::AttachmentReader > attachmentReader, std::chrono::milliseconds offsetAdjustment, const avsCommon::utils::AudioFormat *format=nullptr, const SourceConfig &config=emptySourceConfig())=0 |
|
virtual bool | stop (SourceId id, std::chrono::seconds timeToPipelineShutdown) |
|
virtual bool | seekTo (SourceId id, std::chrono::milliseconds location, bool fromStart) |
|
virtual void | addObserver (std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface > playerObserver)=0 |
|
virtual void | removeObserver (std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface > playerObserver)=0 |
|
virtual utils::Optional< PlaybackAttributes > | getPlaybackAttributes () |
|
virtual std::vector< PlaybackReport > | getPlaybackReports () |
|
virtual utils::Optional< Fingerprint > | getFingerprint () |
|
virtual | ~EqualizerInterface ()=default |
|
| RequiresShutdown (const std::string &name) |
|
virtual | ~RequiresShutdown () |
| Destructor. More...
|
|
const std::string & | name () const |
|
void | shutdown () |
|
bool | isShutdown () const |
|
This class implements an android compatible media player.
The implementation uses Android OpenSL ES to play the audio and FFmpeg to decode and resample the media input.
bool alexaClientSDK::mediaPlayer::android::AndroidSLESMediaPlayer::pause |
( |
SourceId |
id | ) |
|
|
overridevirtual |
Pauses playing audio specified by the setSource()
call.
The source must be set before issuing pause()
. If pause()
is called
- without making a
setSource()
, false
will be returned.
- when audio is not starting/resuming/playing,
false
will be returned.
- when a play() or resume() call has already been made, but no callback has been issued yet for those functions, the audio stream will pause without playing any audio. Implementations must call both
MediaPlayerObserverInterface::onPlaybackStarted()
/ MediaPlayerObserverInterface::onPlaybackResumed
and MediaPlayerObserverInterface::onPlaybackPaused()
in this scenario, as both the play()
/ resume()
and the pause()
are required to have corresponding callbacks.
If the id does not match the id of the active source, then false
will be returned. If the pause()
succeeded, true
will be returned. When true
is returned, a callback will be made to either MediaPlayerObserverInterface::onPlaybackPaused()
or to MediaPlayerObserverInterface::onPlaybackError()
.
- Parameters
-
id | The unique id of the source on which to operate. |
- Returns
true
if the call succeeded, in which case a callback will be made, or false
otherwise.
Implements alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerInterface.
bool alexaClientSDK::mediaPlayer::android::AndroidSLESMediaPlayer::play |
( |
SourceId |
id | ) |
|
|
overridevirtual |
Starts playing audio specified by the setSource()
call.
The source must be set before issuing play()
.
If play()
is called
- without making a
setSource()
, false
will be returned.
- when audio is already playing,
false
will be returned.
- after a play() call has already been made but no callback or return code has been issued yet,
false
will be returned.
If the id does not match the id of the active source, then false
will be returned. If the play()
succeeded, true
will be returned. When true
is returned, a callback will be made to either MediaPlayerObserverInterface::onPlaybackStarted()
or to MediaPlayerObserverInterface::onPlaybackError()
.
- Parameters
-
id | The unique id of the source on which to operate. |
- Returns
true
if the call succeeded, in which case a callback will be made, or false
otherwise.
Implements alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerInterface.
bool alexaClientSDK::mediaPlayer::android::AndroidSLESMediaPlayer::resume |
( |
SourceId |
id | ) |
|
|
overridevirtual |
Resumes playing the paused audio specified by the setSource()
call.
The source must be set before issuing resume()
. If resume()
is called
- without making a
setSource()
, false
will be returned.
- when audio is already playing,
false
will be returned.
- when audio is not paused,
false
will be returned.
- after a resume() call has already been made but no callback or return code has been issued yet,
false
will be returned.
If the id does not match the id of the active source, then false
will be returned. If the resume()
succeeded, true
will be returned. When true
is returned, a callback will be made to either MediaPlayerObserverInterface::onPlaybackResumed()
or to MediaPlayerObserverInterface::onPlaybackError()
.
- Parameters
-
id | The unique id of the source on which to operate. |
- Returns
true
if the call succeeded, in which case a callback will be made, or false
otherwise.
Implements alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerInterface.
bool alexaClientSDK::mediaPlayer::android::AndroidSLESMediaPlayer::stop |
( |
SourceId |
id | ) |
|
|
overridevirtual |
Stops playing the audio specified by the setSource()
call.
The source must be set before issuing stop()
.
Once stop()
has been called, subsequent play()
calls will fail. If stop()
is called when audio has already stopped, false
will be returned. If the id does not match the id of the active source, then false
will be returned. If the stop()
succeeded, true
will be returned. When true
is returned, a callback will be made to either MediaPlayerObserverInterface::onPlaybackStopped()
or to MediaPlayerObserverInterface::onPlaybackError()
.
- Parameters
-
id | The unique id of the source on which to operate. |
- Returns
true
if the call succeeded, in which case a callback will be made, or false
otherwise.
Implements alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerInterface.