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

#include <DecoderInterface.h>

Inheritance diagram for alexaClientSDK::mediaPlayer::android::DecoderInterface:
Inheritance graph
[legend]

Public Types

enum  Status { Status::OK, Status::DONE, Status::ERROR }
 Represent the decoder read status. More...
 
using Byte = uint8_t
 Represents one byte of data. More...
 

Public Member Functions

virtual std::pair< Status, size_t > read (Byte *buffer, size_t size)=0
 
virtual void abort ()=0
 
virtual ~DecoderInterface ()=default
 

Detailed Description

A provides a method to fill up buffers with raw audio. The read method shall respect the audio frame boundaries, i.e., one frame shall not be split into more than one buffer.

The output should always be:

Member Typedef Documentation

◆ Byte

Represents one byte of data.

Member Enumeration Documentation

◆ Status

Represent the decoder read status.

Enumerator
OK 

The read request was successful and there is still more data to be read.

DONE 

The decoder has decoded the entire input and there is no more data left to be read.

ERROR 

The decoder found an error.

Constructor & Destructor Documentation

◆ ~DecoderInterface()

virtual alexaClientSDK::mediaPlayer::android::DecoderInterface::~DecoderInterface ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ abort()

virtual void alexaClientSDK::mediaPlayer::android::DecoderInterface::abort ( )
pure virtual

Abort the decoding process.

This method can be called in parallel with read. The read will fail in this case. Future reads will also fail.

Implemented in alexaClientSDK::mediaPlayer::android::FFmpegDecoder.

◆ read()

virtual std::pair<Status, size_t> alexaClientSDK::mediaPlayer::android::DecoderInterface::read ( Byte buffer,
size_t  size 
)
pure virtual

Fill buffer with decoded audio data.

Parameters
[out]Bufferwhere the data will be copied to.
sizeThe buffer size in number of bytes.
Returns
The decoding status and the number of bytes read.

Implemented in alexaClientSDK::mediaPlayer::android::FFmpegDecoder.


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