AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Typedefs | Functions | Variables
alexaClientSDK::mediaPlayer::android::test Namespace Reference

Classes

class  AndroidSLESMediaPlayerTest
 
class  AndroidSLESMediaQueueTest
 
class  AndroidSLESSpeakerTest
 
class  FFmpegDecoderTest
 
class  FFmpegUrlInputControllerTest
 
class  MockAttachmentReader
 This class mocks an attachment reader that reads from the INPUT_CSTR. More...
 
class  MockCallback
 Mock status callback. More...
 
class  MockContentFetcherFactory
 Mocks the content fetcher factory. More...
 
class  MockDecoder
 Mock decoder. More...
 
class  MockEmptyAttachmentReader
 A mock AttachmentReader that mocks reading from an empty attachment (immediate EOF). More...
 
class  MockObserver
 Mocks the media player observer. More...
 
class  MockPlaylistParser
 
class  WaitEvent
 Class that can be used to wait for an event. More...
 

Typedefs

using MediaPlayerState = avsCommon::utils::mediaPlayer::MediaPlayerState
 
using MockSlSimpleBufferQueue = MockInterfaceImpl< SLAndroidSimpleBufferQueueItf_ >
 
using MockVolumeInterface = MockInterfaceImpl< SLVolumeItf_ >
 
using Byte = FFmpegDecoder::Byte
 

Functions

 TEST_F (AndroidSLESMediaPlayerTest, test_createNullFactory)
 Test create with null factory. More...
 
 TEST_F (AndroidSLESMediaPlayerTest, test_createNullEngine)
 Test create with null engine. More...
 
 TEST_F (AndroidSLESMediaPlayerTest, test_bQMediaPlayer)
 Test buffer queue with media player. More...
 
 TEST_F (AndroidSLESMediaPlayerTest, test_bQRawMediaPlayer)
 Test buffer queue with media player and raw file. More...
 
 TEST_F (AndroidSLESMediaPlayerTest, test_firstReadTimeout)
 Test that media is played correct even if a timeout happens in the first read. More...
 
 TEST_F (AndroidSLESMediaPlayerTest, test_initializeTimeout)
 Test that media is played correct even after a timeout during initialization. More...
 
 TEST_F (AndroidSLESMediaPlayerTest, test_decodingTimeout)
 Test that media is played correct even after a timeout during decoding. More...
 
 TEST_F (AndroidSLESMediaPlayerTest, test_streamMediaPlayer)
 Test media player and istream source. More...
 
 TEST_F (AndroidSLESMediaPlayerTest, test_streamRepeatMediaPlayer)
 Test media player, istream source and repeat on. More...
 
 TEST_F (AndroidSLESMediaPlayerTest, test_resumeMediaPlayer)
 Test media player pause / resume. More...
 
 TEST_F (AndroidSLESMediaPlayerTest, test_playFailed)
 Test play fails with wrong id. More...
 
 TEST_F (AndroidSLESMediaPlayerTest, test_pauseFailed)
 Test pause fails with wrong id. More...
 
 TEST_F (AndroidSLESMediaPlayerTest, test_pauseFailedNotPlaying)
 Test pause fails if not playing. More...
 
 TEST_F (AndroidSLESMediaPlayerTest, test_resumeFailedAfterStop)
 Test resume fails after stop. More...
 
 TEST_F (AndroidSLESMediaPlayerTest, test_stopFailed)
 Test stop fails with wrong id. More...
 
 TEST_F (AndroidSLESMediaPlayerTest, test_getOffset)
 Test get offset. More...
 
static const std::string MP3_FILE_PATH ("/fox_dog.mp3")
 MP3 test file path. More...
 
static SLresult mockRegisterCallbackOk (SLAndroidSimpleBufferQueueItf self, slAndroidSimpleBufferQueueCallback callback, void *pCallbackContext)
 Mock register callback succeeds. More...
 
static SLresult mockRegisterCallbackFailed (SLAndroidSimpleBufferQueueItf self, slAndroidSimpleBufferQueueCallback callback, void *pCallbackContext)
 Mock register callback fails. More...
 
static SLresult mockEnqueueOk (SLAndroidSimpleBufferQueueItf self, const void *pBuffer, SLuint32 size)
 Mock enqueue call succeeds. More...
 
SLresult mockEnqueueFailed (SLAndroidSimpleBufferQueueItf self, const void *pBuffer, SLuint32 size)
 Mock enqueue call fails. More...
 
SLresult mockGetState (SLAndroidSimpleBufferQueueItf self, SLAndroidSimpleBufferQueueState *pState)
 Mock get state. More...
 
static SLresult mockClearOk (SLAndroidSimpleBufferQueueItf self)
 Mock clear call succeeds. More...
 
