Initialize a reference-counted packet from av_malloc()ed data.
@param pkt packet to be initialized. This function will set the data, size,
buf and destruct fields, all others are left untouched.
@param data Data allocated by av_malloc() to be used as packet data. If this
function returns successfully, the data is owned by the underlying AVBuffer.
The caller may not access the data through other means.
@param size size of data in bytes, without the padding. I.e. the full buffer
size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE.
Initialize a reference-counted packet from av_malloc()ed data.
@param pkt packet to be initialized. This function will set the data, size, buf and destruct fields, all others are left untouched. @param data Data allocated by av_malloc() to be used as packet data. If this function returns successfully, the data is owned by the underlying AVBuffer. The caller may not access the data through other means. @param size size of data in bytes, without the padding. I.e. the full buffer size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE.
@return 0 on success, a negative AVERROR on error