FFmpeg
buffersink.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 Stefano Sabatini
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 /**
22  * @file
23  * buffer sink
24  */
25 
26 #include "libavutil/avassert.h"
27 #include "libavutil/avstring.h"
29 #include "libavutil/common.h"
30 #include "libavutil/internal.h"
31 #include "libavutil/opt.h"
32 
33 #include "audio.h"
34 #include "avfilter.h"
35 #include "avfilter_internal.h"
36 #include "buffersink.h"
37 #include "filters.h"
38 #include "formats.h"
39 #include "framequeue.h"
40 #include "video.h"
41 
42 typedef struct BufferSinkContext {
43  const AVClass *class;
44  unsigned warning_limit;
45 
46  /* only used for video */
47  enum AVPixelFormat *pixel_fmts; ///< list of accepted pixel formats
49  enum AVColorSpace *color_spaces; ///< list of accepted color spaces
51  enum AVColorRange *color_ranges; ///< list of accepted color ranges
53 
54  /* only used for audio */
55  enum AVSampleFormat *sample_fmts; ///< list of accepted sample formats
57  char *channel_layouts_str; ///< list of accepted channel layouts
59  int *sample_rates; ///< list of accepted sample rates
61 
64 
65 #define NB_ITEMS(list) (list ## _size / sizeof(*list))
66 
68 {
70 }
71 
73 {
75  buf->peeked_frame = in;
76  return out ? av_frame_ref(out, in) : 0;
77  } else {
78  av_assert1(out);
79  buf->peeked_frame = NULL;
81  av_frame_free(&in);
82  return 0;
83  }
84 }
85 
87 {
88  BufferSinkContext *buf = ctx->priv;
89  AVFilterLink *inlink = ctx->inputs[0];
91  int status, ret;
92  AVFrame *cur_frame;
93  int64_t pts;
94 
95  if (buf->peeked_frame)
96  return return_or_keep_frame(buf, frame, buf->peeked_frame, flags);
97 
98  while (1) {
100  ff_inlink_consume_frame(inlink, &cur_frame);
101  if (ret < 0) {
102  return ret;
103  } else if (ret) {
104  /* TODO return the frame instead of copying it */
105  return return_or_keep_frame(buf, frame, cur_frame, flags);
106  } else if (ff_inlink_acknowledge_status(inlink, &status, &pts)) {
107  return status;
108  } else if ((flags & AV_BUFFERSINK_FLAG_NO_REQUEST)) {
109  return AVERROR(EAGAIN);
110  } else if (li->frame_wanted_out) {
111  ret = ff_filter_graph_run_once(ctx->graph);
112  if (ret < 0)
113  return ret;
114  } else {
116  }
117  }
118 }
119 
121 {
123  ff_filter_link(ctx->inputs[0])->min_samples);
124 }
125 
127  AVFrame *frame, int nb_samples)
128 {
129  return get_frame_internal(ctx, frame, 0, nb_samples);
130 }
131 
133 {
134  BufferSinkContext *buf = ctx->priv;
135 
136  buf->warning_limit = 100;
137  return 0;
138 }
139 
141 {
142  BufferSinkContext *buf = ctx->priv;
143 
145 }
146 
148 {
149  BufferSinkContext *buf = ctx->priv;
150  FilterLinkInternal * const li = ff_link_internal(ctx->inputs[0]);
151 
152  if (buf->warning_limit &&
155  "%d buffers queued in %s, something may be wrong.\n",
156  buf->warning_limit,
157  (char *)av_x_if_null(ctx->name, ctx->filter->name));
158  buf->warning_limit *= 10;
159  }
160 
161  /* The frame is queued, the rest is up to get_frame_internal */
162  return 0;
163 }
164 
166 {
167  FilterLink *inlink = ff_filter_link(ctx->inputs[0]);
168 
169  inlink->min_samples = inlink->max_samples = frame_size;
170 }
171 
172 #define MAKE_AVFILTERLINK_ACCESSOR(type, field) \
173 type av_buffersink_get_##field(const AVFilterContext *ctx) { \
174  av_assert0(ctx->filter->activate == activate); \
175  return ctx->inputs[0]->field; \
176 }
177 
181 
184 MAKE_AVFILTERLINK_ACCESSOR(AVRational , sample_aspect_ratio)
187 
188 MAKE_AVFILTERLINK_ACCESSOR(int , sample_rate )
189 
191 {
192  FilterLink *l = ff_filter_link(ctx->inputs[0]);
193  av_assert0(ctx->filter->activate == activate);
194  return l->frame_rate;
195 }
196 
198 {
199  FilterLink *l = ff_filter_link(ctx->inputs[0]);
200  av_assert0(ctx->filter->activate == activate);
201  return l->hw_frames_ctx;
202 }
203 
205 {
206  av_assert0(ctx->filter->activate == activate);
207  return ctx->inputs[0]->ch_layout.nb_channels;
208 }
209 
211 {
212  AVChannelLayout ch_layout = { 0 };
213  int ret;
214 
215  av_assert0(ctx->filter->activate == activate);
216  ret = av_channel_layout_copy(&ch_layout, &ctx->inputs[0]->ch_layout);
217  if (ret < 0)
218  return ret;
219  *out = ch_layout;
220  return 0;
221 }
222 
223 #define CHECK_LIST_SIZE(field) \
224  if (buf->field ## _size % sizeof(*buf->field)) { \
225  av_log(ctx, AV_LOG_ERROR, "Invalid size for " #field ": %d, " \
226  "should be multiple of %d\n", \
227  buf->field ## _size, (int)sizeof(*buf->field)); \
228  return AVERROR(EINVAL); \
229  }
231 {
232  BufferSinkContext *buf = ctx->priv;
233  unsigned i;
234  int ret;
235 
237  CHECK_LIST_SIZE(color_spaces)
238  CHECK_LIST_SIZE(color_ranges)
239  if (buf->pixel_fmts_size) {
241  for (i = 0; i < NB_ITEMS(buf->pixel_fmts); i++)
242  if ((ret = ff_add_format(&formats, buf->pixel_fmts[i])) < 0)
243  return ret;
244  if ((ret = ff_set_common_formats(ctx, formats)) < 0)
245  return ret;
246  }
247 
248  if (buf->color_spaces_size) {
250  for (i = 0; i < NB_ITEMS(buf->color_spaces); i++)
251  if ((ret = ff_add_format(&formats, buf->color_spaces[i])) < 0)
252  return ret;
254  return ret;
255  }
256 
257  if (buf->color_ranges_size) {
259  for (i = 0; i < NB_ITEMS(buf->color_ranges); i++)
260  if ((ret = ff_add_format(&formats, buf->color_ranges[i])) < 0)
261  return ret;
263  return ret;
264  }
265 
266  return 0;
267 }
268 
270 {
271  BufferSinkContext *buf = ctx->priv;
273  AVChannelLayout layout = { 0 };
275  unsigned i;
276  int ret;
277 
280 
281  if (buf->sample_fmts_size) {
282  for (i = 0; i < NB_ITEMS(buf->sample_fmts); i++)
283  if ((ret = ff_add_format(&formats, buf->sample_fmts[i])) < 0)
284  return ret;
285  if ((ret = ff_set_common_formats(ctx, formats)) < 0)
286  return ret;
287  }
288 
289  if (buf->channel_layouts_str || buf->all_channel_counts) {
290  if (buf->channel_layouts_str) {
291  const char *cur = buf->channel_layouts_str;
292 
293  while (cur) {
294  char *next = strchr(cur, '|');
295  if (next)
296  *next++ = 0;
297 
299  if (ret < 0) {
300  av_log(ctx, AV_LOG_ERROR, "Error parsing channel layout: %s.\n", cur);
301  return ret;
302  }
305  if (ret < 0)
306  return ret;
307 
308  cur = next;
309  }
310  }
311 
312  if (buf->all_channel_counts) {
313  if (layouts)
315  "Conflicting all_channel_counts and list in options\n");
316  else if (!(layouts = ff_all_channel_counts()))
317  return AVERROR(ENOMEM);
318  }
320  return ret;
321  }
322 
323  if (buf->sample_rates_size) {
324  formats = NULL;
325  for (i = 0; i < NB_ITEMS(buf->sample_rates); i++)
326  if ((ret = ff_add_format(&formats, buf->sample_rates[i])) < 0)
327  return ret;
329  return ret;
330  }
331 
332  return 0;
333 }
334 
335 #define OFFSET(x) offsetof(BufferSinkContext, x)
336 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
337 static const AVOption buffersink_options[] = {
338  { "pix_fmts", "set the supported pixel formats", OFFSET(pixel_fmts), AV_OPT_TYPE_BINARY, .flags = FLAGS },
339  { "color_spaces", "set the supported color spaces", OFFSET(color_spaces), AV_OPT_TYPE_BINARY, .flags = FLAGS },
340  { "color_ranges", "set the supported color ranges", OFFSET(color_ranges), AV_OPT_TYPE_BINARY, .flags = FLAGS },
341  { NULL },
342 };
343 #undef FLAGS
344 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_AUDIO_PARAM
345 static const AVOption abuffersink_options[] = {
346  { "sample_fmts", "set the supported sample formats", OFFSET(sample_fmts), AV_OPT_TYPE_BINARY, .flags = FLAGS },
347  { "sample_rates", "set the supported sample rates", OFFSET(sample_rates), AV_OPT_TYPE_BINARY, .flags = FLAGS },
348  { "ch_layouts", "set a '|'-separated list of supported channel layouts",
349  OFFSET(channel_layouts_str), AV_OPT_TYPE_STRING, .flags = FLAGS },
350  { "all_channel_counts", "accept all channel counts", OFFSET(all_channel_counts), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS },
351  { NULL },
352 };
353 #undef FLAGS
354 
355 AVFILTER_DEFINE_CLASS(buffersink);
356 AVFILTER_DEFINE_CLASS(abuffersink);
357 
359  .name = "buffersink",
360  .description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them available to the end of the filter graph."),
361  .priv_size = sizeof(BufferSinkContext),
362  .priv_class = &buffersink_class,
363  .init = common_init,
364  .uninit = uninit,
365  .activate = activate,
367  .outputs = NULL,
369 };
370 
372  .name = "abuffersink",
373  .description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them available to the end of the filter graph."),
374  .priv_class = &abuffersink_class,
375  .priv_size = sizeof(BufferSinkContext),
376  .init = common_init,
377  .uninit = uninit,
378  .activate = activate,
380  .outputs = NULL,
382 };
formats
formats
Definition: signature.h:47
ff_filter_graph_run_once
int ff_filter_graph_run_once(AVFilterGraph *graph)
Run one round of processing on a filter graph.
Definition: avfiltergraph.c:1462
AVFilterChannelLayouts
A list of supported channel layouts.
Definition: formats.h:85
AV_LOG_WARNING
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:186
av_buffersink_get_ch_layout
int av_buffersink_get_ch_layout(const AVFilterContext *ctx, AVChannelLayout *out)
Definition: buffersink.c:210
av_buffersink_get_samples
int attribute_align_arg av_buffersink_get_samples(AVFilterContext *ctx, AVFrame *frame, int nb_samples)
Same as av_buffersink_get_frame(), but with the ability to specify the number of samples read.
Definition: buffersink.c:126
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
ff_link_internal
static FilterLinkInternal * ff_link_internal(AVFilterLink *link)
Definition: avfilter_internal.h:90
abuffersink_options
static const AVOption abuffersink_options[]
Definition: buffersink.c:345
AVERROR
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 all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
BufferSinkContext::color_spaces_size
int color_spaces_size
Definition: buffersink.c:50
opt.h
BufferSinkContext::sample_fmts
enum AVSampleFormat * sample_fmts
list of accepted sample formats
Definition: buffersink.c:55
out
FILE * out
Definition: movenc.c:55
sample_fmts
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:948
layouts
enum MovChannelLayoutTag * layouts
Definition: mov_chan.c:335
av_buffersink_get_frame_flags
int attribute_align_arg av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flags)
Get a frame with filtered data from sink and put it in frame.
Definition: buffersink.c:120
uninit
static void uninit(AVFilterContext *ctx)
Definition: buffersink.c:140
int64_t
long long int64_t
Definition: coverity.c:34
inlink
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
Definition: filter_design.txt:212
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:160
ff_all_channel_counts
AVFilterChannelLayouts * ff_all_channel_counts(void)
Construct an AVFilterChannelLayouts coding for any channel layout, with known or unknown disposition.
Definition: formats.c:621
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
sample_rates
static const int sample_rates[]
Definition: dcaenc.h:34
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:374
w
uint8_t w
Definition: llviddspenc.c:38
AVOption
AVOption.
Definition: opt.h:429
pixel_fmts
static enum AVPixelFormat pixel_fmts[]
Definition: vf_amplify.c:52
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:205
BufferSinkContext::sample_fmts_size
int sample_fmts_size
Definition: buffersink.c:56
av_buffersink_get_hw_frames_ctx
AVBufferRef * av_buffersink_get_hw_frames_ctx(const AVFilterContext *ctx)
Definition: buffersink.c:197
video.h
CHECK_LIST_SIZE
#define CHECK_LIST_SIZE(field)
Definition: buffersink.c:223
FilterLinkInternal
Definition: avfilter_internal.h:34
AVFilterFormats
A list of supported formats for one end of a filter link.
Definition: formats.h:64
formats.h
ff_inlink_consume_frame
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
Definition: avfilter.c:1451
ff_asink_abuffer
const AVFilter ff_asink_abuffer
Definition: buffersink.c:371
av_buffersink_set_frame_size
void av_buffersink_set_frame_size(AVFilterContext *ctx, unsigned frame_size)
Set the frame size for an audio buffer sink.
Definition: buffersink.c:165
AV_OPT_TYPE_BINARY
@ AV_OPT_TYPE_BINARY
Underlying C type is a uint8_t* that is either NULL or points to an array allocated with the av_mallo...
Definition: opt.h:286
BufferSinkContext::channel_layouts_str
char * channel_layouts_str
list of accepted channel layouts
Definition: buffersink.c:57
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
pts
static int64_t pts
Definition: transcode_aac.c:644
BufferSinkContext::pixel_fmts
enum AVPixelFormat * pixel_fmts
list of accepted pixel formats
Definition: buffersink.c:47
avassert.h
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
av_cold
#define av_cold
Definition: attributes.h:90
ff_set_common_formats
int ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
Definition: formats.c:867
ff_video_default_filterpad
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition: video.c:37
av_buffersink_get_frame_rate
AVRational av_buffersink_get_frame_rate(const AVFilterContext *ctx)
Definition: buffersink.c:190
AV_BUFFERSINK_FLAG_PEEK
#define AV_BUFFERSINK_FLAG_PEEK
Tell av_buffersink_get_buffer_ref() to read video/samples buffer reference, but not remove it from th...
Definition: buffersink.h:90
ff_inlink_request_frame
void ff_inlink_request_frame(AVFilterLink *link)
Mark that a frame is wanted on the link.
Definition: avfilter.c:1578
format
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 format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
return_or_keep_frame
static int return_or_keep_frame(BufferSinkContext *buf, AVFrame *out, AVFrame *in, int flags)
Definition: buffersink.c:72
frame_size
int frame_size
Definition: mxfenc.c:2424
av_buffersink_get_frame
int attribute_align_arg av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame)
Get a frame with filtered data from sink and put it in frame.
Definition: buffersink.c:67
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:40
AVFILTER_DEFINE_CLASS
AVFILTER_DEFINE_CLASS(buffersink)
filters.h
ctx
AVFormatContext * ctx
Definition: movenc.c:49
color_range
color_range
Definition: vf_selectivecolor.c:43
FLAGS
#define FLAGS
Definition: buffersink.c:344
activate
static int activate(AVFilterContext *ctx)
Definition: buffersink.c:147
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
ff_inlink_consume_samples
int ff_inlink_consume_samples(AVFilterLink *link, unsigned min, unsigned max, AVFrame **rframe)
Take samples from the link's FIFO and update the link's stats.
Definition: avfilter.c:1471
NULL
#define NULL
Definition: coverity.c:32
framequeue.h
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
BufferSinkContext::color_spaces
enum AVColorSpace * color_spaces
list of accepted color spaces
Definition: buffersink.c:49
vsink_query_formats
static int vsink_query_formats(AVFilterContext *ctx)
Definition: buffersink.c:230
ff_add_format
int ff_add_format(AVFilterFormats **avff, int64_t fmt)
Add fmt to the list of media formats contained in *avff.
Definition: formats.c:504
ff_audio_default_filterpad
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
Definition: audio.c:34
avfilter_internal.h
ff_add_channel_layout
int ff_add_channel_layout(AVFilterChannelLayouts **l, const AVChannelLayout *channel_layout)
Definition: formats.c:521
ff_inlink_acknowledge_status
int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts)
Test and acknowledge the change of status on the link.
Definition: avfilter.c:1398
buffersink_options
static const AVOption buffersink_options[]
Definition: buffersink.c:337
ff_filter_link
static FilterLink * ff_filter_link(AVFilterLink *link)
Definition: filters.h:197
BufferSinkContext::sample_rates_size
int sample_rates_size
Definition: buffersink.c:60
attribute_align_arg
#define attribute_align_arg
Definition: internal.h:50
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:366
AVMediaType
AVMediaType
Definition: avutil.h:199
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
av_frame_ref
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
Definition: frame.c:386
AVChannelLayout
An AVChannelLayout holds information about the channel layout of audio data.
Definition: channel_layout.h:311
BufferSinkContext::color_ranges_size
int color_ranges_size
Definition: buffersink.c:52
NB_ITEMS
#define NB_ITEMS(list)
Definition: buffersink.c:65
common_init
static av_cold int common_init(AVFilterContext *ctx)
Definition: buffersink.c:132
buffersink.h
layout
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 layout
Definition: filter_design.txt:18
ff_set_common_color_ranges
int ff_set_common_color_ranges(AVFilterContext *ctx, AVFilterFormats *color_ranges)
Definition: formats.c:844
av_channel_layout_from_string
int av_channel_layout_from_string(AVChannelLayout *channel_layout, const char *str)
Initialize a channel layout from a given string description.
Definition: channel_layout.c:307
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
internal.h
AVColorSpace
AVColorSpace
YUV colorspace type.
Definition: pixfmt.h:609
common.h
av_assert1
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
Definition: avassert.h:56
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
FilterLinkInternal::frame_wanted_out
int frame_wanted_out
True if a frame is currently wanted on the output of this filter.
Definition: avfilter_internal.h:75
av_frame_move_ref
void av_frame_move_ref(AVFrame *dst, AVFrame *src)
Move everything contained in src to dst and reset src.
Definition: frame.c:635
BufferSinkContext
Definition: buffersink.c:42
ff_vsink_buffer
const AVFilter ff_vsink_buffer
Definition: buffersink.c:358
AVFilter
Filter definition.
Definition: avfilter.h:201
OFFSET
#define OFFSET(x)
Definition: buffersink.c:335
AV_BUFFERSINK_FLAG_NO_REQUEST
#define AV_BUFFERSINK_FLAG_NO_REQUEST
Tell av_buffersink_get_buffer_ref() not to request a frame from its input.
Definition: buffersink.h:97
ret
ret
Definition: filter_design.txt:187
BufferSinkContext::warning_limit
unsigned warning_limit
Definition: buffersink.c:44
frame
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
Definition: filter_design.txt:264
ff_set_common_color_spaces
int ff_set_common_color_spaces(AVFilterContext *ctx, AVFilterFormats *color_spaces)
Definition: formats.c:826
ff_framequeue_queued_frames
static size_t ff_framequeue_queued_frames(const FFFrameQueue *fq)
Get the number of queued frames.
Definition: framequeue.h:146
status
ov_status_e status
Definition: dnn_backend_openvino.c:100
channel_layout.h
avfilter.h
av_channel_layout_uninit
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
Definition: channel_layout.c:437
av_buffersink_get_channels
int av_buffersink_get_channels(const AVFilterContext *ctx)
Definition: buffersink.c:204
samples
Filter the word “frame” indicates either a video frame or a group of audio samples
Definition: filter_design.txt:8
AVFilterContext
An instance of a filter.
Definition: avfilter.h:457
av_channel_layout_copy
int av_channel_layout_copy(AVChannelLayout *dst, const AVChannelLayout *src)
Make a copy of a channel layout.
Definition: channel_layout.c:444
get_frame_internal
static int get_frame_internal(AVFilterContext *ctx, AVFrame *frame, int flags, int samples)
Definition: buffersink.c:86
audio.h
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:82
BufferSinkContext::color_ranges
enum AVColorRange * color_ranges
list of accepted color ranges
Definition: buffersink.c:51
MAKE_AVFILTERLINK_ACCESSOR
#define MAKE_AVFILTERLINK_ACCESSOR(type, field)
Definition: buffersink.c:172
asink_query_formats
static int asink_query_formats(AVFilterContext *ctx)
Definition: buffersink.c:269
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327
BufferSinkContext::all_channel_counts
int all_channel_counts
Definition: buffersink.c:58
BufferSinkContext::peeked_frame
AVFrame * peeked_frame
Definition: buffersink.c:62
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
ff_set_common_samplerates
int ff_set_common_samplerates(AVFilterContext *ctx, AVFilterFormats *samplerates)
Definition: formats.c:808
h
h
Definition: vp9dsp_template.c:2070
FilterLinkInternal::fifo
FFFrameQueue fifo
Queue of frames waiting to be filtered.
Definition: avfilter_internal.h:42
avstring.h
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition: opt.h:276
AVColorRange
AVColorRange
Visual content value range.
Definition: pixfmt.h:651
BufferSinkContext::sample_rates
int * sample_rates
list of accepted sample rates
Definition: buffersink.c:59
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: filters.h:236
av_x_if_null
static void * av_x_if_null(const void *p, const void *x)
Return x default pointer in case p is NULL.
Definition: avutil.h:312
ff_set_common_channel_layouts
int ff_set_common_channel_layouts(AVFilterContext *ctx, AVFilterChannelLayouts *channel_layouts)
Helpers for query_formats() which set all free audio links to the same list of channel layouts/sample...
Definition: formats.c:790
BufferSinkContext::pixel_fmts_size
int pixel_fmts_size
Definition: buffersink.c:48