AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::mediaPlayer::android::FFmpegAttachmentInputController Class Reference

#include <FFmpegAttachmentInputController.h>

Inheritance diagram for alexaClientSDK::mediaPlayer::android::FFmpegAttachmentInputController:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::mediaPlayer::android::FFmpegAttachmentInputController:
Collaboration graph
[legend]

Public Member Functions

 ~FFmpegAttachmentInputController ()
 
FFmpegInputControllerInterface methods
bool hasNext () const override
 
bool next () override
 
std::tuple< Result, std::shared_ptr< AVFormatContext >, std::chrono::milliseconds > getCurrentFormatContext () override
 
- Public Member Functions inherited from alexaClientSDK::mediaPlayer::android::FFmpegInputControllerInterface
virtual ~FFmpegInputControllerInterface ()=default
 

Static Public Member Functions

static std::unique_ptr< FFmpegAttachmentInputControllercreate (std::shared_ptr< avsCommon::avs::attachment::AttachmentReader > reader, const avsCommon::utils::AudioFormat *format=nullptr)
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::mediaPlayer::android::FFmpegInputControllerInterface
enum  Result { Result::OK, Result::OK_EMPTY, Result::TRY_AGAIN, Result::ERROR }
 Enumeration class that represents the possible return values for getContext. More...
 

Detailed Description

This class provides the FFmpegDecoder input access to the content of an attachment reader.

This class only support one media input and it cannot provide multiple tracks / repeat.

Constructor & Destructor Documentation

◆ ~FFmpegAttachmentInputController()

alexaClientSDK::mediaPlayer::android::FFmpegAttachmentInputController::~FFmpegAttachmentInputController ( )

Destructor.

Member Function Documentation

◆ create()

static std::unique_ptr<FFmpegAttachmentInputController> alexaClientSDK::mediaPlayer::android::FFmpegAttachmentInputController::create ( std::shared_ptr< avsCommon::avs::attachment::AttachmentReader reader,
const avsCommon::utils::AudioFormat format = nullptr 
)
static

Creates an input reader object.

Parameters
readerA pointer to the attachment reader.
formatThe audio format to be used to interpret raw audio data. This can be nullptr.
Returns
A pointer to the FFmpegAttachmentInputController if succeed; nullptr otherwise.

◆ getCurrentFormatContext()

std::tuple<Result, std::shared_ptr<AVFormatContext>, std::chrono::milliseconds> alexaClientSDK::mediaPlayer::android::FFmpegAttachmentInputController::getCurrentFormatContext ( )
overridevirtual

This method will initialize the ffmpeg format context that represents the current input stream.

Returns
A tuple with the return result, a pointer to AVFormatContext and the initial playback position.

Implements alexaClientSDK::mediaPlayer::android::FFmpegInputControllerInterface.

◆ hasNext()

bool alexaClientSDK::mediaPlayer::android::FFmpegAttachmentInputController::hasNext ( ) const
overridevirtual

Checks if there is a next track to be played.

Returns
true if there is a next track; false, otherwise.

Implements alexaClientSDK::mediaPlayer::android::FFmpegInputControllerInterface.

◆ next()

bool alexaClientSDK::mediaPlayer::android::FFmpegAttachmentInputController::next ( )
overridevirtual

Change input to the next track to be played.

Returns
true if it succeeds to change; false, otherwise.

Implements alexaClientSDK::mediaPlayer::android::FFmpegInputControllerInterface.


The documentation for this class was generated from the following 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