static void bufferFree (AndroidSLESMediaQueue &mediaQueue)
 Mock buffer free call. Increment index and decrement counter. More...
 
 TEST_F (AndroidSLESMediaQueueTest, test_createSucceed)
 Test buffer queue create. More...
 
 TEST_F (AndroidSLESMediaQueueTest, test_createFailMissingSlObject)
 Check that create fail if we are missing the OpenSL ES object. More...
 
 TEST_F (AndroidSLESMediaQueueTest, test_createFailMissingInterface)
 Check that create fail if the SL_IID_ANDROIDSIMPLEBUFFERQUEUE is missing. More...
 
 TEST_F (AndroidSLESMediaQueueTest, test_createFailMissingDecoder)
 Check that create fail if the decoder is missing. More...
 
 TEST_F (AndroidSLESMediaQueueTest, test_createFailMissingCallback)
 Check that create fail if the callback function is missing. More...
 
 TEST_F (AndroidSLESMediaQueueTest, test_createFailRegisterCallback)
 Check that create fail if the callback function cannot be registered. More...
 
 TEST_F (AndroidSLESMediaQueueTest, test_onBufferQueueSucceed)
 Test buffer queue events when the media queue succeeds to read data from the decoder. More...
 
 TEST_F (AndroidSLESMediaQueueTest, test_enqueueTillDone)
 Test buffer queue events when the media queue succeeds to read data from the decoder till the end of the stream. More...
 
 TEST_F (AndroidSLESMediaQueueTest, test_decoderFailure)
 Test that the buffer queue emits an error event when the decoder fails. More...
 
 TEST_F (AndroidSLESMediaQueueTest, test_enqueueFailure)
 Test buffer queue events emits an error event when it fails to enqueue a buffer. More...
 
static SLresult mockGetVolume (SLVolumeItf self, SLmillibel *volume)
 Mock GetVolume succeeds. More...
 
static SLresult mockGetVolumeFailed (SLVolumeItf self, SLmillibel *volume)
 Mock GetVolume fails. More...
 
static SLresult mockSetVolume (SLVolumeItf self, SLmillibel volume)
 Mock SetVolume succeeds. More...
 
static SLresult mockSetVolumeFailed (SLVolumeItf self, SLmillibel volume)
 Mock SetVolume fails. More...
 
static SLresult mockGetMute (SLVolumeItf self, SLboolean *mute)
 Mock GetMute succeeds. More...
 
static SLresult mockGetMuteFailed (SLVolumeItf self, SLboolean *mute)
 Mock GetMute fails. More...
 
static SLresult mockSetMute (SLVolumeItf self, SLboolean mute)
 Mock SetMute succeeds. More...
 
static SLresult mockSetMuteFailed (SLVolumeItf self, SLboolean mute)
 Mock SetMute fails. More...
 
static SLresult mockGetMaxVolume (SLVolumeItf self, SLmillibel *volume)
 Mock GetMaxVolume succeeds. More...
 
 TEST_F (AndroidSLESSpeakerTest, test_createNullEngine)
 Test speaker create with null engine. More...
 
 TEST_F (AndroidSLESSpeakerTest, test_createNullSpeaker)
 Test speaker create with null output mix. More...
 
 TEST_F (AndroidSLESSpeakerTest, test_createInterfaceUnavailable)
 Test speaker create with null engine. More...
 
 TEST_F (AndroidSLESSpeakerTest, test_createInvalidMaxVolume)
 Test speaker create with invalid device configuration. More...
 
 TEST_F (AndroidSLESSpeakerTest, test_setVolumeSucceed)
 Test set and get volume succeed. More...
 
 TEST_F (AndroidSLESSpeakerTest, test_setVolumeFailed)
 Test set volume failed. More...
 
 TEST_F (AndroidSLESSpeakerTest, test_getVolumeFailed)
 Test get volume failed. More...
 
 TEST_F (AndroidSLESSpeakerTest, test_setMuteSucceed)
 Test set and get mute succeed. More...
 
 TEST_F (AndroidSLESSpeakerTest, test_setMuteFailed)
 Test set mute failed. More...
 
 TEST_F (AndroidSLESSpeakerTest, test_getMuteFailed)
 Test get mute failed. More...
 
 TEST_F (AndroidSLESSpeakerTest, test_setVolumeAccuracy)
 Test set and get volume on values in different ranges to guarantee accuracy. More...
 
 TEST_F (AndroidSLESSpeakerTest, test_setDeviceVolume)
 Test that the conversion from avs volume to device volume. More...
 
 TEST (FFmpegAttachmentInputControllerTest, test_createFailed)
 Test create controller fail. More...
 
 TEST (FFmpegAttachmentInputControllerTest, test_rawArgument)
 Test raw input format. More...
 
 TEST (FFmpegAttachmentInputControllerTest, test_readOk)
 Test read from attachment reader. More...
 
 TEST (FFmpegAttachmentInputControllerTest, test_getCurrentFormatContextOnEmptyInput)
 Test opening empty input from attachment reader. More...
 
 TEST (FFmpegAttachmentInputControllerTest, test_readEof)
 Test read from stream until the end. More...
 
