Ascend 310 acldvpp API |
Ascend 310P hi_mpi API |
What You Need to Do |
|---|---|---|
The callback function has been registered when the channel description information is set and it is automatically called each time when a frame of data is encoded. The memory address and memory size of the encoded data are obtained by using the corresponding get method in the callback function. acldvppGetStreamDescData acldvppGetStreamDescSize acldvppGetStreamDescFormat acldvppGetStreamDescTimestamp |
Obtain the encoding result of a frame using hi_mpi_venc_get_stream, and then obtain the encoded data from the following members of the hi_venc_stream struct: hi_venc_stream.pack[i].addr hi_venc_stream.pack[i].len hi_venc_stream.pack[i].data_type (obtain the output image format from this member struct) hi_venc_stream.pack[i].pts |
Modify your code to start another thread and call the hi_mpi_venc_get_stream API to proactively obtain the encoding result. Note to obtain the number of encoded packets (n) using hi_mpi_venc_query_status. Before calling hi_mpi_venc_get_stream, allocate memory whose size must be at least n times sizeof(hi_venc_pack) to the hi_venc_stream.pack parameter. After the encoding result is obtained successfully, call the hi_mpi_venc_release_stream API to release the stream buffer. |
No corresponding API. The encoder does not need to be instructed to stop receiving data frames to be encoded. |
Notify the encoder of stopping receiving data frames to be encoded (the API needs to be called only once per channel): hi_mpi_venc_stop_chn |
Add the hi_mpi_venc_stop_chn API call in your code. |