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

#include <intelvideoencoder.h>

Inheritance diagram for ttv::broadcast::IntelVideoEncoder:
ttv::broadcast::IVideoEncoder

Public Member Functions

 IntelVideoEncoder ()
 
virtual ~IntelVideoEncoder ()
 
virtual std::string GetName () const override
 
virtual bool SupportsBitRateAdjustment () const override
 
virtual TTV_ErrorCode SetFrameWriter (const std::shared_ptr< IFrameWriter > &frameWriter) override
 
virtual TTV_ErrorCode ValidateVideoParams (const VideoParams &videoParams) const override
 
virtual TTV_ErrorCode Initialize () override
 
virtual TTV_ErrorCode Shutdown () override
 
virtual TTV_ErrorCode Start (uint32_t streamIndex, const VideoParams &videoParams) override
 
virtual TTV_ErrorCode SubmitFrame (const std::shared_ptr< VideoFrame > &videoFrame) override
 
virtual TTV_ErrorCode Stop () override
 
virtual TTV_ErrorCode GetSpsPps (std::vector< uint8_t > &sps, std::vector< uint8_t > &pps) override
 
virtual TTV_ErrorCode ValidateFrame (const std::shared_ptr< VideoFrame > &videoframe) override
 
virtual TTV_ErrorCode SetTargetBitRate (uint32_t kbps) override
 
virtual bool SupportsReceiverProtocol (IVideoFrameReceiver::ReceiverTypeId typeId) const override
 
virtual std::shared_ptr< IVideoFrameReceiverGetReceiverImplementation (IVideoFrameReceiver::ReceiverTypeId typeId) override
 
template<typename T >
bool SupportsReceiverProtocol () const
 

Private Member Functions

void FlushFrames ()
 
void InternalStop ()
 
void SetupEncoderParams (const VideoParams &videoParams)
 
void DestroyEncodeTaskPool ()
 

Private Attributes

std::shared_ptr< IntelVideoEncoderInternalData > mInternalData
 

Constructor & Destructor Documentation

◆ IntelVideoEncoder()

ttv::broadcast::IntelVideoEncoder::IntelVideoEncoder ( )

◆ ~IntelVideoEncoder()

virtual ttv::broadcast::IntelVideoEncoder::~IntelVideoEncoder ( )
virtual

Member Function Documentation

◆ DestroyEncodeTaskPool()

void ttv::broadcast::IntelVideoEncoder::DestroyEncodeTaskPool ( )
private

◆ FlushFrames()

void ttv::broadcast::IntelVideoEncoder::FlushFrames ( )
private

◆ GetName()

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

Retrieves the name for logging purposes.

Implements ttv::broadcast::IVideoEncoder.

◆ GetReceiverImplementation()

virtual std::shared_ptr<IVideoFrameReceiver> ttv::broadcast::IntelVideoEncoder::GetReceiverImplementation ( IVideoFrameReceiver::ReceiverTypeId  typeId)
overridevirtual

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

Implements ttv::broadcast::IVideoEncoder.

◆ GetSpsPps()

virtual TTV_ErrorCode ttv::broadcast::IntelVideoEncoder::GetSpsPps ( std::vector< uint8_t > &  sps,
std::vector< uint8_t > &  pps 
)
overridevirtual

Called by the system to get the Sps/Pps data from the encoder.

Implements ttv::broadcast::IVideoEncoder.

◆ Initialize()

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

Initializes the encoder. The client is responsible for calling this before

Implements ttv::broadcast::IVideoEncoder.

◆ InternalStop()

void ttv::broadcast::IntelVideoEncoder::InternalStop ( )
private

◆ SetFrameWriter()

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

Called by the system before encoding begins.

Implements ttv::broadcast::IVideoEncoder.

◆ SetTargetBitRate()

virtual TTV_ErrorCode ttv::broadcast::IntelVideoEncoder::SetTargetBitRate ( uint32_t  kbps)
overridevirtual

Sets the desired bitrate in 1000s of bits per second. This will only have an effect if SupportsBitrateAdjustment() returns true. TTV_EC_UNSUPPORTED will be returned if not supported.

Implements ttv::broadcast::IVideoEncoder.

◆ SetupEncoderParams()

void ttv::broadcast::IntelVideoEncoder::SetupEncoderParams ( const VideoParams videoParams)
private

◆ Shutdown()

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

◆ Start()

virtual TTV_ErrorCode ttv::broadcast::IntelVideoEncoder::Start ( uint32_t  streamIndex,
const VideoParams videoParams 
)
overridevirtual

◆ Stop()

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

Called by the system when the stream is stopping.

Implements ttv::broadcast::IVideoEncoder.

◆ SubmitFrame()

virtual TTV_ErrorCode ttv::broadcast::IntelVideoEncoder::SubmitFrame ( const std::shared_ptr< VideoFrame > &  videoFrame)
overridevirtual

This will be called periodically to kick off an encode of a frame. This should not block to encode the frame synchronously.

Implements ttv::broadcast::IVideoEncoder.

◆ SupportsBitRateAdjustment()

virtual bool ttv::broadcast::IntelVideoEncoder::SupportsBitRateAdjustment ( ) const
overridevirtual

Determines whether or not the encoder supports changing the target bitrate on the fly.

Implements ttv::broadcast::IVideoEncoder.

◆ SupportsReceiverProtocol() [1/2]

virtual bool ttv::broadcast::IntelVideoEncoder::SupportsReceiverProtocol ( IVideoFrameReceiver::ReceiverTypeId  typeId) const
overridevirtual

Determines if the concrete implementation supports the given protocol.

Implements ttv::broadcast::IVideoEncoder.

◆ SupportsReceiverProtocol() [2/2]

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

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

◆ ValidateFrame()

virtual TTV_ErrorCode ttv::broadcast::IntelVideoEncoder::ValidateFrame ( const std::shared_ptr< VideoFrame > &  videoframe)
overridevirtual

Called by the system to validate each frame as it is processed.

Implements ttv::broadcast::IVideoEncoder.

◆ ValidateVideoParams()

virtual TTV_ErrorCode ttv::broadcast::IntelVideoEncoder::ValidateVideoParams ( const VideoParams videoParams) const
overridevirtual

Member Data Documentation

◆ mInternalData

std::shared_ptr<IntelVideoEncoderInternalData> ttv::broadcast::IntelVideoEncoder::mInternalData
private

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