static const std::string MP3_FILE_PATH ("/fox_dog.mp3")
 MP3 test file path relative to the input folder. More...
 
 TEST_F (FFmpegDecoderTest, test_createSucceed)
 Test decoder create. More...
 
 TEST_F (FFmpegDecoderTest, test_createFailedNullReader)
 Test decoder create with null reader. More...
 
 TEST_F (FFmpegDecoderTest, test_decodeFullFile)
 Test decoding an entire file. More...
 
 TEST_F (FFmpegDecoderTest, test_truncatedInput)
 Test that it's possible to decode a file that was been truncated past the header. More...
 
 TEST_F (FFmpegDecoderTest, test_corruptedInput)
 Test that the decoder recovers if the file is missing parts of it. More...
 
 TEST_F (FFmpegDecoderTest, test_invalidInput)
 Test that the decoder will error if input has invalid media. More...
 
 TEST_F (FFmpegDecoderTest, test_readSmallBuffer)
 Check that read with a buffer that is too small fails. More...
 
 TEST_F (FFmpegDecoderTest, test_abortInitialization)
 Check that we can abort the decoding during initialization. More...
 
 TEST_F (FFmpegDecoderTest, test_alarmVolumeRamp)
 
std::shared_ptr< std::stringstream > createStream ()
 
 TEST (FFmpegStreamInputControllerTest, test_createSucceed)
 Test decoder input create succeed. More...
 
 TEST (FFmpegStreamInputControllerTest, test_createFailed)
 Test decoder input create with null input failed. More...
 
 TEST (FFmpegStreamInputControllerTest, test_readSucceed)
 Test read from stream. More...
 
 TEST (FFmpegStreamInputControllerTest, test_readEof)
 Test read from stream until the end. More...
 
 TEST (FFmpegStreamInputControllerTest, test_readRepeat)
 Test read with repeat on from a stream. More...
 
 TEST_F (FFmpegUrlInputControllerTest, test_createSucceed)
 Test input controller create succeed. More...
 
 TEST_F (FFmpegUrlInputControllerTest, test_createNullParserFailed)
 Test input controller create with null playlist parser failed. More...
 
 TEST_F (FFmpegUrlInputControllerTest, test_createEmptyUrlFailed)
 Test input controller create with empty url failed. More...
 
 TEST_F (FFmpegUrlInputControllerTest, test_createInvalidUrlFailed)
 Test input controller create with null playlist parser failed. More...
 
 TEST_F (FFmpegUrlInputControllerTest, test_getContextSucceed)
 Test input controller getContext. More...
 
 TEST_F (FFmpegUrlInputControllerTest, test_getContextOffsetSucceed)
 Test input controller getContext with non-zero offset. More...
 
 TEST_F (FFmpegUrlInputControllerTest, test_getContextInvalidUrl)
 Test input controller getContext. More...
 
 TEST_F (FFmpegUrlInputControllerTest, test_getContextAfterNext)
 Test get context after switching files. More...
 
 TEST_F (FFmpegUrlInputControllerTest, test_hasNext)
 Test has next when parser isn't done. More...
 
 TEST_F (FFmpegUrlInputControllerTest, test_done)
 Test has next after playlist parser is done. More...
 
 TEST_F (FFmpegUrlInputControllerTest, test_playlistRepeat)
 Test parsing playlist with repeat on. More...
 
 TEST_F (FFmpegUrlInputControllerTest, test_mediaUrlRepeat)
 Test parsing media url with repeat on. More...
 

Variables

static constexpr size_t MP3_INPUT_SIZE
 The size of the input buffer. More...
 
static const auto 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 MP3_INPUT_DURATION {1440}
 The mp3 duration in milliseconds. More...
 
static const alexaClientSDK::avsCommon::utils::MediaType MP3_TYPE = alexaClientSDK::avsCommon::utils::MediaType::MPEG
 The mp3 MediaType. More...
 
static const SourceConfig EMPTY_CONFIG = emptySourceConfig()
 The source config. More...
 
static const size_t RAW_INPUT_SIZE
 The size of the input buffer. More...
 
static const auto 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 RAW_INPUT_DURATION {2177}
 The raw input duration in milli seconds. More...
 
static const MediaPlayerState DEFAULT_MEDIA_PLAYER_STATE = {std::chrono::milliseconds(0)}
 Default media player state for reporting all playback offsets. More...
 
static const MediaPlayerState MP3_INPUT_FINISHED_MEDIA_PLAYER_STATE = {MP3_INPUT_DURATION}
 The finished media player state. More...
 
static std::string inputsDirPath
 The path to the input Dir containing the test audio files. More...
 
static const std::chrono::milliseconds TIMEOUT {100}
 Timeout for wait callback. More...
 
static const auto NUMBER_OF_BUFFERS = AndroidSLESMediaQueue::NUMBER_OF_BUFFERS
 Number of buffers used by the buffer queue. More...
 
static std::atomic< int > counter
 Mock buffer count. More...
 
static int index
 Mock buffer index. More...
 
