|
| TestMediaPlayer () |
|
bool | play (SourceId id) override |
|
bool | stop (SourceId id) override |
|
SourceId | setSource (const std::string &url, std::chrono::milliseconds offset=std::chrono::milliseconds::zero(), 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, const avsCommon::utils::mediaPlayer::SourceConfig &config, avsCommon::utils::MediaType format) override |
|
SourceId | setSource (std::shared_ptr< avsCommon::avs::attachment::AttachmentReader > attachmentReader, const avsCommon::utils::AudioFormat *audioFormat, const avsCommon::utils::mediaPlayer::SourceConfig &config) override |
|
void | setSourceRetVal (SourceId sourceRetVal) |
|
void | setPlayRetVal (bool playRetVal) |
|
void | setStopRetVal (bool stopRetVal) |
|
std::pair< bool, avsCommon::utils::mediaPlayer::SourceConfig > | waitForSourceConfig (std::chrono::milliseconds timeout) |
|
| MockMediaPlayer () |
|
| MOCK_METHOD1 (play, bool(SourceId)) |
|
| MOCK_METHOD1 (pause, bool(SourceId)) |
|
| MOCK_METHOD1 (resume, bool(SourceId)) |
|
| MOCK_METHOD3 (seekTo, bool(SourceId, std::chrono::milliseconds location, bool fromStart)) |
|
| MOCK_METHOD1 (stop, bool(SourceId)) |
|
| MOCK_METHOD2 (stop, bool(SourceId, std::chrono::seconds)) |
|
| MOCK_METHOD1 (getOffset, std::chrono::milliseconds(SourceId)) |
|
| MOCK_METHOD0 (getNumBytesBuffered, uint64_t()) |
|
| MOCK_METHOD1 (getMediaPlayerState, avsCommon::utils::Optional< avsCommon::utils::mediaPlayer::MediaPlayerState >(SourceId)) |
|
| MOCK_METHOD0 (getPlaybackAttributes, avsCommon::utils::Optional< PlaybackAttributes >()) |
|
| MOCK_METHOD0 (getPlaybackReports, std::vector< PlaybackReport >()) |
|
| MOCK_METHOD0 (getFingerprint, Optional< Fingerprint >()) |
|
| MOCK_METHOD2 (attachmentSetSource, SourceId(std::shared_ptr< avsCommon::avs::attachment::AttachmentReader > attachmentReader, const avsCommon::utils::AudioFormat *audioFormat)) |
|
| MOCK_METHOD2 (streamSetSource, SourceId(std::shared_ptr< std::istream > stream, bool repeat)) |
|
| MOCK_METHOD1 (urlSetSource, SourceId(const std::string &url)) |
|
SourceId | mockSetSource () |
|
bool | mockPlay (SourceId sourceId) |
|
bool | mockPause (SourceId sourceId) |
|
bool | mockResume (SourceId sourceId) |
|
bool | mockStop (SourceId sourceId) |
|
bool | mockStop2 (SourceId sourceId, std::chrono::seconds closePipleineTime) |
|
bool | mockFinished (SourceId sourceId) |
|
bool | mockError (SourceId sourceId) |
|
bool | mockSetOffset (SourceId sourceId, std::chrono::milliseconds offset) |
|
std::chrono::milliseconds | mockGetOffset (SourceId id) |
|
avsCommon::utils::Optional< avsCommon::utils::mediaPlayer::MediaPlayerState > | mockGetState (SourceId id) |
|
bool | mockSeek (SourceId sourceId, std::chrono::milliseconds location, bool fromStart) |
|
void | resetWaitTimer () |
|
bool | waitUntilNextSetSource (const std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_TIME)) |
|
bool | waitUntilPlaybackStarted (const std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_TIME)) |
|
bool | waitUntilPlaybackStarted (SourceId id, const std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_TIME)) |
|
bool | waitUntilPlaybackPaused (const std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_TIME)) |
|
bool | waitUntilPlaybackResumed (const std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_TIME)) |
|
bool | waitUntilPlaybackStopped (const std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_TIME)) |
|
bool | waitUntilPlaybackFinished (const std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_TIME)) |
|
bool | waitUntilPlaybackError (const std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_TIME)) |
|
bool | waitUntilSeeked (const std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_TIME)) |
|
SourceId | getCurrentSourceId () |
|
SourceId | getSourceId () |
|
SourceId | getLatestSourceId () |
|
std::unordered_set< std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface > > | getObservers () const |
|
SourceId | setSource (std::shared_ptr< avsCommon::avs::attachment::AttachmentReader > attachmentReader, const avsCommon::utils::AudioFormat *audioFormat=nullptr, const SourceConfig &config=emptySourceConfig()) |
|
SourceId | setSource (std::shared_ptr< avsCommon::avs::attachment::AttachmentReader > attachmentReader, std::chrono::milliseconds offsetAdjustment, const avsCommon::utils::AudioFormat *audioFormat=nullptr, const SourceConfig &config=emptySourceConfig()) |
|
void | addObserver (std::shared_ptr< observer > playerObserver) |
|
void | removeObserver (std::shared_ptr< observer > playerObserver) |
|
void | doShutdown () |
|
virtual SourceId | attachmentSetSource (std::shared_ptr< avsCommon::avs::attachment::AttachmentReader > attachmentReader, const avsCommon::utils::AudioFormat *audioFormat)=0 |
|
virtual SourceId | streamSetSource (std::shared_ptr< std::istream > stream, bool repeat)=0 |
|
virtual SourceId | urlSetSource (const std::string &url)=0 |
|
virtual | ~MediaPlayerInterface ()=default |
|
virtual bool | stop (SourceId id, std::chrono::seconds timeToPipelineShutdown) |
|
virtual bool | pause (SourceId id)=0 |
|
virtual bool | resume (SourceId id)=0 |
|
virtual bool | seekTo (SourceId id, std::chrono::milliseconds location, bool fromStart) |
|
virtual std::chrono::milliseconds | getOffset (SourceId id)=0 |
|
virtual uint64_t | getNumBytesBuffered ()=0 |
|
virtual utils::Optional< avsCommon::utils::mediaPlayer::MediaPlayerState > | getMediaPlayerState (SourceId id)=0 |
|
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 () |
|
| RequiresShutdown (const std::string &name) |
|
virtual | ~RequiresShutdown () |
| Destructor. More...
|
|
const std::string & | name () const |
|
void | shutdown () |
|
bool | isShutdown () const |
|
bool alexaClientSDK::acsdkAlerts::renderer::test::TestMediaPlayer::stop |
( |
SourceId |
id | ) |
|
|
inlineoverridevirtual |
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.