90 ptrdiff_t linesize1[4];
105 for (
i = 0;
i < 4;
i++)
109 for (
i = 0;
i < 4;
i++)
110 linesize1[
i] = linesize[
i];
115 for (
i = 0;
i < 4;
i++) {
123 CONFIG_MEMORY_POISONING ?
140 frame->ch_layout.nb_channels,
146 CONFIG_MEMORY_POISONING ?
149 if (!pool->
pools[0]) {
184 sizeof(*
frame->extended_buf));
185 if (!
frame->extended_data || !
frame->extended_buf) {
201 for (
i = 0;
i <
frame->nb_extended_buf;
i++) {
203 if (!
frame->extended_buf[
i])
227 memset(pic->
data, 0,
sizeof(pic->
data));
230 for (
i = 0;
i < 4 && pool->
pools[
i];
i++) {
265 "frame from a fixed pool of hardware frames.\n",
269 "extra_hw_frames to a larger value "
270 "(currently set to %d, giving a pool size of %d).\n",
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Libavcodec external API header.
Convenience header that includes libavutil's core.
refcounted data buffer API
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
reference-counted frame API
#define AV_NUM_DATA_POINTERS
static int update_frame_pool(AVCodecContext *avctx, AVFrame *frame)
static int video_get_buffer(AVCodecContext *s, AVFrame *pic)
static int audio_get_buffer(AVCodecContext *avctx, AVFrame *frame)
static void frame_pool_free(AVRefStructOpaque unused, void *obj)
int avcodec_default_get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags)
The default callback for AVCodecContext.get_buffer2().
void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int linesize_align[AV_NUM_DATA_POINTERS])
Modify width and height values so that they will result in a memory buffer that is acceptable for the...
AVBufferRef * av_buffer_allocz(size_t size)
Same as av_buffer_alloc(), except the returned buffer will be initialized to zero.
void av_buffer_pool_uninit(AVBufferPool **ppool)
Mark the pool as being available for freeing.
AVBufferPool * av_buffer_pool_init(size_t size, AVBufferRef *(*alloc)(size_t size))
Allocate and initialize a buffer pool.
AVBufferRef * av_buffer_pool_get(AVBufferPool *pool)
Allocate a new AVBuffer, reusing an old buffer from the pool when available.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_image_fill_plane_sizes(size_t sizes[4], enum AVPixelFormat pix_fmt, int height, const ptrdiff_t linesizes[4])
Fill plane sizes for an image with pixel format pix_fmt and height height.
int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width)
Fill plane linesizes for an image with pixel format pix_fmt and width width.
int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
Check if the sample format is planar.
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align)
Get the required buffer size for the given audio parameters.
int av_hwframe_get_buffer(AVBufferRef *hwframe_ref, AVFrame *frame, int flags)
Allocate a new frame attached to the given AVHWFramesContext.
common internal api header.
Libavutil version macros.
static const struct @257111027162314367033347246032313251342043035002 planes[]
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
void av_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
static void * av_refstruct_alloc_ext(size_t size, unsigned flags, void *opaque, void(*free_cb)(AVRefStructOpaque opaque, void *obj))
A wrapper around av_refstruct_alloc_ext_c() for the common case of a non-const qualified opaque.
#define FF_ARRAY_ELEMS(a)
uint8_t * data
The data buffer.
main external API structure.
AVBufferRef * hw_frames_ctx
A reference to the AVHWFramesContext describing the input (for encoding) or output (decoding) frames.
enum AVMediaType codec_type
int extra_hw_frames
Video decoding only.
int coded_width
Bitstream width / height, may be different from width/height e.g.
struct AVCodecInternal * internal
Private context used for internal data.
int warned_on_failed_allocation_from_fixed_pool
Set when the user has been warned about a failed allocation from a fixed frame pool.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVBufferRef * buf[AV_NUM_DATA_POINTERS]
AVBuffer references backing the data for this frame.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
uint8_t ** extended_data
pointers to the data planes/channels.
This struct describes a set or pool of "hardware" frames (i.e.
enum AVPixelFormat format
The pixel format identifying the underlying HW surface type.
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
int initial_pool_size
Initial size of the frame pool.
int stride_align[AV_NUM_DATA_POINTERS]
AVBufferPool * pools[4]
Pools for each data plane.
RefStruct is an API for creating reference-counted objects with minimal overhead.