static std::mutex bufferMutex
 Mutex used to synchronize the enqueueBuffer and onBufferFree. More...
 
static std::condition_variable bufferCondition
 Condition variable used to guarantee that onBufferFree only happens after counter > 0;. More...
 
static constexpr SLmillibel INVALID_MAX_VOLUME = -10
 Represents an invalid device maximum value. OpenSL ES determines that device max volume is 0 or above. More...
 
static SLmillibel g_volume
 
static SLmillibel g_maxVolume
 
static SLboolean g_mute
 
static constexpr size_t BUFFER_SIZE = 1024
 The size of the buffers used to read input. More...
 
static const size_t INPUT_SIZE = applicationUtilities::resources::audio::data::med_alerts_notification_01_mp3_len
 The size of the input buffer. More...
 
static const auto INPUT_CSTR = applicationUtilities::resources::audio::data::med_alerts_notification_01_mp3
 An input buffer with an mp3 file. More...
 
static const std::vector< size_t > RECEIVE_SIZES {std::numeric_limits<size_t>::max()}
 Configure MockAttachmentReader to simulate getting the entire file before being read. More...
 
static std::string inputFolder
 Test input folder. More...
 
static constexpr size_t BUFFER_SIZE = 1024
 The size of the buffers used to read input. More...
 
static constexpr size_t INPUT_SIZE = applicationUtilities::resources::audio::data::med_alerts_notification_01_mp3_len
 The size of the input buffer. More...
 
static const auto INPUT_CSTR = applicationUtilities::resources::audio::data::med_alerts_notification_01_mp3
 An input buffer with an mp3 file. More...
 
static const std::string PLAYLIST_URL {"playlist"}
 Represent a dummy url that will be used as playlist. More...
 
static const std::string MEDIA_URL_1 {"url1"}
 Constant string used to mock a media url. More...
 
static const std::string MP3_FILE_PATH {"/fox_dog.mp3"}
 MP3 test file path relative to the input folder. More...
 
static const std::chrono::seconds DURATION {5}
 MP3 approximate duration. More...
 
static const bool DO_NOT_REPEAT = false
 
static const std::chrono::milliseconds ZERO_OFFSET = std::chrono::milliseconds::zero()
 Zero offset. More...
 
static std::string INPUT_FOLDER
 Test file path. More...
 
static const PlaylistEntry INVALID_URL_ENTRY = PlaylistEntry::createErrorEntry(MEDIA_URL_1)
 Constant struct used to mock return of playlist next() method. Calls to getContext with this entry will fail. More...
 

Typedef Documentation

◆ Byte

◆ MediaPlayerState

◆ MockSlSimpleBufferQueue

◆ MockVolumeInterface

Function Documentation

◆ bufferFree()

static void alexaClientSDK::mediaPlayer::android::test::bufferFree ( AndroidSLESMediaQueue mediaQueue)
static

Mock buffer free call. Increment index and decrement counter.

◆ createStream()

std::shared_ptr<std::stringstream> alexaClientSDK::mediaPlayer::android::test::createStream ( )

◆ mockClearOk()

static SLresult alexaClientSDK::mediaPlayer::android::test::mockClearOk ( SLAndroidSimpleBufferQueueItf  self)
static

Mock clear call succeeds.

◆ mockEnqueueFailed()

SLresult alexaClientSDK::mediaPlayer::android::test::mockEnqueueFailed ( SLAndroidSimpleBufferQueueItf  self,
const void *  pBuffer,
SLuint32  size 
)

Mock enqueue call fails.

◆ mockEnqueueOk()

static SLresult alexaClientSDK::mediaPlayer::android::test::mockEnqueueOk ( SLAndroidSimpleBufferQueueItf  self,
const void *  pBuffer,
SLuint32  size 
)
static

Mock enqueue call succeeds.

◆ mockGetMaxVolume()

static SLresult alexaClientSDK::mediaPlayer::android::test::mockGetMaxVolume ( SLVolumeItf  self,
SLmillibel *  volume 
)
static

Mock GetMaxVolume succeeds.

◆ mockGetMute()

static SLresult alexaClientSDK::mediaPlayer::android::test::mockGetMute ( SLVolumeItf  self,
SLboolean *  mute 
)
static

Mock GetMute succeeds.

◆ mockGetMuteFailed()

static SLresult alexaClientSDK::mediaPlayer::android::test::mockGetMuteFailed ( SLVolumeItf  self,
SLboolean *  mute 
)
static

Mock GetMute fails.

◆ mockGetState()

SLresult alexaClientSDK::mediaPlayer::android::test::mockGetState ( SLAndroidSimpleBufferQueueItf  self,
SLAndroidSimpleBufferQueueState *  pState 
)

Mock get state.

◆ mockGetVolume()

static SLresult alexaClientSDK::mediaPlayer::android::test::mockGetVolume ( SLVolumeItf  self,
SLmillibel *  volume 
)
static

Mock GetVolume succeeds.

◆ mockGetVolumeFailed()

