Intel® Collaboration Suite for WebRTC  version 4.3.1
Open WebRTC Toolkit (OWT) Client SDK for Windows*
owt::base::VideoEncoderInterface Class Referenceabstract

Video encoder interface. More...

#include <owt/base/videoencoderinterface.h>

Public Member Functions

virtual ~VideoEncoderInterface ()
 Destructor.
 
virtual bool InitEncoderContext (Resolution &resolution, uint32_t fps, uint32_t bitrate_kbps, VideoCodec video_codec)=0
 Initialize the customized video encoder. More...
 
virtual bool EncodeOneFrame (std::vector< uint8_t > &buffer, bool key_frame)=0
 Retrieve byte buffer from encoder that holds one complete frame. More...
 
virtual bool Release ()=0
 Release the resources that current encoder holds. More...
 
virtual VideoEncoderInterfaceCopy ()=0
 Duplicate the VideoEncoderInterface instance. More...
 

Detailed Description

Video encoder interface.

Internal webrtc encoder will request from this interface when it needs one complete encoded frame.

Member Function Documentation

◆ Copy()

virtual VideoEncoderInterface* owt::base::VideoEncoderInterface::Copy ( )
pure virtual

Duplicate the VideoEncoderInterface instance.

Returns
The newly created VideoEncoderInterface instance.

◆ EncodeOneFrame()

virtual bool owt::base::VideoEncoderInterface::EncodeOneFrame ( std::vector< uint8_t > &  buffer,
bool  key_frame 
)
pure virtual

Retrieve byte buffer from encoder that holds one complete frame.

The buffer is provided by caller and EncodedOneFrame implementation should copy encoded data to this buffer. After return, the caller owns the buffer and VideoEncoderInterface implementation should not assume the buffer valid.

Parameters
bufferOutput buffer that holds the encoded data.
key_frameIndicates whether we're requesting an AU representing an key frame.
Returns
Returns true if the encoder successfully returns one frame; returns false if the encoder fails to encode one frame.

◆ InitEncoderContext()

virtual bool owt::base::VideoEncoderInterface::InitEncoderContext ( Resolution resolution,
uint32_t  fps,
uint32_t  bitrate_kbps,
VideoCodec  video_codec 
)
pure virtual

Initialize the customized video encoder.

Parameters
resolutionResolution of frame to be encoded.
fpsEstimated frame rate expected.
bitrate_kbpsbitrate in kbps the caller expect the encoder to output at current resolution and frame rate.
video_codeccodec type requested.
Returns
Return true if successfully inited the encoder context; Return false on failing to init the encoder context.

◆ Release()

virtual bool owt::base::VideoEncoderInterface::Release ( )
pure virtual

Release the resources that current encoder holds.

Returns
Return true if successfully released the encoder; return false if the release fails.