Called at the beginning of each frame to get a buffer for it.
The function will set AVFrame.data[], AVFrame.linesize[].
AVFrame.extended_data[] must also be set, but it should be the same as
AVFrame.data[] except for planar audio with more channels than can fit
in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as
many data pointers as it can hold.
if CODEC_CAP_DR1 is not set then get_buffer() must call
avcodec_default_get_buffer() instead of providing buffers allocated by
some other means.
AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't
need it. avcodec_default_get_buffer() aligns the output buffer properly,
but if get_buffer() is overridden then alignment considerations should
be taken into account.
@see avcodec_default_get_buffer()
Video:
If pic.reference is set then the frame will be read later by libavcodec.
avcodec_align_dimensions2() should be used to find the required width and
height, as they normally need to be rounded up to the next multiple of 16.
If frame multithreading is used and thread_safe_callbacks is set,
it may be called from a different thread, but not from more than one at
once. Does not need to be reentrant.
Decoders request a buffer of a particular size by setting
AVFrame.nb_samples prior to calling get_buffer(). The decoder may,
however, utilize only part of the buffer by setting AVFrame.nb_samples
to a smaller value in the output frame.
Decoders cannot use the buffer after returning from
avcodec_decode_audio4(), so they will not call release_buffer(), as it
is assumed to be released immediately upon return. In some rare cases,
a decoder may need to call get_buffer() more than once in a single
call to avcodec_decode_audio4(). In that case, when get_buffer() is
called again after it has already been called once, the previously
acquired buffer is assumed to be released at that time and may not be
reused by the decoder.
As a convenience, av_samples_get_buffer_size() and
av_samples_fill_arrays() in libavutil may be used by custom get_buffer()
functions to find the required data size and to fill data pointers and
linesize. In AVFrame.linesize, only linesize[0] may be set for audio
since all planes must be the same size.
Called at the beginning of each frame to get a buffer for it.
The function will set AVFrame.data[], AVFrame.linesize[]. AVFrame.extended_data[] must also be set, but it should be the same as AVFrame.data[] except for planar audio with more channels than can fit in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as many data pointers as it can hold.
if CODEC_CAP_DR1 is not set then get_buffer() must call avcodec_default_get_buffer() instead of providing buffers allocated by some other means.
AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't need it. avcodec_default_get_buffer() aligns the output buffer properly, but if get_buffer() is overridden then alignment considerations should be taken into account.
@see avcodec_default_get_buffer()
Video:
If pic.reference is set then the frame will be read later by libavcodec. avcodec_align_dimensions2() should be used to find the required width and height, as they normally need to be rounded up to the next multiple of 16.
If frame multithreading is used and thread_safe_callbacks is set, it may be called from a different thread, but not from more than one at once. Does not need to be reentrant.
@see release_buffer(), reget_buffer() @see avcodec_align_dimensions2()
Audio:
Decoders request a buffer of a particular size by setting AVFrame.nb_samples prior to calling get_buffer(). The decoder may, however, utilize only part of the buffer by setting AVFrame.nb_samples to a smaller value in the output frame.
Decoders cannot use the buffer after returning from avcodec_decode_audio4(), so they will not call release_buffer(), as it is assumed to be released immediately upon return. In some rare cases, a decoder may need to call get_buffer() more than once in a single call to avcodec_decode_audio4(). In that case, when get_buffer() is called again after it has already been called once, the previously acquired buffer is assumed to be released at that time and may not be reused by the decoder.
As a convenience, av_samples_get_buffer_size() and av_samples_fill_arrays() in libavutil may be used by custom get_buffer() functions to find the required data size and to fill data pointers and linesize. In AVFrame.linesize, only linesize[0] may be set for audio since all planes must be the same size.
@see av_samples_get_buffer_size(), av_samples_fill_arrays()
- encoding: unused - decoding: Set by libavcodec, user can override.
@deprecated use get_buffer2()