static SLresult alexaClientSDK::mediaPlayer::android::test::mockGetVolumeFailed ( SLVolumeItf  self,
SLmillibel *  volume 
)
static

Mock GetVolume fails.

◆ mockRegisterCallbackFailed()

static SLresult alexaClientSDK::mediaPlayer::android::test::mockRegisterCallbackFailed ( SLAndroidSimpleBufferQueueItf  self,
slAndroidSimpleBufferQueueCallback  callback,
void *  pCallbackContext 
)
static

Mock register callback fails.

◆ mockRegisterCallbackOk()

static SLresult alexaClientSDK::mediaPlayer::android::test::mockRegisterCallbackOk ( SLAndroidSimpleBufferQueueItf  self,
slAndroidSimpleBufferQueueCallback  callback,
void *  pCallbackContext 
)
static

Mock register callback succeeds.

◆ mockSetMute()

static SLresult alexaClientSDK::mediaPlayer::android::test::mockSetMute ( SLVolumeItf  self,
SLboolean  mute 
)
static

Mock SetMute succeeds.

◆ mockSetMuteFailed()

static SLresult alexaClientSDK::mediaPlayer::android::test::mockSetMuteFailed ( SLVolumeItf  self,
SLboolean  mute 
)
static

Mock SetMute fails.

◆ mockSetVolume()

static SLresult alexaClientSDK::mediaPlayer::android::test::mockSetVolume ( SLVolumeItf  self,
SLmillibel  volume 
)
static

Mock SetVolume succeeds.

◆ mockSetVolumeFailed()

static SLresult alexaClientSDK::mediaPlayer::android::test::mockSetVolumeFailed ( SLVolumeItf  self,
SLmillibel  volume 
)
static

Mock SetVolume fails.

◆ MP3_FILE_PATH() [1/2]

static const std::string alexaClientSDK::mediaPlayer::android::test::MP3_FILE_PATH ( "/fox_dog.mp3"  )
static

MP3 test file path.

◆ MP3_FILE_PATH() [2/2]

static const std::string alexaClientSDK::mediaPlayer::android::test::MP3_FILE_PATH ( "/fox_dog.mp3"  )
static

MP3 test file path relative to the input folder.

◆ TEST() [1/10]

alexaClientSDK::mediaPlayer::android::test::TEST ( FFmpegStreamInputControllerTest  ,
test_createSucceed   
)

Test decoder input create succeed.

◆ TEST() [2/10]

alexaClientSDK::mediaPlayer::android::test::TEST ( FFmpegStreamInputControllerTest  ,
test_createFailed   
)

Test decoder input create with null input failed.

◆ TEST() [3/10]

alexaClientSDK::mediaPlayer::android::test::TEST ( FFmpegStreamInputControllerTest  ,
test_readSucceed   
)

Test read from stream.

◆ TEST() [4/10]

alexaClientSDK::mediaPlayer::android::test::TEST ( FFmpegStreamInputControllerTest  ,
test_readEof   
)

Test read from stream until the end.

◆ TEST() [5/10]

alexaClientSDK::mediaPlayer::android::test::TEST ( FFmpegStreamInputControllerTest  ,
test_readRepeat   
)

Test read with repeat on from a stream.

◆ TEST() [6/10]

alexaClientSDK::mediaPlayer::android::test::TEST ( FFmpegAttachmentInputControllerTest  ,
test_createFailed   
)

Test create controller fail.

◆ TEST() [7/10]

alexaClientSDK::mediaPlayer::android::test::TEST ( FFmpegAttachmentInputControllerTest  ,
test_rawArgument   
)

Test raw input format.

◆ TEST() [8/10]

alexaClientSDK::mediaPlayer::android::test::TEST ( FFmpegAttachmentInputControllerTest  ,
test_readOk   
)

Test read from attachment reader.

◆ TEST() [9/10]

alexaClientSDK::mediaPlayer::android::test::TEST ( FFmpegAttachmentInputControllerTest  ,
test_getCurrentFormatContextOnEmptyInput   
)

Test opening empty input from attachment reader.

◆ TEST() [10/10]

alexaClientSDK::mediaPlayer::android::test::TEST ( FFmpegAttachmentInputControllerTest  ,
test_readEof   
)

Test read from stream until the end.

◆ TEST_F() [1/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegUrlInputControllerTest  ,
test_createSucceed   
)

Test input controller create succeed.

◆ TEST_F() [2/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegUrlInputControllerTest  ,
test_createNullParserFailed   
)

Test input controller create with null playlist parser failed.

◆ TEST_F() [3/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegUrlInputControllerTest  ,
test_createEmptyUrlFailed   
)

Test input controller create with empty url failed.

◆ TEST_F() [4/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegDecoderTest  ,
test_createSucceed   
)

Test decoder create.

◆ TEST_F() [5/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegUrlInputControllerTest  ,
test_createInvalidUrlFailed   
)

Test input controller create with null playlist parser failed.

◆ TEST_F() [6/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegDecoderTest  ,
test_createFailedNullReader   
)

