AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Namespaces | Macros | Typedefs | Functions | Variables
AndroidSLESMediaPlayerTest.cpp File Reference
#include <algorithm>
#include <fstream>
#include <memory>
#include <thread>
#include <tuple>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <AVSCommon/AVS/Attachment/AttachmentWriter.h>
#include <AVSCommon/AVS/Attachment/InProcessAttachment.h>
#include <AVSCommon/Utils/LibcurlUtils/HTTPContentFetcherFactory.h>
#include <AVSCommon/Utils/Logger/LoggerSinkManager.h>
#include <AVSCommon/Utils/MediaPlayer/MediaPlayerObserverInterface.h>
#include <AndroidSLESMediaPlayer/AndroidSLESMediaPlayer.h>
#include <AndroidSLESMediaPlayer/FFmpegDecoder.h>
#include <AndroidUtilities/AndroidLogger.h>
#include <AndroidUtilities/AndroidSLESEngine.h>
#include <Audio/Data/med_alerts_notification_01.mp3.h>
#include <Audio/Data/med_system_alerts_melodic_01_short.wav.h>
Include dependency graph for AndroidSLESMediaPlayerTest.cpp:

Classes

class  alexaClientSDK::mediaPlayer::android::test::MockAttachmentReader
 This class mocks an attachment reader that reads from the INPUT_CSTR. More...
 
class  alexaClientSDK::mediaPlayer::android::test::WaitEvent
 Class that can be used to wait for an event. More...
 
class  alexaClientSDK::mediaPlayer::android::test::MockContentFetcherFactory
 Mocks the content fetcher factory. More...
 
class  alexaClientSDK::mediaPlayer::android::test::MockObserver
 Mocks the media player observer. More...
 
class  alexaClientSDK::mediaPlayer::android::test::AndroidSLESMediaPlayerTest
 

Namespaces

 alexaClientSDK
 Whether or not curl logs should be emitted.
 
 alexaClientSDK::mediaPlayer
 
 alexaClientSDK::mediaPlayer::android
 
 alexaClientSDK::mediaPlayer::android::test
 

Macros

#define TAG   "AndroidSLESMediaPlayerTest"
 String to identify log entries originating from this file. More...
 
#define LX(event)   alexaClientSDK::avsCommon::utils::logger::LogEntry(TAG, event)
 

Typedefs

using alexaClientSDK::mediaPlayer::android::test::MediaPlayerState = avsCommon::utils::mediaPlayer::MediaPlayerState
 

