FFmpeg: libavfilter/video.c Source File
Go to the documentation of this file. 1 /*
2 * Copyright 2007 Bobby Bingham
3 * Copyright Stefano Sabatini <stefasab gmail com>
4 * Copyright Vitor Sessak <vitor1001 gmail com>
5 *
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23 #include <string.h>
24 #include <stdio.h>
25
30
36
38 {
41 }
42 };
43
45 {
47 }
48
50 {
53 int pool_width = 0;
54 int pool_height = 0;
55 int pool_align = 0;
57
62
65
69
71 }
72
80 } else {
82 &pool_width, &pool_height,
83 &pool_format, &pool_align) < 0) {
85 }
86
87 if (pool_width !=
w || pool_height !=
h ||
89
97 }
98 }
99
103
108
110 }
111
113 {
115 }
116
118 {
120
122
123 if (
link->dstpad->get_buffer.video)
125
128
130 }
AVFrame * ff_default_get_video_buffer2(AVFilterLink *link, int w, int h, int align)
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
AVPixelFormat
Pixel format.
static FilterLinkInternal * ff_link_internal(AVFilterLink *link)
FFFramePool * ff_frame_pool_video_init(AVBufferRef *(*alloc)(size_t size), int width, int height, enum AVPixelFormat format, int align)
Allocate and initialize a video frame pool.
uint8_t * data
The data buffer.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
enum AVColorSpace colorspace
YUV colorspace type.
This structure describes decoded (raw) audio or video data.
A link between two filters.
AVFrame * ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
enum AVAlphaMode alpha_mode
Indicates how the alpha channel of the video is to be handled.
int ff_frame_pool_get_video_config(FFFramePool *pool, int *width, int *height, enum AVPixelFormat *format, int *align)
Get the video frame pool configuration.
A filter pad used for either input or output.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
AVFrame * ff_frame_pool_get(FFFramePool *pool)
Allocate a new AVFrame, reusing old buffers from the pool when available.
Filter the word "frame" indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a link
size_t av_cpu_max_align(void)
Get the maximum data alignment that may be required by FFmpeg.
void ff_frame_pool_uninit(FFFramePool **pool)
Deallocate the frame pool.
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
static const uint8_t *BS_FUNC() align(BSCTX *bc)
Skip bits to a byte boundary.
AVBufferRef * hw_frames_ctx
For hwaccel pixel formats, this should be a reference to the AVHWFramesContext describing the frames.
AVFrame * ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
#define ff_tlog_link(ctx, link, end)
#define FF_TPRINTF_START(ctx, func)
const char * name
Pad name.
This struct describes a set or pool of "hardware" frames (i.e.
AVBufferRef * av_buffer_allocz(size_t size)
Same as av_buffer_alloc(), except the returned buffer will be initialized to zero.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
struct FFFramePool * frame_pool
int av_hwframe_get_buffer(AVBufferRef *hwframe_ref, AVFrame *frame, int flags)
Allocate a new frame attached to the given AVHWFramesContext.
static AVFrame * get_video_buffer(AVFilterLink *inlink, int w, int h)
Generated on Fri Oct 17 2025 19:23:15 for FFmpeg by
doxygen
1.8.17