16 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_TEST_AVSCOMMON_UTILS_MEDIAPLAYER_MOCKMEDIAPLAYER_H_ 17 #define ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_TEST_AVSCOMMON_UTILS_MEDIAPLAYER_MOCKMEDIAPLAYER_H_ 19 #include <unordered_set> 32 namespace mediaPlayer {
52 std::shared_ptr<avsCommon::avs::attachment::AttachmentReader> attachmentReader,
84 static std::shared_ptr<testing::NiceMock<MockMediaPlayer>> create();
94 static void enableConcurrentMediaPlayers();
103 std::shared_ptr<avsCommon::avs::attachment::AttachmentReader> attachmentReader,
107 std::shared_ptr<avsCommon::avs::attachment::AttachmentReader> attachmentReader,
108 std::chrono::milliseconds offsetAdjustment,
113 std::chrono::milliseconds offset = std::chrono::milliseconds::zero(),
118 std::shared_ptr<std::istream> stream,
122 void addObserver(std::shared_ptr<observer> playerObserver) ;
149 std::shared_ptr<avsCommon::avs::attachment::AttachmentReader> attachmentReader,
193 bool mockStop2(
SourceId sourceId, std::chrono::seconds closePipleineTime);
200 bool mockFinished(
SourceId sourceId);
212 bool mockSetOffset(
SourceId sourceId, std::chrono::milliseconds offset);
217 std::chrono::milliseconds mockGetOffset(
SourceId id);
229 bool mockSeek(
SourceId sourceId, std::chrono::milliseconds location,
bool fromStart);
235 void resetWaitTimer();
245 bool waitUntilNextSetSource(
const std::chrono::milliseconds timeout = std::chrono::milliseconds(DEFAULT_TIME));
254 bool waitUntilPlaybackStarted(
const std::chrono::milliseconds timeout = std::chrono::milliseconds(DEFAULT_TIME));
262 bool waitUntilPlaybackStarted(
264 const std::chrono::milliseconds timeout = std::chrono::milliseconds(DEFAULT_TIME));
272 bool waitUntilPlaybackPaused(
const std::chrono::milliseconds timeout = std::chrono::milliseconds(DEFAULT_TIME));
280 bool waitUntilPlaybackResumed(
const std::chrono::milliseconds timeout = std::chrono::milliseconds(DEFAULT_TIME));
288 bool waitUntilPlaybackStopped(
const std::chrono::milliseconds timeout = std::chrono::milliseconds(DEFAULT_TIME));
296 bool waitUntilPlaybackFinished(
const std::chrono::milliseconds timeout = std::chrono::milliseconds(DEFAULT_TIME));
304 bool waitUntilPlaybackError(
const std::chrono::milliseconds timeout = std::chrono::milliseconds(DEFAULT_TIME));
312 bool waitUntilSeeked(
const std::chrono::milliseconds timeout = std::chrono::milliseconds(DEFAULT_TIME));
340 std::unordered_set<std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface>> getObservers()
381 bool wait(std::chrono::milliseconds timeout);
386 void resetStateReached();
397 const std::unordered_set<std::shared_ptr<MediaPlayerObserverInterface>>&
observer,
398 std::chrono::milliseconds timeout,
417 std::condition_variable m_wake;
420 std::thread m_thread;
446 std::chrono::milliseconds offset;
461 SourceState finished;
464 SourceState seekComplete;
479 std::shared_ptr<Source> getCurrentSource(
SourceId sourceId);
487 std::shared_ptr<Source> getPreviousSource(
SourceId sourceId);
495 bool isValidSourceId(
SourceId sourceId);
498 mutable std::mutex m_mutex;
501 static std::mutex m_globalMutex;
504 static std::vector<std::shared_ptr<Source>> m_sources;
507 static std::atomic<SourceId> m_currentSourceId;
513 static bool m_isConcurrentEnabled;
516 std::unordered_set<std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface>> m_playerObservers;
525 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_TEST_AVSCOMMON_UTILS_MEDIAPLAYER_MOCKMEDIAPLAYER_H_
#define MOCK_METHOD3(m,...)
Definition: gmock-generated-function-mockers.h:678
Definition: PlaybackContext.h:35
Definition: AmdMetricWrapperTest.cpp:24
::std::string string
Definition: gtest-port.h:1097
Definition: RequiresShutdown.h:32
#define MOCK_METHOD2(m,...)
Definition: gmock-generated-function-mockers.h:677
MediaType
Definition: MediaType.h:29
SLresult mockGetState(SLAndroidSimpleBufferQueueItf self, SLAndroidSimpleBufferQueueState *pState)
Definition: AndroidSLESBufferQueueTest.cpp:146
Definition: Optional.h:32
Definition: Stopwatch.h:31
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Audio data type not known.
#define MOCK_METHOD0(m,...)
Definition: gmock-generated-function-mockers.h:675
avsCommon::utils::mediaPlayer::MediaPlayerState MediaPlayerState
Definition: RendererTest.cpp:38
#define MOCK_METHOD1(m,...)
Definition: gmock-generated-function-mockers.h:676