Functions

 alexaClientSDK::mediaPlayer::android::test::TEST_F (AndroidSLESMediaPlayerTest, test_createNullFactory)
 Test create with null factory. More...
 
 alexaClientSDK::mediaPlayer::android::test::TEST_F (AndroidSLESMediaPlayerTest, test_createNullEngine)
 Test create with null engine. More...
 
 alexaClientSDK::mediaPlayer::android::test::TEST_F (AndroidSLESMediaPlayerTest, test_bQMediaPlayer)
 Test buffer queue with media player. More...
 
 alexaClientSDK::mediaPlayer::android::test::TEST_F (AndroidSLESMediaPlayerTest, test_bQRawMediaPlayer)
 Test buffer queue with media player and raw file. More...
 
 alexaClientSDK::mediaPlayer::android::test::TEST_F (AndroidSLESMediaPlayerTest, test_firstReadTimeout)
 Test that media is played correct even if a timeout happens in the first read. More...
 
 alexaClientSDK::mediaPlayer::android::test::TEST_F (AndroidSLESMediaPlayerTest, test_initializeTimeout)
 Test that media is played correct even after a timeout during initialization. More...
 
 alexaClientSDK::mediaPlayer::android::test::TEST_F (AndroidSLESMediaPlayerTest, test_decodingTimeout)
 Test that media is played correct even after a timeout during decoding. More...
 
 alexaClientSDK::mediaPlayer::android::test::TEST_F (AndroidSLESMediaPlayerTest, test_streamMediaPlayer)
 Test media player and istream source. More...
 
 alexaClientSDK::mediaPlayer::android::test::TEST_F (AndroidSLESMediaPlayerTest, test_streamRepeatMediaPlayer)
 Test media player, istream source and repeat on. More...
 
 alexaClientSDK::mediaPlayer::android::test::TEST_F (AndroidSLESMediaPlayerTest, test_resumeMediaPlayer)
 Test media player pause / resume. More...
 
 alexaClientSDK::mediaPlayer::android::test::TEST_F (AndroidSLESMediaPlayerTest, test_playFailed)
 Test play fails with wrong id. More...
 
 alexaClientSDK::mediaPlayer::android::test::TEST_F (AndroidSLESMediaPlayerTest, test_pauseFailed)
 Test pause fails with wrong id. More...
 
 alexaClientSDK::mediaPlayer::android::test::TEST_F (AndroidSLESMediaPlayerTest, test_pauseFailedNotPlaying)
 Test pause fails if not playing. More...
 
 alexaClientSDK::mediaPlayer::android::test::TEST_F (AndroidSLESMediaPlayerTest, test_resumeFailedAfterStop)
 Test resume fails after stop. More...
 
 alexaClientSDK::mediaPlayer::android::test::TEST_F (AndroidSLESMediaPlayerTest, test_stopFailed)
 Test stop fails with wrong id. More...
 
 alexaClientSDK::mediaPlayer::android::test::TEST_F (AndroidSLESMediaPlayerTest, test_getOffset)
 Test get offset. More...
 

Variables

static constexpr size_t alexaClientSDK::mediaPlayer::android::test::MP3_INPUT_SIZE
 The size of the input buffer. More...
 
static const auto alexaClientSDK::mediaPlayer::android::test::MP3_INPUT_CSTR = applicationUtilities::resources::audio::data::med_alerts_notification_01_mp3
 An input buffer with an mp3 file. More...
 
static const std::chrono::milliseconds alexaClientSDK::mediaPlayer::android::test::MP3_INPUT_DURATION {1440}
 The mp3 duration in milliseconds. More...
 
static const alexaClientSDK::avsCommon::utils::MediaType alexaClientSDK::mediaPlayer::android::test::MP3_TYPE = alexaClientSDK::avsCommon::utils::MediaType::MPEG
 The mp3 MediaType. More...
 
static const SourceConfig alexaClientSDK::mediaPlayer::android::test::EMPTY_CONFIG = emptySourceConfig()
 The source config. More...
 
static const size_t alexaClientSDK::mediaPlayer::android::test::RAW_INPUT_SIZE
 The size of the input buffer. More...
 
static const auto alexaClientSDK::mediaPlayer::android::test::RAW_INPUT_CSTR = applicationUtilities::resources::audio::data::med_system_alerts_melodic_01_short_wav
 An input buffer with an mp3 file. More...
 
static const std::chrono::milliseconds alexaClientSDK::mediaPlayer::android::test::RAW_INPUT_DURATION {2177}
 The raw input duration in milli seconds. More...
 
static const MediaPlayerState alexaClientSDK::mediaPlayer::android::test::DEFAULT_MEDIA_PLAYER_STATE = {std::chrono::milliseconds(0)}
 Default media player state for reporting all playback offsets. More...
 
static const MediaPlayerState alexaClientSDK::mediaPlayer::android::test::MP3_INPUT_FINISHED_MEDIA_PLAYER_STATE = {MP3_INPUT_DURATION}
 The finished media player state. More...
 

Macro Definition Documentation

◆ LX

#define LX (   event)    alexaClientSDK::avsCommon::utils::logger::LogEntry(TAG, event)

Create a LogEntry using this file's TAG and the specified event string.

Parameters
Theevent string for this LogEntry.

◆ TAG

#define TAG   "AndroidSLESMediaPlayerTest"

String to identify log entries originating from this 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