Twitch SDK (Internal)
Public Member Functions | Private Attributes | List of all members
ttv::broadcast::PassThroughAudioEncoder Class Reference

#include <passthroughaudioencoder.h>

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

Public Member Functions

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

Private Attributes

std::shared_ptr< PassThroughAudioEncoderInternalData > mInternalData
 

Constructor & Destructor Documentation

◆ PassThroughAudioEncoder()

ttv::broadcast::PassThroughAudioEncoder::PassThroughAudioEncoder ( )

◆ ~PassThroughAudioEncoder()

virtual ttv::broadcast::PassThroughAudioEncoder::~PassThroughAudioEncoder ( )
virtual

Member Function Documentation

◆ GetAudioEncodingFormat()

virtual TTV_ErrorCode ttv::broadcast::PassThroughAudioEncoder::GetAudioEncodingFormat ( AudioFormat result)
overridevirtual

◆ GetName()

virtual std::string ttv::broadcast::PassThroughAudioEncoder::GetName ( ) const
overridevirtual

Retrieves the name for logging purposes.

Implements ttv::broadcast::IAudioEncoder.

◆ GetNumInputSamplesPerEncodeFrame()

virtual TTV_ErrorCode ttv::broadcast::PassThroughAudioEncoder::GetNumInputSamplesPerEncodeFrame ( uint32_t &  result)
overridevirtual

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.

Implements ttv::broadcast::IAudioEncoder.

◆ GetReceiverImplementation()

virtual std::shared_ptr<IAudioFrameReceiver> ttv::broadcast::PassThroughAudioEncoder::GetReceiverImplementation ( IAudioFrameReceiver::ReceiverTypeId  typeId)
overridevirtual

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

Implements ttv::broadcast::IAudioEncoder.

◆ Initialize()

virtual TTV_ErrorCode ttv::broadcast::PassThroughAudioEncoder::Initialize ( )
overridevirtual

◆ SetAudioFormat()

TTV_ErrorCode ttv::broadcast::PassThroughAudioEncoder::SetAudioFormat ( AudioFormat  format)

◆ SetFrameWriter()

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

◆ SetSamplesPerFrame()

TTV_ErrorCode ttv::broadcast::PassThroughAudioEncoder::SetSamplesPerFrame ( uint32_t  samplesPerFrame)

◆ Shutdown()

virtual TTV_ErrorCode ttv::broadcast::PassThroughAudioEncoder::Shutdown ( )
overridevirtual

◆ Start()

virtual TTV_ErrorCode ttv::broadcast::PassThroughAudioEncoder::Start ( uint32_t  streamIndex,
const AudioParams audioParams 
)
overridevirtual

◆ Stop()

virtual TTV_ErrorCode ttv::broadcast::PassThroughAudioEncoder::Stop ( )
overridevirtual

◆ SubmitFrame()

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

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

Implements ttv::broadcast::IAudioEncoder.

◆ SupportsReceiverProtocol() [1/2]

virtual bool ttv::broadcast::PassThroughAudioEncoder::SupportsReceiverProtocol ( IAudioFrameReceiver::ReceiverTypeId  typeId) const
overridevirtual

Determines if the concrete implementation supports the given protocol.

Implements ttv::broadcast::IAudioEncoder.

◆ SupportsReceiverProtocol() [2/2]

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

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

Member Data Documentation

◆ mInternalData

std::shared_ptr<PassThroughAudioEncoderInternalData> ttv::broadcast::PassThroughAudioEncoder::mInternalData
private

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