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"
28 #include "libavutil/common.h"
29 #include "libavutil/internal.h"
30 #include "libavutil/opt.h"
31 
32 #define FF_INTERNAL_FIELDS 1
33 #include "framequeue.h"
34 
35 #include "audio.h"
36 #include "avfilter.h"
37 #include "buffersink.h"
38 #include "filters.h"
39 #include "internal.h"
40 
41 typedef struct BufferSinkContext {
42  const AVClass *class;
43  unsigned warning_limit;
44 
45  /* only used for video */
46  enum AVPixelFormat *pixel_fmts; ///< list of accepted pixel formats
48 
49  /* only used for audio */
50  enum AVSampleFormat *sample_fmts; ///< list of accepted sample formats
52  int64_t *channel_layouts; ///< list of accepted channel layouts
54  int *channel_counts; ///< list of accepted channel counts
57  int *sample_rates; ///< list of accepted sample rates
59 
62 
63 #define NB_ITEMS(list) (list ## _size / sizeof(*list))
64 
66 {
67  BufferSinkContext *buf = ctx->priv;
68  int nb_layouts = NB_ITEMS(buf->channel_layouts);
69  int nb_counts = NB_ITEMS(buf->channel_counts);
70  uint64_t counts = 0;
71  int i, lc, n;
72 
73  for (i = 0; i < nb_counts; i++)
74  if (buf->channel_counts[i] < 64)
75  counts |= (uint64_t)1 << buf->channel_counts[i];
76  for (i = lc = 0; i < nb_layouts; i++) {
78  if (n < 64 && (counts & ((uint64_t)1 << n)))
80  "Removing channel layout 0x%"PRIx64", redundant with %d channels\n",
81  buf->channel_layouts[i], n);
82  else
83  buf->channel_layouts[lc++] = buf->channel_layouts[i];
84  }
85  buf->channel_layouts_size = lc * sizeof(*buf->channel_layouts);
86 }
87 
89 {
91 }
92 
94 {
96  buf->peeked_frame = in;
97  return out ? av_frame_ref(out, in) : 0;
98  } else {
99  av_assert1(out);
100  buf->peeked_frame = NULL;
101  av_frame_move_ref(out, in);
102  av_frame_free(&in);
103  return 0;
104  }
105 }
106 
108 {
109  BufferSinkContext *buf = ctx->priv;
110  AVFilterLink *inlink = ctx->inputs[0];
111  int status, ret;
112  AVFrame *cur_frame;
113  int64_t pts;
114 
115  if (buf->peeked_frame)
116  return return_or_keep_frame(buf, frame, buf->peeked_frame, flags);
117 
118  while (1) {
120  ff_inlink_consume_frame(inlink, &cur_frame);
121  if (ret < 0) {
122  return ret;
123  } else if (ret) {
124  /* TODO return the frame instead of copying it */
125  return return_or_keep_frame(buf, frame, cur_frame, flags);
126  } else if (ff_inlink_acknowledge_status(inlink, &status, &pts)) {
127  return status;
128  } else if ((flags & AV_BUFFERSINK_FLAG_NO_REQUEST)) {
129  return AVERROR(EAGAIN);
130  } else if (inlink->frame_wanted_out) {
131  ret = ff_filter_graph_run_once(ctx->graph);
132  if (ret < 0)
133  return ret;
134  } else {
136  }
137  }
138 }
139 
141 {
142  return get_frame_internal(ctx, frame, flags, ctx->inputs[0]->min_samples);
143 }
144 
146  AVFrame *frame, int nb_samples)
147 {
148  return get_frame_internal(ctx, frame, 0, nb_samples);
149 }
150 
151 #if FF_API_BUFFERSINK_ALLOC
152 AVBufferSinkParams *av_buffersink_params_alloc(void)
153 {
154  static const int pixel_fmts[] = { AV_PIX_FMT_NONE };
155  AVBufferSinkParams *params = av_malloc(sizeof(AVBufferSinkParams));
156  if (!params)
157  return NULL;
158 
159  params->pixel_fmts = pixel_fmts;
160  return params;
161 }
162 
163 AVABufferSinkParams *av_abuffersink_params_alloc(void)
164 {
165  AVABufferSinkParams *params = av_mallocz(sizeof(AVABufferSinkParams));
166 
167  if (!params)
168  return NULL;
169  return params;
170 }
171 #endif
172 
174 {
175  BufferSinkContext *buf = ctx->priv;
176 
177  buf->warning_limit = 100;
178  return 0;
179 }
180 
182 {
183  BufferSinkContext *buf = ctx->priv;
184 
185  if (buf->warning_limit &&
186  ff_framequeue_queued_frames(&ctx->inputs[0]->fifo) >= buf->warning_limit) {
188  "%d buffers queued in %s, something may be wrong.\n",
189  buf->warning_limit,
190  (char *)av_x_if_null(ctx->name, ctx->filter->name));
191  buf->warning_limit *= 10;
192  }
193 
194  /* The frame is queued, the rest is up to get_frame_internal */
195  return 0;
196 }
197 
199 {
200  AVFilterLink *inlink = ctx->inputs[0];
201 
202  inlink->min_samples = inlink->max_samples = frame_size;
203 }
204 
205 #define MAKE_AVFILTERLINK_ACCESSOR(type, field) \
206 type av_buffersink_get_##field(const AVFilterContext *ctx) { \
207  av_assert0(ctx->filter->activate == activate); \
208  return ctx->inputs[0]->field; \
209 }
210 
214 
218 MAKE_AVFILTERLINK_ACCESSOR(AVRational , sample_aspect_ratio)
219 
221 MAKE_AVFILTERLINK_ACCESSOR(uint64_t , channel_layout )
223 
224 MAKE_AVFILTERLINK_ACCESSOR(AVBufferRef * , hw_frames_ctx )
225 
226 #define CHECK_LIST_SIZE(field) \
227  if (buf->field ## _size % sizeof(*buf->field)) { \
228  av_log(ctx, AV_LOG_ERROR, "Invalid size for " #field ": %d, " \
229  "should be multiple of %d\n", \
230  buf->field ## _size, (int)sizeof(*buf->field)); \
231  return AVERROR(EINVAL); \
232  }
234 {
235  BufferSinkContext *buf = ctx->priv;
237  unsigned i;
238  int ret;
239 
241  if (buf->pixel_fmts_size) {
242  for (i = 0; i < NB_ITEMS(buf->pixel_fmts); i++)
243  if ((ret = ff_add_format(&formats, buf->pixel_fmts[i])) < 0)
244  return ret;
245  if ((ret = ff_set_common_formats(ctx, formats)) < 0)
246  return ret;
247  } else {
248  if ((ret = ff_default_query_formats(ctx)) < 0)
249  return ret;
250  }
251 
252  return 0;
253 }
254 
256 {
257  BufferSinkContext *buf = ctx->priv;
260  unsigned i;
261  int ret;
262 
267 
268  if (buf->sample_fmts_size) {
269  for (i = 0; i < NB_ITEMS(buf->sample_fmts); i++)
270  if ((ret = ff_add_format(&formats, buf->sample_fmts[i])) < 0)
271  return ret;
272  if ((ret = ff_set_common_formats(ctx, formats)) < 0)
273  return ret;
274  }
275 
276  if (buf->channel_layouts_size || buf->channel_counts_size ||
277  buf->all_channel_counts) {
279  for (i = 0; i < NB_ITEMS(buf->channel_layouts); i++)
280  if ((ret = ff_add_channel_layout(&layouts, buf->channel_layouts[i])) < 0)
281  return ret;
282  for (i = 0; i < NB_ITEMS(buf->channel_counts); i++)
284  return ret;
285  if (buf->all_channel_counts) {
286  if (layouts)
288  "Conflicting all_channel_counts and list in options\n");
289  else if (!(layouts = ff_all_channel_counts()))
290  return AVERROR(ENOMEM);
291  }
293  return ret;
294  }
295 
296  if (buf->sample_rates_size) {
297  formats = NULL;
298  for (i = 0; i < NB_ITEMS(buf->sample_rates); i++)
299  if ((ret = ff_add_format(&formats, buf->sample_rates[i])) < 0)
300  return ret;
302  return ret;
303  }
304 
305  return 0;
306 }
307 
308 #define OFFSET(x) offsetof(BufferSinkContext, x)
309 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
310 static const AVOption buffersink_options[] = {
311  { "pix_fmts", "set the supported pixel formats", OFFSET(pixel_fmts), AV_OPT_TYPE_BINARY, .flags = FLAGS },
312  { NULL },
313 };
314 #undef FLAGS
315 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_AUDIO_PARAM
316 static const AVOption abuffersink_options[] = {
317  { "sample_fmts", "set the supported sample formats", OFFSET(sample_fmts), AV_OPT_TYPE_BINARY, .flags = FLAGS },
318  { "sample_rates", "set the supported sample rates", OFFSET(sample_rates), AV_OPT_TYPE_BINARY, .flags = FLAGS },
319  { "channel_layouts", "set the supported channel layouts", OFFSET(channel_layouts), AV_OPT_TYPE_BINARY, .flags = FLAGS },
320  { "channel_counts", "set the supported channel counts", OFFSET(channel_counts), AV_OPT_TYPE_BINARY, .flags = FLAGS },
321  { "all_channel_counts", "accept all channel counts", OFFSET(all_channel_counts), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS },
322  { NULL },
323 };
324 #undef FLAGS
325 
326 AVFILTER_DEFINE_CLASS(buffersink);
327 AVFILTER_DEFINE_CLASS(abuffersink);
328 
330  {
331  .name = "default",
332  .type = AVMEDIA_TYPE_VIDEO,
333  },
334 };
335 
337  .name = "buffersink",
338  .description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them available to the end of the filter graph."),
339  .priv_size = sizeof(BufferSinkContext),
340  .priv_class = &buffersink_class,
341  .init = common_init,
342  .activate = activate,
344  .outputs = NULL,
346 };
347 
349  {
350  .name = "default",
351  .type = AVMEDIA_TYPE_AUDIO,
352  },
353 };
354 
356  .name = "abuffersink",
357  .description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them available to the end of the filter graph."),
358  .priv_class = &abuffersink_class,
359  .priv_size = sizeof(BufferSinkContext),
360  .init = common_init,
361  .activate = activate,
363  .outputs = NULL,
365 };
formats
formats
Definition: signature.h:48
avfilter_vsink_buffer_inputs
static const AVFilterPad avfilter_vsink_buffer_inputs[]
Definition: buffersink.c:329
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_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:145
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
status
they must not be accessed directly The fifo field contains the frames that are queued in the input for processing by the filter The status_in and status_out fields contains the queued status(EOF or error) of the link
BufferSinkContext::channel_layouts_size
int channel_layouts_size
Definition: buffersink.c:53
abuffersink_options
static const AVOption abuffersink_options[]
Definition: buffersink.c:316
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
opt.h
BufferSinkContext::sample_fmts
enum AVSampleFormat * sample_fmts
list of accepted sample formats
Definition: buffersink.c:50
out
FILE * out
Definition: movenc.c:54
sample_fmts
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:948
layouts
enum MovChannelLayoutTag * layouts
Definition: mov_chan.c:434
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:140
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:109
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:525
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:317
w
uint8_t w
Definition: llviddspenc.c:38
AVOption
AVOption.
Definition: opt.h:247
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:168
pixel_fmts
static enum AVPixelFormat pixel_fmts[]
Definition: vf_amplify.c:53
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:1329
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:169
BufferSinkContext::sample_fmts_size
int sample_fmts_size
Definition: buffersink.c:51
sample_rate
sample_rate
Definition: ffmpeg_filter.c:153
CHECK_LIST_SIZE
#define CHECK_LIST_SIZE(field)
Definition: buffersink.c:226
BufferSinkContext::channel_layouts
int64_t * channel_layouts
list of accepted channel layouts
Definition: buffersink.c:52
av_malloc
#define av_malloc(s)
Definition: tableprint_vlc.h:31
AVFilterFormats
A list of supported formats for one end of a filter link.
Definition: formats.h:64
init
static int init
Definition: av_tx.c:47
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:1417
ff_asink_abuffer
const AVFilter ff_asink_abuffer
Definition: buffersink.c:355
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:198
AV_OPT_TYPE_BINARY
@ AV_OPT_TYPE_BINARY
offset must point to a pointer immediately followed by an int for the length
Definition: opt.h:230
BufferSinkContext::channel_counts_size
int channel_counts_size
Definition: buffersink.c:55
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:653
BufferSinkContext::pixel_fmts
enum AVPixelFormat * pixel_fmts
list of accepted pixel formats
Definition: buffersink.c:46
AVFilterPad
A filter pad used for either input or output.
Definition: internal.h:50
avassert.h
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:699
ff_add_channel_layout
int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout)
Definition: formats.c:426
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:89
ff_inlink_request_frame
void ff_inlink_request_frame(AVFilterLink *link)
Mark that a frame is wanted on the link.
Definition: avfilter.c:1534
av_abuffersink_params_alloc
AVABufferSinkParams * av_abuffersink_params_alloc(void)
Definition: buffersink.c:163
return_or_keep_frame
static int return_or_keep_frame(BufferSinkContext *buf, AVFrame *out, AVFrame *in, int flags)
Definition: buffersink.c:93
frame_size
int frame_size
Definition: mxfenc.c:2199
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
cleanup_redundant_layouts
static void cleanup_redundant_layouts(AVFilterContext *ctx)
Definition: buffersink.c:65
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:88
AVFILTER_DEFINE_CLASS
AVFILTER_DEFINE_CLASS(buffersink)
filters.h
ctx
AVFormatContext * ctx
Definition: movenc.c:48
channels
channels
Definition: aptx.h:33
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:191
FLAGS
#define FLAGS
Definition: buffersink.c:315
activate
static int activate(AVFilterContext *ctx)
Definition: buffersink.c:181
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:1436
NULL
#define NULL
Definition: coverity.c:32
framequeue.h
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
av_buffersink_params_alloc
AVBufferSinkParams * av_buffersink_params_alloc(void)
Definition: buffersink.c:152
vsink_query_formats
static int vsink_query_formats(AVFilterContext *ctx)
Definition: buffersink.c:233
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:420
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:1371
buffersink_options
static const AVOption buffersink_options[]
Definition: buffersink.c:310
av_get_channel_layout_nb_channels
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
Definition: channel_layout.c:226
for
for(j=16;j >0;--j)
Definition: h264pred_template.c:469
BufferSinkContext::sample_rates_size
int sample_rates_size
Definition: buffersink.c:58
avfilter_asink_abuffer_inputs
static const AVFilterPad avfilter_asink_abuffer_inputs[]
Definition: buffersink.c:348
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:117
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:325
ff_default_query_formats
int ff_default_query_formats(AVFilterContext *ctx)
Definition: formats.c:710
format
ofilter format
Definition: ffmpeg_filter.c:172
NB_ITEMS
#define NB_ITEMS(list)
Definition: buffersink.c:63
common_init
static av_cold int common_init(AVFilterContext *ctx)
Definition: buffersink.c:173
sample_rates
sample_rates
Definition: ffmpeg_filter.c:153
internal.h
buffersink.h
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:271
internal.h
common.h
av_assert1
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
Definition: avassert.h:53
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
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:462
av_mallocz
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
Definition: mem.c:263
BufferSinkContext
Definition: buffersink.c:41
AVFilterPad::name
const char * name
Pad name.
Definition: internal.h:56
ff_vsink_buffer
const AVFilter ff_vsink_buffer
Definition: buffersink.c:336
AVFilter
Filter definition.
Definition: avfilter.h:165
OFFSET
#define OFFSET(x)
Definition: buffersink.c:308
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:96
ret
ret
Definition: filter_design.txt:187
BufferSinkContext::warning_limit
unsigned warning_limit
Definition: buffersink.c:43
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_COUNT2LAYOUT
#define FF_COUNT2LAYOUT(c)
Encode a channel count as a channel layout.
Definition: formats.h:102
ff_framequeue_queued_frames
static size_t ff_framequeue_queued_frames(const FFFrameQueue *fq)
Get the number of queued frames.
Definition: framequeue.h:146
channel_counts
static const uint8_t channel_counts[7]
Definition: dca_lbr.c:110
BufferSinkContext::channel_counts
int * channel_counts
list of accepted channel counts
Definition: buffersink.c:54
channel_layout.h
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
avfilter.h
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:402
get_frame_internal
static int get_frame_internal(AVFilterContext *ctx, AVFrame *frame, int flags, int samples)
Definition: buffersink.c:107
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
audio.h
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:82
MAKE_AVFILTERLINK_ACCESSOR
#define MAKE_AVFILTERLINK_ACCESSOR(type, field)
Definition: buffersink.c:205
asink_query_formats
static int asink_query_formats(AVFilterContext *ctx)
Definition: buffersink.c:255
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:241
channel_layouts
static const uint16_t channel_layouts[7]
Definition: dca_lbr.c:114
BufferSinkContext::all_channel_counts
int all_channel_counts
Definition: buffersink.c:56
BufferSinkContext::peeked_frame
AVFrame * peeked_frame
Definition: buffersink.c:60
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:28
ff_set_common_samplerates
int ff_set_common_samplerates(AVFilterContext *ctx, AVFilterFormats *samplerates)
Definition: formats.c:676
h
h
Definition: vp9dsp_template.c:2038
BufferSinkContext::sample_rates
int * sample_rates
list of accepted sample rates
Definition: buffersink.c:57
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:308
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:658
BufferSinkContext::pixel_fmts_size
int pixel_fmts_size
Definition: buffersink.c:47