|
Twitch SDK (Internal)
|
#include <ivideoencoderplugin.h>
Classes | |
| struct | EncodeInput |
| struct | EncodeOutput |
Public Member Functions | |
| virtual TTV_ErrorCode | Start (const ttv::broadcast::VideoParams &videoParams)=0 |
| virtual TTV_ErrorCode | EncodeFrame (const EncodeInput &input, EncodeOutput &output)=0 |
| virtual TTV_ErrorCode | GetSpsPps (ITTVBuffer *outSps, ITTVBuffer *outPps)=0 |
| virtual ttv::broadcast::YUVFormat | GetRequiredYUVFormat () const =0 |
| virtual const char * | GetName () const =0 |
ITTVPluginVideoEncoder - Pure Interface for video encoders
Implement this class if you would like twitchSDK to use your own encoder instead of the supplied default encoders.
| struct ITTVPluginVideoEncoder::EncodeInput |
Structure passed into EncodeFrame with details about the source data
| Class Members | ||
|---|---|---|
| const uint8_t * | source |
source - Parameter that will hold the pointer to the surface that was passed in during the call to TTV_SubmitVideoFrame. The data pointed to will not have been modified. |
| uint64_t | timeStamp |
timeStamp - The internal timestamp of the frame being encoded. Ensure that the output frame that corresponds to the inputframe has the corresponding timestamp |
| const uint8_t * | yuvPlanes[4] |
yuvPlanes - Buffers that will contain the converted and flipped if requested image data. The pointers will correspond to the buffers of the YUV conversion requested in GetRequiredYUVFormat(). If the YUV conversion is not requested (TTV_YUV_NONE) these pointers will be null |
| struct ITTVPluginVideoEncoder::EncodeOutput |
Structure passed into EncodeFrame that will receieve details about the encoded data
| Class Members | ||
|---|---|---|
| ITTVBuffer * | frameData |
frameData - Buffer to store the output of the encoding. Do not persist this pointer, it will become invalid after EncodeFrame returns |
| uint64_t | frameTimeStamp |
frameTimeStamp - The timestamp of the input frame that this output frame corresponds to |
| bool | isKeyFrame |
isKeyFrame - Denotes if the encoded frame is a keyframe (IDR or I) |
|
pure virtual |
EncodeFrame - Encode a frame of video.
| [in] | input | - See remarks |
| [out] | output | - See remarks |
Due to the async / buffered nature of encoders, not even call to EncodeFrame has to return the h264 encoded data for that specific frame
If the encoder needs to buffer up the input frame before an output frame can be emitted, return TTV_WRN_NOMOREDATA and make sure not to add data to the frameData member of output
When shutting down the encoder, EncodeFrame will be called with empty input packets (source pointer will be null). This will happen until there is no output received
|
pure virtual |
GetName - Return a string to identify the encoder used. Please use a descriptive enough string for us at twitch to be able to differentiate what encoders are used.
|
pure virtual |
GetRequiredYUVFormat - If the encoder requires image data to be converted to YUV, return the value of the specific format you would like. If you need the image flipped vertically, this is where it will be done too.
|
pure virtual |
GetSpsPps - Get the Sps/Pps values for the encode session
|
pure virtual |
Start - Called when the encoder is started up
| [in] | videoParams | - Parameters needed by the encoder. |
1.8.13