Files
ffmpeg/libavutil/frame_internal.h
Michael Niedermayer 501d815ec4 avutil/frame: let libavutil allocate a video frame's buffer with its own allocator
ff_frame_get_video_buffer() lays a video frame out like
av_frame_get_buffer() does, but takes the buffer from a callback, so
that the memory can come from a pool or from a device specific
allocator.

Assisted-by: Claude
2026-10-21 19:32:23 +00:00

38 lines
1.3 KiB
C

/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_FRAME_INTERNAL_H
#define AVUTIL_FRAME_INTERNAL_H
#include <stddef.h>
#include "buffer.h"
#include "frame.h"
/**
* Allocate the buffer of a video frame like av_frame_get_buffer().
*
* @param alloc allocates the buffer, av_buffer_alloc() is used if NULL
* @param opaque passed to alloc
*/
int ff_frame_get_video_buffer(AVFrame *frame, int align,
AVBufferRef *(*alloc)(void *opaque, size_t size),
void *opaque);
#endif /* AVUTIL_FRAME_INTERNAL_H */