The following fields must be set on frame before calling this function:
- format (pixel format for video, sample format for audio)
- width and height for video
- nb_samples and channel_layout for audio
This function will fill AVFrame.data and AVFrame.buf arrays and, if
necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf.
For planar formats, one buffer will be allocated for each plane.
@warning: if frame already has been allocated, calling this function will
leak memory. In addition, undefined behavior can occur in certain
cases.
@param frame frame in which to store the new buffers.
@param align Required buffer size alignment. If equal to 0, alignment will be
chosen automatically for the current CPU. It is highly
recommended to pass 0 here unless you know what you are doing.
@return 0 on success, a negative AVERROR on error.
Allocate new buffer(s) for audio or video data.
The following fields must be set on frame before calling this function: - format (pixel format for video, sample format for audio) - width and height for video - nb_samples and channel_layout for audio
This function will fill AVFrame.data and AVFrame.buf arrays and, if necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf. For planar formats, one buffer will be allocated for each plane.
@warning: if frame already has been allocated, calling this function will leak memory. In addition, undefined behavior can occur in certain cases.
@param frame frame in which to store the new buffers. @param align Required buffer size alignment. If equal to 0, alignment will be chosen automatically for the current CPU. It is highly recommended to pass 0 here unless you know what you are doing.
@return 0 on success, a negative AVERROR on error.