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::FFmpegStreamInputController Class Reference

#include <FFmpegStreamInputController.h>

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

Public Member Functions

 ~FFmpegStreamInputController ()
 
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< FFmpegStreamInputControllercreate (std::shared_ptr< std::istream > stream, bool repeat)
 

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 input stream.

This class support repeat functionality implemented by returning true to hasNext and rewinding the stream pointer when next is called.

Constructor & Destructor Documentation

◆ ~FFmpegStreamInputController()

alexaClientSDK::mediaPlayer::android::FFmpegStreamInputController::~FFmpegStreamInputController ( )

Destructor.

Member Function Documentation

◆ create()

static std::unique_ptr<FFmpegStreamInputController> alexaClientSDK::mediaPlayer::android::FFmpegStreamInputController::create ( std::shared_ptr< std::istream >  stream,
bool  repeat 
)
static

Creates an input stream object.

Parameters
inputA pointer to the input stream. It shall point to a valid object.
repeatWhether to play the input stream in a loop.
Returns
A pointer to the FFmpegStreamInputController if succeed; nullptr otherwise.

◆ getCurrentFormatContext()

std::tuple<Result, std::shared_ptr<AVFormatContext>, std::chrono::milliseconds> alexaClientSDK::mediaPlayer::android::FFmpegStreamInputController::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::FFmpegStreamInputController::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::FFmpegStreamInputController::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