MPI for encoder channel. More...
Data Structures | |
struct | MPI_BUF_SEG_S |
Struct for the buffer segment. More... | |
struct | MPI_STREAM_PARAMS_S |
Stream frame buffer parameter. More... | |
struct | MPI_STREAM_PARAMS_V2_S |
Stream frame buffer parameter. More... | |
struct | MPI_ENC_CHN_ATTR_S |
Struct for the encoder channel attributes. More... | |
struct | MPI_ENC_BIND_INFO_S |
Struct for the encoder channel binding info. More... | |
struct | MPI_MCVC_VBR_PARAM_S |
Struct for the parameters of rate control in variable bit rate mode for motion-compensation-based video compression standard. More... | |
struct | MPI_MCVC_CBR_PARAM_S |
Struct for the parameters of rate control in constant bit rate mode for motion-compensation-based video compression standard. More... | |
struct | MPI_MCVC_SBR_PARAM_S |
Struct for the parameters of rate control in smart bit rate mode for motion-compensation-based video compression standard. More... | |
struct | MPI_MCVC_CQP_PARAM_S |
Struct for the parameters of rate control in constant QP mode for motion-compensation-based video compression standard. More... | |
struct | MPI_MCVC_RC_ATTR_S |
Struct for rate control for Motion-Compensation-based Video Compression (MCVC) standard. More... | |
struct | MPI_VC_RC_ATTR_S |
Struct for rate control for intra-frame based video compression standard. More... | |
struct | MPI_VENC_ATTR_H264_S |
Struct for H264 encoder attribute. More... | |
struct | MPI_VENC_ATTR_H265_S |
Struct for H265 encoder attribute. More... | |
struct | MPI_VENC_ATTR_MJPEG_S |
Struct for MJPEG encoder attribute. More... | |
struct | MPI_VENC_ATTR_JPEG_S |
Struct for JPEG encoder attribute. More... | |
struct | MPI_VENC_ATTR_S |
Struct for video codec. More... | |
struct | MPI_VENC_ATTR_EX_S |
Struct for video codec extend. More... | |
struct | MPI_ENC_EVENT_S |
Struct for encoder event. More... | |
struct | MPI_VENC_INFO |
Struct for encoder information. More... | |
Macros | |
#define | MPI_ENC_MAX_FRAME_SEG_CNT 16 |
#define | MPI_ISP_MAX_WIN_NUM 9 |
Typedefs | |
typedef struct timespec | TIMESPEC_S |
typedef of struct timespec | |
Enumerations | |
enum | MPI_FRAME_TYPE_E { MPI_FRAME_TYPE_SPS = 0, MPI_FRAME_TYPE_PPS = 1, MPI_FRAME_TYPE_I = 2, MPI_FRAME_TYPE_P = 3, MPI_FRAME_TYPE_B = 4, MPI_FRAME_TYPE_NUM } |
Enumeration of frame type. More... | |
enum | MPI_RC_MODE_E { MPI_RC_MODE_VBR = 0, MPI_RC_MODE_CBR, MPI_RC_MODE_SBR, MPI_RC_MODE_CQP, MPI_RC_MODE_NUM } |
Enumeration of rate control mode. More... | |
enum | MPI_VENC_PRFL_E { MPI_PRFL_BASELINE = 0, MPI_PRFL_MAIN, MPI_PRFL_HIGH, MPI_PRFL_NUM } |
Enumeration of video codec profile. More... | |
enum | MPI_VENC_TYPE_E { MPI_VENC_TYPE_H264 = 0, MPI_VENC_TYPE_H265, MPI_VENC_TYPE_MJPEG, MPI_VENC_TYPE_JPEG, MPI_VENC_TYPE_NUM } |
Enumeration of video encoder type. More... | |
enum | MPI_VENC_OBS_MODE_E { MPI_VENC_OBS_DISABLE = 0, MPI_VENC_OBS_ENABLE, MPI_VENC_OBS_NUM } |
Enumeration of obs(optical-flow bit-rate) mode. More... | |
Functions | |
INT32 | MPI_ENC_createChn (MPI_ECHN chn_idx, const MPI_ENC_CHN_ATTR_S *p_chn_attr) |
Create a encoder channel and set its attributes. More... | |
INT32 | MPI_ENC_destroyChn (MPI_ECHN chn_idx) |
Destroy a encoder channel. More... | |
INT32 | MPI_ENC_bindToVideoChn (MPI_ECHN chn_idx, const MPI_ENC_BIND_INFO_S *p_bind_info) |
Binding an encoder channel to a video channel. More... | |
INT32 | MPI_ENC_unbindFromVideoChn (MPI_ECHN chn_idx) |
Unbind an encoder channel from a video channel. More... | |
INT32 | MPI_ENC_setChnAttr (MPI_ECHN chn_idx, const MPI_ENC_CHN_ATTR_S *p_chn_attr) |
Set the encoder channel attributes. More... | |
INT32 | MPI_ENC_getChnAttr (MPI_ECHN chn_idx, MPI_ENC_CHN_ATTR_S *p_chn_attr) |
Get the attributes of a encoder channel. More... | |
INT32 | MPI_ENC_setVencAttr (MPI_ECHN chn_idx, const MPI_VENC_ATTR_S *p_venc_attr) |
Set the video encoder channel attributes. More... | |
INT32 | MPI_ENC_getVencAttr (MPI_ECHN chn_idx, MPI_VENC_ATTR_S *p_venc_attr) |
Get the video encoder attributes. More... | |
INT32 | MPI_ENC_setVencAttrEx (MPI_ECHN chn_idx, const MPI_VENC_ATTR_EX_S *p_venc_attr_ex) |
Set video encoder attributes extend. More... | |
INT32 | MPI_ENC_getVencAttrEx (MPI_ECHN chn_idx, MPI_VENC_ATTR_EX_S *p_venc_attr_ex) |
Get the video encoder attributes extend. More... | |
INT32 | MPI_ENC_startChn (MPI_ECHN chn_idx) |
Start a encoder channel. More... | |
INT32 | MPI_ENC_stopChn (MPI_ECHN chn_idx) |
Stop a encoder channel. More... | |
INT32 | MPI_ENC_notifyEvent (MPI_ECHN idx, MPI_ENC_EVENT_S *event) |
Notify encoder to something changed to adjust encoder quality. More... | |
INT32 | MPI_ENC_queryVencInfo (MPI_ECHN chn_idx, MPI_VENC_INFO *p_venc_info) |
Query encoder video encode information. More... | |
INT32 | MPI_initBitStreamSystem (void) |
Initialize bit stream system. More... | |
INT32 | MPI_exitBitStreamSystem (void) |
Exit bit stream system. More... | |
MPI_BCHN | MPI_createBitStreamChn (MPI_ECHN chn_idx) |
Create a bit stream channel to get the bit stream data. More... | |
INT32 | MPI_destroyBitStreamChn (MPI_BCHN chn_idx) |
Destroy a bit stream channel. More... | |
INT32 | MPI_getBitStream (MPI_BCHN chn_idx, MPI_STREAM_PARAMS_S *stream_params, INT32 time_ms) |
Get bit stream data parameters of a encoder bit stream channel. More... | |
INT32 | MPI_getBitStreamV2 (MPI_BCHN idx, MPI_STREAM_PARAMS_V2_S *stream_params, INT32 time_ms) |
Get bit stream data parameters of a encoder bit stream channel. More... | |
INT32 | MPI_releaseBitStream (MPI_BCHN chn_idx, MPI_STREAM_PARAMS_S *stream_params) |
Release bit stream data parameters of a encoder bit stream channel. More... | |
INT32 | MPI_releaseBitStreamV2 (MPI_BCHN chn_idx, MPI_STREAM_PARAMS_V2_S *stream_params) |
Release bit stream data parameters of a encoder bit stream channel. More... | |
INT32 | MPI_ENC_getChnFrame (MPI_ECHN idx, MPI_STREAM_PARAMS_S *stream_params, INT32 time_ms) |
Get a snapshot jpeg of encoder channel. More... | |
INT32 | MPI_ENC_releaseChnFrame (MPI_ECHN idx, MPI_STREAM_PARAMS_S *stream_params) |
Release snapshot jpeg data of a encoder channel. More... | |
INT32 | MPI_ENC_getChnFrameV2 (MPI_ECHN idx, INT32 quality_idx, MPI_STREAM_PARAMS_V2_S *stream_params, INT32 time_ms) |
Get a snapshot jpeg of encoder channel. More... | |
INT32 | MPI_ENC_releaseChnFrameV2 (MPI_ECHN idx, MPI_STREAM_PARAMS_V2_S *stream_params) |
Release snapshot jpeg data of a encoder channel. More... | |
INT32 | MPI_ENC_requestIdr (MPI_ECHN idx) |
Request IDR frame. More... | |
MPI for encoder channel.
#define MPI_ENC_MAX_FRAME_SEG_CNT 16 |
Maximum frame segment count
#define MPI_ISP_MAX_WIN_NUM 9 |
Maximum window number supported by MPI
enum MPI_FRAME_TYPE_E |
enum MPI_RC_MODE_E |
enum MPI_VENC_OBS_MODE_E |
enum MPI_VENC_PRFL_E |
enum MPI_VENC_TYPE_E |
Create a bit stream channel to get the bit stream data.
[in] | idx | encoder channel index. |
MPI_INVALID_ENC_BCHN | invalid encoder channel index or create bit stream channel failed. |
Destroy a bit stream channel.
[in] | idx | bit stream channel index. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index in bit stream channel. |
others | failure. |
INT32 MPI_ENC_bindToVideoChn | ( | MPI_ECHN | idx, |
const MPI_ENC_BIND_INFO_S * | p_bind_info | ||
) |
Binding an encoder channel to a video channel.
[in] | idx | encoder channel index. |
[in] | p_bind_info | pointer to the binding info. |
MPI_SUCCESS | success |
others | failure |
INT32 MPI_ENC_createChn | ( | MPI_ECHN | idx, |
const MPI_ENC_CHN_ATTR_S * | p_chn_attr | ||
) |
Create a encoder channel and set its attributes.
[in] | idx | encoder channel index. |
[in] | p_chn_attr | pointer to the encoder channel attribute. |
MPI_SUCCESS | success |
others | failure |
Destroy a encoder channel.
[in] | idx | encoder channel index. |
MPI_SUCCESS | success |
others | failure |
INT32 MPI_ENC_getChnAttr | ( | MPI_ECHN | idx, |
MPI_ENC_CHN_ATTR_S * | p_chn_attr | ||
) |
Get the attributes of a encoder channel.
[in] | idx | encoder channel index. |
[out] | p_chn_attr | pointer to the encoder channel attribute. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_NULL_POINTER | input pointer is NULL. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index. |
others | failure. |
INT32 MPI_ENC_getChnFrame | ( | MPI_ECHN | idx, |
MPI_STREAM_PARAMS_S * | stream_params, | ||
int32_t | time_ms | ||
) |
Get a snapshot jpeg of encoder channel.
[in] | idx | encoder channel index. |
[in] | time_ms | timeout of get snapshot jpeg. |
[out] | stream_params | pointer to get the snapshot jpeg data parameters. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_NULL_POINTER | input pointer is NULL. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index. |
others | failure |
INT32 MPI_ENC_getChnFrameV2 | ( | MPI_ECHN | idx, |
int32_t | quality_idx, | ||
MPI_STREAM_PARAMS_V2_S * | stream_params, | ||
int32_t | time_ms | ||
) |
Get a snapshot jpeg of encoder channel.
[in] | idx | encoder channel index. |
[in] | time_ms | timeout of get snapshot jpeg. |
[in] | quality_idx | quality factor of the snapshot |
[out] | stream_params | pointer to get the snapshot jpeg data parameters. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_NULL_POINTER | input pointer is NULL. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index. |
others | failure |
INT32 MPI_ENC_getVencAttr | ( | MPI_ECHN | idx, |
MPI_VENC_ATTR_S * | p_venc_attr | ||
) |
Get the video encoder attributes.
[in] | idx | encoder channel index. |
[out] | p_venc_attr | pointer to the video encoder attribute. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_NULL_POINTER | input pointer is NULL. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index. |
others | failure. |
INT32 MPI_ENC_getVencAttrEx | ( | MPI_ECHN | idx, |
MPI_VENC_ATTR_EX_S * | p_venc_attr_ex | ||
) |
Get the video encoder attributes extend.
[in] | idx | encoder channel index. |
[out] | p_venc_attr_ex | pointer to the video encoder attribute extend. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_NULL_POINTER | input pointer is NULL. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index. |
MPI_FAILURE | unexpected fail. |
others | failure. |
INT32 MPI_ENC_notifyEvent | ( | MPI_ECHN | idx, |
MPI_ENC_EVENT_S * | event | ||
) |
Notify encoder to something changed to adjust encoder quality.
[in] | idx | encoder channel index. |
[in] | event | pointer to the encoder event attribute. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_NULL_POINTER | input pointer is NULL. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index. |
MPI_ERR_ENC_INVALID_PARAM | invalid parameters. |
others | failure. |
INT32 MPI_ENC_queryVencInfo | ( | MPI_ECHN | idx, |
MPI_VENC_INFO * | p_venc_info | ||
) |
Query encoder video encode information.
[in] | idx | encoder channel index. |
[in] | p_venc_info | pointer to the encoder information attribute. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_NULL_POINTER | input pointer is NULL. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index. |
MPI_ERR_ENC_INVALID_PARAM | invalid parameters. |
others | failure. |
INT32 MPI_ENC_releaseChnFrame | ( | MPI_ECHN | idx, |
MPI_STREAM_PARAMS_S * | stream_params | ||
) |
Release snapshot jpeg data of a encoder channel.
[in] | idx | encoder channel index. |
[in] | p_stream_params | pointer to release the snapshot jpeg data parameters. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_NULL_POINTER | input pointer is NULL. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index in bit stream channel. |
others | failure |
INT32 MPI_ENC_releaseChnFrameV2 | ( | MPI_ECHN | idx, |
MPI_STREAM_PARAMS_V2_S * | stream_params | ||
) |
Release snapshot jpeg data of a encoder channel.
[in] | idx | encoder channel index. |
[in] | p_stream_params | pointer to release the snapshot jpeg data parameters. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_NULL_POINTER | input pointer is NULL. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index in bit stream channel. |
others | failure |
Request IDR frame.
[in] | idx | encoder channel index. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index in bit stream channel. |
others | failure |
INT32 MPI_ENC_setChnAttr | ( | MPI_ECHN | idx, |
const MPI_ENC_CHN_ATTR_S * | p_chn_attr | ||
) |
Set the encoder channel attributes.
Set encoder channel attributes before call MPI_ENC_startChn()
[in] | idx | encoder channel index. |
[in] | p_chn_attr | pointer to the encoder channel attribute. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_NULL_POINTER | input pointer is NULL. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index. |
MPI_ERR_ENC_INVALID_PARAM | invalid parameters. |
others | failure. |
INT32 MPI_ENC_setVencAttr | ( | MPI_ECHN | idx, |
const MPI_VENC_ATTR_S * | p_venc_attr | ||
) |
Set the video encoder channel attributes.
Call MPI_ENC_setVencAttr() at least once before call MPI_ENC_startChn()
[in] | idx | encoder channel index. |
[in] | p_venc_attr | pointer to the video encoder attribute. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_NULL_POINTER | input pointer is NULL. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index. |
MPI_ERR_ENC_INVALID_PARAM | invalid parameters. |
others | failure. |
INT32 MPI_ENC_setVencAttrEx | ( | MPI_ECHN | idx, |
const MPI_VENC_ATTR_EX_S * | p_venc_attr_ex | ||
) |
Set video encoder attributes extend.
[in] | idx | encoder channel index. |
[in] | p_venc_attr_ex | pointer to the video encoder attribute extend. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_NULL_POINTER | input pointer is NULL. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index. |
MPI_ERR_ENC_INVALID_PARAM | invalid parameters. |
others | failure. |
Start a encoder channel.
[in] | idx | encoder channel index. |
MPI_SUCCESS | success |
others | failure |
Stop a encoder channel.
[in] | idx | encoder channel index. |
MPI_SUCCESS | success |
others | failure |
Unbind an encoder channel from a video channel.
[in] | idx | encoder channel index. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index. |
others | failure. |
INT32 MPI_exitBitStreamSystem | ( | void | ) |
Exit bit stream system.
MPI_SUCCESS | success. |
INT32 MPI_getBitStream | ( | MPI_BCHN | idx, |
MPI_STREAM_PARAMS_S * | p_stream_params, | ||
int32_t | time_ms | ||
) |
Get bit stream data parameters of a encoder bit stream channel.
[in] | idx | bit stream channel index. |
[in] | time_ms | timeout of get bit stream. |
[out] | p_stream_params | pointer to get the bit stream data parameters. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_NULL_POINTER | input pointer is NULL. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index in bit stream channel. |
MPI_ERR_ENC_INVALID_PARAM | invalid parameters. |
-EINTR | Interrupted by user |
-ENODATA | Encoder is not running |
-ETIMEDOUT | Wait time expires |
-EAGAIN | No available segment. Please try again. |
-EFAULT | Fail to read from/write to the user |
others | failure. |
INT32 MPI_getBitStreamV2 | ( | MPI_BCHN | idx, |
MPI_STREAM_PARAMS_V2_S * | p_stream_params, | ||
int32_t | time_ms | ||
) |
Get bit stream data parameters of a encoder bit stream channel.
[in] | idx | bit stream channel index. |
[in] | time_ms | timeout of get bit stream. |
[out] | p_stream_params | pointer to get the bit stream data parameters. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_NULL_POINTER | input pointer is NULL. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index in bit stream channel. |
MPI_ERR_ENC_INVALID_PARAM | invalid parameters. |
-EINTR | Interrupted by user |
-ENODATA | Encoder is not running |
-ETIMEDOUT | Wait time expires |
-EAGAIN | No available segment. Please try again. |
-EFAULT | Fail to read from/write to the user |
others | failure. |
INT32 MPI_initBitStreamSystem | ( | void | ) |
Initialize bit stream system.
MPI_SUCCESS | success. |
MPI_ERR_ENC_NOT_INIT | Initialization failed. |
others | failure. |
INT32 MPI_releaseBitStream | ( | MPI_BCHN | idx, |
MPI_STREAM_PARAMS_S * | p_stream_params | ||
) |
Release bit stream data parameters of a encoder bit stream channel.
[in] | idx | bit stream channel index. |
[in] | p_stream_params | pointer to release the bit stream data parameters. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_NULL_POINTER | input pointer is NULL. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index in bit stream channel. |
others | failure. |
INT32 MPI_releaseBitStreamV2 | ( | MPI_BCHN | idx, |
MPI_STREAM_PARAMS_V2_S * | p_stream_params | ||
) |
Release bit stream data parameters of a encoder bit stream channel.
[in] | idx | bit stream channel index. |
[in] | p_stream_params | pointer to release the bit stream data parameters. |
MPI_SUCCESS | success. |
MPI_ERR_ENC_NULL_POINTER | input pointer is NULL. |
MPI_ERR_ENC_INVALID_CHN | invalid encoder channel index in bit stream channel. |
others | failure |