|
mw_venc_status_t | mw_venc_get_default_param (mw_venc_param_t *p_param) |
| Gets the default value of encoding parameters. More...
|
|
mw_venc_handle_t | mw_venc_create (mw_venc_param_t *p_param, MW_ENCODER_CALLBACK callback, MW_ENCODER_CALLBACK_NALU callback_nalu, void *user_ptr) |
| Creates an encoder. More...
|
|
mw_venc_status_t | mw_venc_put_imagebuffer (mw_venc_handle_t handle, CVImageBufferRef image_buffer, int64_t pts) |
| Imports data to encoders. More...
|
|
mw_venc_status_t | mw_venc_put_frame (mw_venc_handle_t handle, uint8_t *p_frame, int64_t pts) |
| Imports data to encoders. More...
|
|
mw_venc_status_t | mw_venc_destory (mw_venc_handle_t handle) |
| Destroys encoders. More...
|
|
mw_venc_status_t | mw_venc_get_property (mw_venc_handle_t handle, mw_venc_property_t param, void *args) |
| Gets encoder parameters. More...
|
|
mw_venc_status_t | mw_venc_set_property (mw_venc_handle_t handle, mw_venc_property_t param, void *args) |
| Sets encoder parameters. More...
|
|
◆ MW_ENCODER_CALLBACK
typedef void(* MW_ENCODER_CALLBACK) (void *user_ptr, const uint8_t *p_frame, uint32_t frame_len, mw_venc_frame_info_t *p_frame_info) |
Callback functions.
out code date.
Related function(s):
mw_venc_create
mw_venc_create_ex
◆ mw_venc_create()
Creates an encoder.
- Parameters
-
[in] | platform | Hardware encoding platform |
[in] | p_param | Encoder parameters |
[in] | frame_callback | Encoder callback function |
[in] | user_ptr | Callback parameter |
- Returns
- Returns the encoder handle if succeeded, otherwise returns NULL.
Usage:
The recommended way to call the function is as follows.
....
void encode_callback(
void * user_ptr,
const uint8_t * p_frame,
uint32_t frame_len,
{
}
...
mw_venc_init();
...
mw_venc_handle_t t_handle = NULL;
t_venc_param.
width = 1920;
...
...
...
...
t_fps.num = 30;
...
t_handle = NULL;
...
mw_venc_deinit();
...
◆ mw_venc_destory()
Destroys encoders.
- Parameters
-
- Returns
- The possible return values of mw_venc_status_t are as follows.
Usage:
The usage refers to mw_venc_create mw_venc_create_by_index
◆ mw_venc_get_default_param()
Gets the default value of encoding parameters.
- Parameters
-
[out] | p_param | encoding parameters |
- Returns
- The values of returned mw_venc_status_t are as follows.
Related type(s):
mw_venc_param_t
Sets the default value of the parameters.
p_param->rate_control.target_bitrate = 0;
p_param->rate_control.max_bitrate = 0;
p_param->width = 0;
p_param->height = 0;
p_param->fps.num = 60;
p_param->fps.den = 1;
p_param->slice_num = 1;
p_param->gop_pic_size = 60;
p_param->gop_ref_size = 1;
p_param->amd_mem_reserved = MW_VENC_AMD_MEM_DX;
◆ mw_venc_get_property()
Gets encoder parameters.
- Parameters
-
[in] | handle | Encoder handle |
[in] | param | Parameter type |
[out] | args | Parameter values |
- Returns
- The possible return values of mw_venc_status_t are as follows.
Usage:
The usage refers to mw_venc_create mw_venc_create_by_index
◆ mw_venc_put_frame()
mw_venc_status_t mw_venc_put_frame |
( |
mw_venc_handle_t |
handle, |
|
|
uint8_t * |
p_frame, |
|
|
int64_t |
pts |
|
) |
| |
Imports data to encoders.
- Parameters
-
[in] | handle | Encoder handle |
[in] | p_frame | Frame data |
[in] | pts | Time stamp |
- Returns
- The possible return values of mw_venc_status_t are as follows.
Usage:
The usage refers to mw_venc_create
mw_venc_create_by_index
◆ mw_venc_put_imagebuffer()
mw_venc_status_t mw_venc_put_imagebuffer |
( |
mw_venc_handle_t |
handle, |
|
|
CVImageBufferRef |
image_buffer, |
|
|
int64_t |
pts |
|
) |
| |
Imports data to encoders.
- Parameters
-
[in] | handle | Encoder handle |
[in] | p_frame | Frame data |
- Returns
- The possible return values of mw_venc_status_t are as follows.
Usage:
The usage refers to mw_venc_create
mw_venc_create_by_index
◆ mw_venc_set_property()
Sets encoder parameters.
- Parameters
-
[in] | handle | Encoder handle @parma[in] param Parameter type |
[in] | args | Parameter values |
- Returns
- The possible return values of mw_venc_status_t are as follows.
Usage:
The usage refers to mw_venc_create mw_venc_create_by_index
H264 main.
Definition: mw_venc_common.h:156
mw_venc_status_t mw_venc_put_frame(mw_venc_handle_t handle, uint8_t *p_frame, int64_t pts)
Imports data to encoders.
Frame rate: mw_venc_fps_t default 60/1.
Definition: mw_venc_common.h:290
int32_t height
Height of input video.
Definition: mw_venc_common.h:426
NV12 equals MWFOURCC_NV12.
Definition: mw_venc_common.h:200
mw_venc_frame_info_t @detials Defines the types infomation of frame to be encoded....
Definition: mw_venc_common.h:59
mw_venc_profile_t profile
Profile.
Definition: mw_venc_common.h:431
mw_venc_targetusage_t targetusage
Preset.
Definition: mw_venc_common.h:423
Level 5.1.
Definition: mw_venc_common.h:179
mw_venc_code_type_t code_type
Code type, H264 or H265.
Definition: mw_venc_common.h:421
mw_venc_status_t mw_venc_destory(mw_venc_handle_t handle)
Destroys encoders.
int32_t width
width of input video
Definition: mw_venc_common.h:425
mw_venc_handle_t mw_venc_create(mw_venc_param_t *p_param, MW_ENCODER_CALLBACK callback, MW_ENCODER_CALLBACK_NALU callback_nalu, void *user_ptr)
Creates an encoder.
mw_venc_param_t
Definition: mw_venc_common.h:420
mw_venc_rate_control_mode_t mode
Bitrate controlling methods.
Definition: mw_venc_common.h:229
int32_t den
Denominator of frames.
Definition: mw_venc_common.h:259
enum mw_venc_status mw_venc_status_t
mw_venc_status_t
mw_venc_status_t mw_venc_get_property(mw_venc_handle_t handle, mw_venc_property_t param, void *args)
Gets encoder parameters.
mw_venc_status_t mw_venc_set_property(mw_venc_handle_t handle, mw_venc_property_t param, void *args)
Sets encoder parameters.
mw_venc_rate_control_t rate_control
Frame control.
Definition: mw_venc_common.h:424
uint32_t target_bitrate
Target bitrate(kbit/s): only valid when the bitrate is variable or constant.
Definition: mw_venc_common.h:232
mw_venc_fourcc_t fourcc
Color format of input data.
Definition: mw_venc_common.h:422
Balance the coding quality and speed.
Definition: mw_venc_common.h:114
H264.
Definition: mw_venc_common.h:94
mw_venc_status_t mw_venc_get_default_param(mw_venc_param_t *p_param)
Gets the default value of encoding parameters.
Unknown.
Definition: mw_venc_common.h:154
Constant Bit Rate.
Definition: mw_venc_common.h:135
Unknown.
Definition: mw_venc_common.h:199
Unknown.
Definition: mw_venc_common.h:91
Unknown.
Definition: mw_venc_common.h:134
mw_venc_fps_t
Definition: mw_venc_common.h:257
Success.
Definition: mw_venc_common.h:306