VdecConfig

Function

Defines video stream decoding.

Structure Definition

struct VdecConfig {
    uint32_t width = 0;
    uint32_t height = 0;
    MxbaseStreamFormat inputVideoFormat = MXBASE_STREAM_FORMAT_H264_MAIN_LEVEL;
    MxbasePixelFormat outputImageFormat = MXBASE_PIXEL_FORMAT_YUV_SEMIPLANAR_420;
    uint32_t channelId = 0;
    uint32_t deviceId  = 0;
    pthread_t threadId  = 0; 
    DecodeCallBackFunction callbackFunc = nullptr; 
    uint32_t outMode = 0;
    uint32_t videoChannel = 0;
    uint32_t skipInterval = 0;
    void* userData = nullptr;
};

Parameter Description

Parameter

Input/Output

Description

width

Input

Image width.

height

Input

Image height.

inputVideoFormat

Input

Format of the input image.

outputImageFormat

Input

Format of the output image.

channelId

Input

ID of a decoding channel.

deviceId

Input

Device ID.

threadId

Input

ID of a callback thread.

callbackFunc

Input

Callback.

The structure is as follows:

APP_ERROR (*DecodeCallBackFunction)(std::shared_ptr<void> buffer, DvppDataInfo& dvppDataInfo, void* userData)
  • buffer: output data after decoding.
  • dvppDataInfo: output data information after decoding.
  • userData: user-defined data pointer.

outMode

Input

Frame output mode. The value can be 0 or 1. The default value is 0.

  • 0: delayed frame output mode. The VDEC starts to output the decoding result only after receiving multiple frames in the stream.
  • 1: real-time frame output mode. VDEC starts to output the decoding result in real time after receiving one frame in the stream. Only H.264/H.265 standard streams with simple reference relationships are supported (no long-term reference frames or B-frames).

videoChannel

Input

Reserved.

skipInterval

Input

Frame skipping parameter.

userData

Input

Customized data.