Init
Function Usage
Initialize the GPU-accelerated instance.
Restrictions
N/A
Prototype
int32_t Init(EncoderConfig &config) = 0
Parameters
Field Name |
Input/Output |
Field Type |
Description |
|---|---|---|---|
config |
Input |
EncoderConfig & |
EncoderConfig structure reference type, GPU encoding configuration item. |
The EncoderConfig structures and related enumeration definitions are as follows:
enum EncoderCapability : uint32_t {
CAP_NONE,
CAP_FORMAT_CONVERT, // Enables the format conversion capability.
CAP_VA_ENCODE_H264, // Enables the H.264 encoding capability.
CAP_VA_ENCODE_HEVC, // Enables the H.265 encoding capability.
};
enum DeviceNode : uint32_t {
DEV_DRI_RENDERD128 = 128, // 128 rendering node.
DEV_DRI_RENDERD129 = 129, // 129 rendering node.
DEV_DRI_RENDERD130 = 130, // 130 rendering node.
DEV_DRI_RENDERD131 = 131, // 131 rendering node.
};
struct FrameSize {
uint32_t width; // Image width.
uint32_t height; // Image height.
uint32_t widthAligned; // Image width after alignment.
uint32_t heightAligned; // Image height after alignment.
}
struct EncoderConfig {
EncoderCapability capability = CAP_NONE;
DeviceNode deviceNode = DEV_DRI_OTHER;
FrameSize inSize = {};
FrameSize outSize = {};
};
Returns
Data type: GpuEncoderErrorCode
The value can be:
- OK: The GPU-accelerated instance is successfully initialized.
- Other values except OK: The GPU-accelerated instance fails to be initialized.