Test decoder create with null reader.

◆ TEST_F() [7/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegUrlInputControllerTest  ,
test_getContextSucceed   
)

Test input controller getContext.

◆ TEST_F() [8/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegDecoderTest  ,
test_decodeFullFile   
)

Test decoding an entire file.

◆ TEST_F() [9/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESSpeakerTest  ,
test_createNullEngine   
)

Test speaker create with null engine.

◆ TEST_F() [10/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESSpeakerTest  ,
test_createNullSpeaker   
)

Test speaker create with null output mix.

◆ TEST_F() [11/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegUrlInputControllerTest  ,
test_getContextOffsetSucceed   
)

Test input controller getContext with non-zero offset.

◆ TEST_F() [12/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESSpeakerTest  ,
test_createInterfaceUnavailable   
)

Test speaker create with null engine.

◆ TEST_F() [13/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegDecoderTest  ,
test_truncatedInput   
)

Test that it's possible to decode a file that was been truncated past the header.

◆ TEST_F() [14/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESSpeakerTest  ,
test_createInvalidMaxVolume   
)

Test speaker create with invalid device configuration.

◆ TEST_F() [15/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegUrlInputControllerTest  ,
test_getContextInvalidUrl   
)

Test input controller getContext.

◆ TEST_F() [16/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESSpeakerTest  ,
test_setVolumeSucceed   
)

Test set and get volume succeed.

◆ TEST_F() [17/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegDecoderTest  ,
test_corruptedInput   
)

Test that the decoder recovers if the file is missing parts of it.

◆ TEST_F() [18/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegUrlInputControllerTest  ,
test_getContextAfterNext   
)

Test get context after switching files.

◆ TEST_F() [19/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESSpeakerTest  ,
test_setVolumeFailed   
)

Test set volume failed.

◆ TEST_F() [20/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESSpeakerTest  ,
test_getVolumeFailed   
)

Test get volume failed.

◆ TEST_F() [21/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESSpeakerTest  ,
test_setMuteSucceed   
)

Test set and get mute succeed.

◆ TEST_F() [22/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegUrlInputControllerTest  ,
test_hasNext   
)

Test has next when parser isn't done.

◆ TEST_F() [23/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaQueueTest  ,
test_createSucceed   
)

Test buffer queue create.

◆ TEST_F() [24/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegDecoderTest  ,
test_invalidInput   
)

Test that the decoder will error if input has invalid media.

◆ TEST_F() [25/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESSpeakerTest  ,
test_setMuteFailed   
)

Test set mute failed.

◆ TEST_F() [26/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegUrlInputControllerTest  ,
test_done   
)

Test has next after playlist parser is done.

◆ TEST_F() [27/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESSpeakerTest  ,
test_getMuteFailed   
)

Test get mute failed.

◆ TEST_F() [28/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaPlayerTest  ,
test_createNullFactory   
)

Test create with null factory.

◆ TEST_F() [29/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaQueueTest  ,
test_createFailMissingSlObject   
)

Check that create fail if we are missing the OpenSL ES object.

◆ TEST_F() [30/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESSpeakerTest  ,
test_setVolumeAccuracy   
)

Test set and get volume on values in different ranges to guarantee accuracy.

◆ TEST_F() [31/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaPlayerTest  ,
test_createNullEngine   
)

Test create with null engine.

◆ TEST_F() [32/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegUrlInputControllerTest  ,
test_playlistRepeat   
)

Test parsing playlist with repeat on.

◆ TEST_F() [33/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegDecoderTest  ,
test_readSmallBuffer   
)

Check that read with a buffer that is too small fails.

◆ TEST_F() [34/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaPlayerTest  ,
test_bQMediaPlayer   
)

Test buffer queue with media player.

◆ TEST_F() [35/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaQueueTest  ,
test_createFailMissingInterface   
)

Check that create fail if the SL_IID_ANDROIDSIMPLEBUFFERQUEUE is missing.

◆ TEST_F() [36/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegDecoderTest  ,
test_abortInitialization   
)

Check that we can abort the decoding during initialization.

◆ TEST_F() [37/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESSpeakerTest  ,
test_setDeviceVolume   
)

Test that the conversion from avs volume to device volume.

◆ TEST_F() [38/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaPlayerTest  ,
test_bQRawMediaPlayer   
)

Test buffer queue with media player and raw file.

◆ TEST_F() [39/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaQueueTest  ,
test_createFailMissingDecoder   
)

Check that create fail if the decoder is missing.

◆ TEST_F() [40/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegUrlInputControllerTest  ,
test_mediaUrlRepeat   
)

Test parsing media url with repeat on.

◆ TEST_F() [41/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaQueueTest  ,
test_createFailMissingCallback   
)

Check that create fail if the callback function is missing.

◆ TEST_F() [42/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaPlayerTest  ,
test_firstReadTimeout   
)

Test that media is played correct even if a timeout happens in the first read.

