diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-12-15 17:56:06 -0500 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-01-15 21:24:17 -0500 |
commit | 5ee5fa021f32e0506bed6ebd183c807d5162bc72 (patch) | |
tree | f6371f3fb6596b801196abc24fe571f31944a74f /libavcodec/avcodec.h | |
parent | d78062386e425deafe9a08d109cff70b7a2de22c (diff) | |
download | ffmpeg-5ee5fa021f32e0506bed6ebd183c807d5162bc72.tar.gz |
avcodec: add a public function, avcodec_fill_audio_frame().
This is a convenience function for the user to fill audio AVFrame information.
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r-- | libavcodec/avcodec.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 49d2a0f918..a5071aa438 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -4239,6 +4239,26 @@ int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples); /** + * Fill audio frame data and linesize. + * AVFrame extended_data channel pointers are allocated if necessary for + * planar audio. + * + * @param frame the AVFrame + * frame->nb_samples must be set prior to calling the + * function. This function fills in frame->data, + * frame->extended_data, frame->linesize[0]. + * @param nb_channels channel count + * @param sample_fmt sample format + * @param buf buffer to use for frame data + * @param buf_size size of buffer + * @param align plane size sample alignment + * @return 0 on success, negative error code on failure + */ +int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, + enum AVSampleFormat sample_fmt, const uint8_t *buf, + int buf_size, int align); + +/** * Encode a video frame from pict into buf. * The input picture should be * stored using a specific format, namely avctx.pix_fmt. |