class cv::cudacodec::EncoderCallBack

Overview

Callbacks for CUDA video encoder. More…

#include <cudacodec.hpp>

class EncoderCallBack
{
public:
    // enums

    enum PicType;

    // methods

    virtual
    uchar*
    acquireBitStream(int* bufferSize) = 0;

    virtual
    void
    onBeginFrame(
        int frameNumber,
        PicType picType
        ) = 0;

    virtual
    void
    onEndFrame(
        int frameNumber,
        PicType picType
        ) = 0;

    virtual
    void
    releaseBitStream(
        unsigned char* data,
        int size
        ) = 0;
};

Detailed Documentation

Callbacks for CUDA video encoder.

Methods

virtual
uchar*
acquireBitStream(int* bufferSize) = 0

Callback function to signal the start of bitstream that is to be encoded.

Callback must allocate buffer for CUDA encoder and return pointer to it and it’s size.

virtual
void
onBeginFrame(
    int frameNumber,
    PicType picType
    ) = 0

Callback function to signal that the encoding operation on the frame has started.

Parameters:

frameNumber  
picType Specify frame type (I-Frame, P-Frame or B-Frame).
virtual
void
onEndFrame(
    int frameNumber,
    PicType picType
    ) = 0

Callback function signals that the encoding operation on the frame has finished.

Parameters:

frameNumber  
picType Specify frame type (I-Frame, P-Frame or B-Frame).
virtual
void
releaseBitStream(
    unsigned char* data,
    int size
    ) = 0

Callback function to signal that the encoded bitstream is ready to be written to file.