◆ TEST_F() [43/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( FFmpegDecoderTest  ,
test_alarmVolumeRamp   
)

◆ TEST_F() [44/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaQueueTest  ,
test_createFailRegisterCallback   
)

Check that create fail if the callback function cannot be registered.

◆ TEST_F() [45/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaQueueTest  ,
test_onBufferQueueSucceed   
)

Test buffer queue events when the media queue succeeds to read data from the decoder.

◆ TEST_F() [46/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaPlayerTest  ,
test_initializeTimeout   
)

Test that media is played correct even after a timeout during initialization.

◆ TEST_F() [47/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaPlayerTest  ,
test_decodingTimeout   
)

Test that media is played correct even after a timeout during decoding.

◆ TEST_F() [48/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaQueueTest  ,
test_enqueueTillDone   
)

Test buffer queue events when the media queue succeeds to read data from the decoder till the end of the stream.

◆ TEST_F() [49/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaPlayerTest  ,
test_streamMediaPlayer   
)

Test media player and istream source.

◆ TEST_F() [50/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaPlayerTest  ,
test_streamRepeatMediaPlayer   
)

Test media player, istream source and repeat on.

◆ TEST_F() [51/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaQueueTest  ,
test_decoderFailure   
)

Test that the buffer queue emits an error event when the decoder fails.

◆ TEST_F() [52/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaPlayerTest  ,
test_resumeMediaPlayer   
)

Test media player pause / resume.

◆ TEST_F() [53/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaQueueTest  ,
test_enqueueFailure   
)

Test buffer queue events emits an error event when it fails to enqueue a buffer.

◆ TEST_F() [54/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaPlayerTest  ,
test_playFailed   
)

Test play fails with wrong id.

◆ TEST_F() [55/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaPlayerTest  ,
test_pauseFailed   
)

Test pause fails with wrong id.

◆ TEST_F() [56/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaPlayerTest  ,
test_pauseFailedNotPlaying   
)

Test pause fails if not playing.

◆ TEST_F() [57/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaPlayerTest  ,
test_resumeFailedAfterStop   
)

Test resume fails after stop.

◆ TEST_F() [58/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaPlayerTest  ,
test_stopFailed   
)

Test stop fails with wrong id.

◆ TEST_F() [59/59]

alexaClientSDK::mediaPlayer::android::test::TEST_F ( AndroidSLESMediaPlayerTest  ,
test_getOffset   
)

Test get offset.

Variable Documentation

◆ BUFFER_SIZE [1/2]

constexpr size_t alexaClientSDK::mediaPlayer::android::test::BUFFER_SIZE = 1024
static

The size of the buffers used to read input.

◆ BUFFER_SIZE [2/2]

constexpr size_t alexaClientSDK::mediaPlayer::android::test::BUFFER_SIZE = 1024
static

The size of the buffers used to read input.

Some arbitrary size that should fit valid audio samples.

◆ bufferCondition

std::condition_variable alexaClientSDK::mediaPlayer::android::test::bufferCondition
static

Condition variable used to guarantee that onBufferFree only happens after counter > 0;.

◆ bufferMutex

std::mutex alexaClientSDK::mediaPlayer::android::test::bufferMutex
static

Mutex used to synchronize the enqueueBuffer and onBufferFree.

◆ counter

std::atomic<int> alexaClientSDK::mediaPlayer::android::test::counter
static

Mock buffer count.

◆ DEFAULT_MEDIA_PLAYER_STATE

const MediaPlayerState alexaClientSDK::mediaPlayer::android::test::DEFAULT_MEDIA_PLAYER_STATE = {std::chrono::milliseconds(0)}
static

Default media player state for reporting all playback offsets.

◆ DO_NOT_REPEAT

const bool alexaClientSDK::mediaPlayer::android::test::DO_NOT_REPEAT = false
static

◆ DURATION

const std::chrono::seconds alexaClientSDK::mediaPlayer::android::test::DURATION {5}
static

MP3 approximate duration.

◆ EMPTY_CONFIG

const SourceConfig alexaClientSDK::mediaPlayer::android::test::EMPTY_CONFIG = emptySourceConfig()
static

The source config.

◆ g_maxVolume

SLmillibel alexaClientSDK::mediaPlayer::android::test::g_maxVolume
static

◆ g_mute

SLboolean alexaClientSDK::mediaPlayer::android::test::g_mute
static

◆ g_volume

SLmillibel alexaClientSDK::mediaPlayer::android::test::g_volume
static

◆ index

int alexaClientSDK::mediaPlayer::android::test::index
static

Mock buffer index.

◆ INPUT_CSTR [1/2]

const auto alexaClientSDK::mediaPlayer::android::test::INPUT_CSTR = applicationUtilities::resources::audio::data::med_alerts_notification_01_mp3
static

An input buffer with an mp3 file.

◆ INPUT_CSTR [2/2]

const auto alexaClientSDK::mediaPlayer::android::test::INPUT_CSTR = applicationUtilities::resources::audio::data::med_alerts_notification_01_mp3
static

An input buffer with an mp3 file.

◆ INPUT_FOLDER

std::string alexaClientSDK::mediaPlayer::android::test::INPUT_FOLDER
static

Test file path.

◆ INPUT_SIZE [1/2]

constexpr size_t alexaClientSDK::mediaPlayer::android::test::INPUT_SIZE = applicationUtilities::resources::audio::data::med_alerts_notification_01_mp3_len
static

The size of the input buffer.

◆ INPUT_SIZE [2/2]

const size_t alexaClientSDK::mediaPlayer::android::test::INPUT_SIZE = applicationUtilities::resources::audio::data::med_alerts_notification_01_mp3_len
static

The size of the input buffer.

◆ inputFolder

std::string alexaClientSDK::mediaPlayer::android::test::inputFolder
static

Test input folder.

◆ inputsDirPath

std::string alexaClientSDK::mediaPlayer::android::test::inputsDirPath
static

The path to the input Dir containing the test audio files.

◆ INVALID_MAX_VOLUME

constexpr SLmillibel alexaClientSDK::mediaPlayer::android::test::INVALID_MAX_VOLUME = -10
static

Represents an invalid device maximum value. OpenSL ES determines that device max volume is 0 or above.

◆ INVALID_URL_ENTRY

const PlaylistEntry alexaClientSDK::mediaPlayer::android::test::INVALID_URL_ENTRY = PlaylistEntry::createErrorEntry(MEDIA_URL_1)
static

Constant struct used to mock return of playlist next() method. Calls to getContext with this entry will fail.

◆ MEDIA_URL_1

const std::string alexaClientSDK::mediaPlayer::android::test::MEDIA_URL_1 {"url1"}
static

Constant string used to mock a media url.

◆ MP3_FILE_PATH

const std::string alexaClientSDK::mediaPlayer::android::test::MP3_FILE_PATH {"/fox_dog.mp3"}
static

MP3 test file path relative to the input folder.

◆ MP3_INPUT_CSTR

const auto alexaClientSDK::mediaPlayer::android::test::MP3_INPUT_CSTR = applicationUtilities::resources::audio::data::med_alerts_notification_01_mp3
static

An input buffer with an mp3 file.

◆ MP3_INPUT_DURATION

const std::chrono::milliseconds alexaClientSDK::mediaPlayer::android::test::MP3_INPUT_DURATION {1440}
static

The mp3 duration in milliseconds.

◆ MP3_INPUT_FINISHED_MEDIA_PLAYER_STATE

const MediaPlayerState alexaClientSDK::mediaPlayer::android::test::MP3_INPUT_FINISHED_MEDIA_PLAYER_STATE = {MP3_INPUT_DURATION}
static

The finished media player state.

◆ MP3_INPUT_SIZE

constexpr size_t alexaClientSDK::mediaPlayer::android::test::MP3_INPUT_SIZE
static
Initial value:

The size of the input buffer.

◆ MP3_TYPE

const alexaClientSDK::avsCommon::utils::MediaType alexaClientSDK::mediaPlayer::android::test::MP3_TYPE = alexaClientSDK::avsCommon::utils::MediaType::MPEG
static

The mp3 MediaType.

◆ NUMBER_OF_BUFFERS

const auto alexaClientSDK::mediaPlayer::android::test::NUMBER_OF_BUFFERS = AndroidSLESMediaQueue::NUMBER_OF_BUFFERS
static

Number of buffers used by the buffer queue.

◆ PLAYLIST_URL

const std::string alexaClientSDK::mediaPlayer::android::test::PLAYLIST_URL {"playlist"}
static

Represent a dummy url that will be used as playlist.

◆ RAW_INPUT_CSTR

const auto alexaClientSDK::mediaPlayer::android::test::RAW_INPUT_CSTR = applicationUtilities::resources::audio::data::med_system_alerts_melodic_01_short_wav
static

An input buffer with an mp3 file.

◆ RAW_INPUT_DURATION

const std::chrono::milliseconds alexaClientSDK::mediaPlayer::android::test::RAW_INPUT_DURATION {2177}
static

The raw input duration in milli seconds.

◆ RAW_INPUT_SIZE

const size_t alexaClientSDK::mediaPlayer::android::test::RAW_INPUT_SIZE
static
Initial value:

The size of the input buffer.

◆ RECEIVE_SIZES

const std::vector<size_t> alexaClientSDK::mediaPlayer::android::test::RECEIVE_SIZES {std::numeric_limits<size_t>::max()}
static

Configure MockAttachmentReader to simulate getting the entire file before being read.

◆ TIMEOUT

const std::chrono::milliseconds alexaClientSDK::mediaPlayer::android::test::TIMEOUT {100}
static

Timeout for wait callback.

◆ ZERO_OFFSET

const std::chrono::milliseconds alexaClientSDK::mediaPlayer::android::test::ZERO_OFFSET = std::chrono::milliseconds::zero()
static

Zero offset.

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0