Twitch SDK (Internal)
Public Member Functions | List of all members
ttv::broadcast::IAudioEncoder Class Referenceabstract

#include <iaudioencoder.h>

Inheritance diagram for ttv::broadcast::IAudioEncoder:
ttv::broadcast::AppleAacEncoder ttv::broadcast::LameAudioEncoder ttv::broadcast::PassThroughAudioEncoder

Public Member Functions

 IAudioEncoder ()
 
virtual ~IAudioEncoder ()
 
virtual TTV_ErrorCode SetFrameWriter (const std::shared_ptr< IFrameWriter > &frameWriter)=0
 
virtual TTV_ErrorCode GetAudioEncodingFormat (AudioFormat &result)=0
 
virtual std::string GetName () const =0
 
virtual TTV_ErrorCode Initialize ()=0
 
virtual TTV_ErrorCode Start (uint32_t streamIndex, const AudioParams &audioParams)=0
 
virtual TTV_ErrorCode GetNumInputSamplesPerEncodeFrame (uint32_t &result)=0
 
virtual TTV_ErrorCode Stop ()=0
 
virtual TTV_ErrorCode Shutdown ()=0
 
virtual TTV_ErrorCode SubmitFrame (const std::shared_ptr< AudioFrame > &audioFrame)=0
 
template<typename T >
bool SupportsReceiverProtocol () const
 
virtual bool SupportsReceiverProtocol (IAudioFrameReceiver::ReceiverTypeId typeId) const =0
 
virtual std::shared_ptr< IAudioFrameReceiverGetReceiverImplementation (IAudioFrameReceiver::ReceiverTypeId typeId)=0
 

Detailed Description

Initialize() should be called by the client prior to adding it to the system. Shutdown() should be called after removing from the system. Start() and Stop() will be called by the system when capture is to be started and stopped.

Constructor & Destructor Documentation

◆ IAudioEncoder()

ttv::broadcast::IAudioEncoder::IAudioEncoder ( )

◆ ~IAudioEncoder()

virtual ttv::broadcast::IAudioEncoder::~IAudioEncoder ( )
virtual

Member Function Documentation

◆ GetAudioEncodingFormat()

virtual TTV_ErrorCode ttv::broadcast::IAudioEncoder::GetAudioEncodingFormat ( AudioFormat result)
pure virtual

◆ GetName()

virtual std::string ttv::broadcast::IAudioEncoder::GetName ( ) const
pure virtual

◆ GetNumInputSamplesPerEncodeFrame()

virtual TTV_ErrorCode ttv::broadcast::IAudioEncoder::GetNumInputSamplesPerEncodeFrame ( uint32_t &  result)
pure virtual

Assuming the encoder requires a data frame of constant size this is the number of samples in the frame. If it does not need to be constant then result will be 0.

Implemented in ttv::broadcast::PassThroughAudioEncoder, ttv::broadcast::LameAudioEncoder, and ttv::broadcast::AppleAacEncoder.

◆ GetReceiverImplementation()

virtual std::shared_ptr<IAudioFrameReceiver> ttv::broadcast::IAudioEncoder::GetReceiverImplementation ( IAudioFrameReceiver::ReceiverTypeId  typeId)
pure virtual

Obtains the receiver for the given protocol. If not implemented, null will be returned.

Implemented in ttv::broadcast::PassThroughAudioEncoder, ttv::broadcast::LameAudioEncoder, and ttv::broadcast::AppleAacEncoder.

◆ Initialize()

virtual TTV_ErrorCode ttv::broadcast::IAudioEncoder::Initialize ( )
pure virtual

◆ SetFrameWriter()

virtual TTV_ErrorCode ttv::broadcast::IAudioEncoder::SetFrameWriter ( const std::shared_ptr< IFrameWriter > &  frameWriter)
pure virtual

◆ Shutdown()

virtual TTV_ErrorCode ttv::broadcast::IAudioEncoder::Shutdown ( )
pure virtual

◆ Start()

virtual TTV_ErrorCode ttv::broadcast::IAudioEncoder::Start ( uint32_t  streamIndex,
const AudioParams audioParams 
)
pure virtual

◆ Stop()

virtual TTV_ErrorCode ttv::broadcast::IAudioEncoder::Stop ( )
pure virtual

◆ SubmitFrame()

virtual TTV_ErrorCode ttv::broadcast::IAudioEncoder::SubmitFrame ( const std::shared_ptr< AudioFrame > &  audioFrame)
pure virtual

Submits the given audio frame. It should have been created by using the IAudioFrameReceiver implementation returned by GetReceiverImplementation().

Implemented in ttv::broadcast::PassThroughAudioEncoder, ttv::broadcast::LameAudioEncoder, and ttv::broadcast::AppleAacEncoder.

◆ SupportsReceiverProtocol() [1/2]

template<typename T >
bool ttv::broadcast::IAudioEncoder::SupportsReceiverProtocol ( ) const
inline

Determines if the concrete implementation supports the given protocol. The template parameter must be known to derive from IAudioFrameReceiver.

◆ SupportsReceiverProtocol() [2/2]

virtual bool ttv::broadcast::IAudioEncoder::SupportsReceiverProtocol ( IAudioFrameReceiver::ReceiverTypeId  typeId) const
pure virtual

Determines if the concrete implementation supports the given protocol.

Implemented in ttv::broadcast::PassThroughAudioEncoder, ttv::broadcast::LameAudioEncoder, and ttv::broadcast::AppleAacEncoder.


The documentation for this class was generated from the following file: