FFmpeg  4.4
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, must be terminated with -1
48 
49  /* only used for audio */
50  enum AVSampleFormat *sample_fmts; ///< list of accepted sample formats, terminated by AV_SAMPLE_FMT_NONE
52  int64_t *channel_layouts; ///< list of accepted channel layouts, terminated by -1
54  int *channel_counts; ///< list of accepted channel counts, terminated by -1
57  int *sample_rates; ///< list of accepted sample rates, terminated by -1
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;
102  av_frame_free(&in);
103  return 0;
104  }
105 }
106 
107 static int get_frame_internal(AVFilterContext *ctx, AVFrame *frame, int flags, int samples)
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) {
119  ret = samples ? ff_inlink_consume_samples(inlink, samples, samples, &cur_frame) :
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 {
135  ff_inlink_request_frame(inlink);
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
153 {
154  static const int pixel_fmts[] = { AV_PIX_FMT_NONE };
156  if (!params)
157  return NULL;
158 
159  params->pixel_fmts = pixel_fmts;
160  return params;
161 }
162 
164 {
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 =
203  inlink->partial_buf_size = frame_size;
204 }
205 
206 #define MAKE_AVFILTERLINK_ACCESSOR(type, field) \
207 type av_buffersink_get_##field(const AVFilterContext *ctx) { \
208  av_assert0(ctx->filter->activate == activate); \
209  return ctx->inputs[0]->field; \
210 }
211 
215 
219 MAKE_AVFILTERLINK_ACCESSOR(AVRational , sample_aspect_ratio)
220 
222 MAKE_AVFILTERLINK_ACCESSOR(uint64_t , channel_layout )
224 
225 MAKE_AVFILTERLINK_ACCESSOR(AVBufferRef * , hw_frames_ctx )
226 
227 #define CHECK_LIST_SIZE(field) \
228  if (buf->field ## _size % sizeof(*buf->field)) { \
229  av_log(ctx, AV_LOG_ERROR, "Invalid size for " #field ": %d, " \
230  "should be multiple of %d\n", \
231  buf->field ## _size, (int)sizeof(*buf->field)); \
232  return AVERROR(EINVAL); \
233  }
235 {
236  BufferSinkContext *buf = ctx->priv;
238  unsigned i;
239  int ret;
240 
241  CHECK_LIST_SIZE(pixel_fmts)
242  if (buf->pixel_fmts_size) {
243  for (i = 0; i < NB_ITEMS(buf->pixel_fmts); i++)
244  if ((ret = ff_add_format(&formats, buf->pixel_fmts[i])) < 0)
245  return ret;
246  if ((ret = ff_set_common_formats(ctx, formats)) < 0)
247  return ret;
248  } else {
249  if ((ret = ff_default_query_formats(ctx)) < 0)
250  return ret;
251  }
252 
253  return 0;
254 }
255 
257 {
258  BufferSinkContext *buf = ctx->priv;
261  unsigned i;
262  int ret;
263 
268 
269  if (buf->sample_fmts_size) {
270  for (i = 0; i < NB_ITEMS(buf->sample_fmts); i++)
271  if ((ret = ff_add_format(&formats, buf->sample_fmts[i])) < 0)
272  return ret;
273  if ((ret = ff_set_common_formats(ctx, formats)) < 0)
274  return ret;
275  }
276 
277  if (buf->channel_layouts_size || buf->channel_counts_size ||
278  buf->all_channel_counts) {
280  for (i = 0; i < NB_ITEMS(buf->channel_layouts); i++)
281  if ((ret = ff_add_channel_layout(&layouts, buf->channel_layouts[i])) < 0)
282  return ret;
283  for (i = 0; i < NB_ITEMS(buf->channel_counts); i++)
285  return ret;
286  if (buf->all_channel_counts) {
287  if (layouts)
289  "Conflicting all_channel_counts and list in options\n");
290  else if (!(layouts = ff_all_channel_counts()))
291  return AVERROR(ENOMEM);
292  }
293  if ((ret = ff_set_common_channel_layouts(ctx, layouts)) < 0)
294  return ret;
295  }
296 
297  if (buf->sample_rates_size) {
298  formats = NULL;
299  for (i = 0; i < NB_ITEMS(buf->sample_rates); i++)
300  if ((ret = ff_add_format(&formats, buf->sample_rates[i])) < 0)
301  return ret;
302  if ((ret = ff_set_common_samplerates(ctx, formats)) < 0)
303  return ret;
304  }
305 
306  return 0;
307 }
308 
309 #define OFFSET(x) offsetof(BufferSinkContext, x)
310 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
311 static const AVOption buffersink_options[] = {
312  { "pix_fmts", "set the supported pixel formats", OFFSET(pixel_fmts), AV_OPT_TYPE_BINARY, .flags = FLAGS },
313  { NULL },
314 };
315 #undef FLAGS
316 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_AUDIO_PARAM
317 static const AVOption abuffersink_options[] = {
318  { "sample_fmts", "set the supported sample formats", OFFSET(sample_fmts), AV_OPT_TYPE_BINARY, .flags = FLAGS },
319  { "sample_rates", "set the supported sample rates", OFFSET(sample_rates), AV_OPT_TYPE_BINARY, .flags = FLAGS },
320  { "channel_layouts", "set the supported channel layouts", OFFSET(channel_layouts), AV_OPT_TYPE_BINARY, .flags = FLAGS },
321  { "channel_counts", "set the supported channel counts", OFFSET(channel_counts), AV_OPT_TYPE_BINARY, .flags = FLAGS },
322  { "all_channel_counts", "accept all channel counts", OFFSET(all_channel_counts), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS },
323  { NULL },
324 };
325 #undef FLAGS
326 
329 
331  {
332  .name = "default",
333  .type = AVMEDIA_TYPE_VIDEO,
334  },
335  { NULL }
336 };
337 
339  .name = "buffersink",
340  .description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them available to the end of the filter graph."),
341  .priv_size = sizeof(BufferSinkContext),
342  .priv_class = &buffersink_class,
343  .init = common_init,
345  .activate = activate,
347  .outputs = NULL,
348 };
349 
351  {
352  .name = "default",
353  .type = AVMEDIA_TYPE_AUDIO,
354  },
355  { NULL }
356 };
357 
359  .name = "abuffersink",
360  .description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them available to the end of the filter graph."),
361  .priv_class = &abuffersink_class,
362  .priv_size = sizeof(BufferSinkContext),
363  .init = common_init,
365  .activate = activate,
367  .outputs = NULL,
368 };
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:925
static int query_formats(AVFilterContext *ctx)
Definition: aeval.c:244
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static const char *const format[]
Definition: af_aiir.c:456
channels
Definition: aptx.h:33
#define av_cold
Definition: attributes.h:88
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) #define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac) { } void ff_audio_convert_free(AudioConvert **ac) { if(! *ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);} AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map) { AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method !=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt) > 2) { ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc) { av_free(ac);return NULL;} return ac;} in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar) { ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar ? ac->channels :1;} else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);return ac;} int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in) { int use_generic=1;int len=in->nb_samples;int p;if(ac->dc) { av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> in
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
Definition: avassert.h:53
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:1447
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:1511
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:1492
void ff_inlink_request_frame(AVFilterLink *link)
Mark that a frame is wanted on the link.
Definition: avfilter.c:1618
Main libavfilter public API header.
int ff_filter_graph_run_once(AVFilterGraph *graph)
Run one round of processing on a filter graph.
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:31
static const AVFilterPad avfilter_vsink_buffer_inputs[]
Definition: buffersink.c:330
static const AVOption abuffersink_options[]
Definition: buffersink.c:317
static const AVFilterPad avfilter_asink_abuffer_inputs[]
Definition: buffersink.c:350
static const AVOption buffersink_options[]
Definition: buffersink.c:311
#define MAKE_AVFILTERLINK_ACCESSOR(type, field)
Definition: buffersink.c:206
static av_cold int common_init(AVFilterContext *ctx)
Definition: buffersink.c:173
static int vsink_query_formats(AVFilterContext *ctx)
Definition: buffersink.c:234
static int get_frame_internal(AVFilterContext *ctx, AVFrame *frame, int flags, int samples)
Definition: buffersink.c:107
#define FLAGS
Definition: buffersink.c:316
static int return_or_keep_frame(BufferSinkContext *buf, AVFrame *out, AVFrame *in, int flags)
Definition: buffersink.c:93
AVFilter ff_vsink_buffer
Definition: buffersink.c:338
#define NB_ITEMS(list)
Definition: buffersink.c:63
AVFILTER_DEFINE_CLASS(buffersink)
AVFilter ff_asink_abuffer
Definition: buffersink.c:358
static int activate(AVFilterContext *ctx)
Definition: buffersink.c:181
static int asink_query_formats(AVFilterContext *ctx)
Definition: buffersink.c:256
#define OFFSET(x)
Definition: buffersink.c:309
static void cleanup_redundant_layouts(AVFilterContext *ctx)
Definition: buffersink.c:65
#define CHECK_LIST_SIZE(field)
Definition: buffersink.c:227
memory buffer sink API for audio and video
#define flags(name, subs,...)
Definition: cbs_av1.c:561
audio channel layout utility functions
common internal and external API header
#define NULL
Definition: coverity.c:32
static const uint16_t channel_layouts[7]
Definition: dca_lbr.c:114
static const uint8_t channel_counts[7]
Definition: dca_lbr.c:110
static AVFrame * frame
sample_rates
sample_rate
AVFilterChannelLayouts * ff_all_channel_counts(void)
Construct an AVFilterChannelLayouts coding for any channel layout, with known or unknown disposition.
Definition: formats.c:436
int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout)
Definition: formats.c:338
int ff_default_query_formats(AVFilterContext *ctx)
Definition: formats.c:593
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:587
int ff_add_format(AVFilterFormats **avff, int64_t fmt)
Add fmt to the list of media formats contained in *avff.
Definition: formats.c:332
int ff_set_common_samplerates(AVFilterContext *ctx, AVFilterFormats *samplerates)
Definition: formats.c:575
int ff_set_common_channel_layouts(AVFilterContext *ctx, AVFilterChannelLayouts *channel_layouts)
A helper for query_formats() which sets all links to the same list of channel layouts/sample rates.
Definition: formats.c:568
#define FF_COUNT2LAYOUT(c)
Encode a channel count as a channel layout.
Definition: formats.h:103
static size_t ff_framequeue_queued_frames(const FFFrameQueue *fq)
Get the number of queued frames.
Definition: framequeue.h:146
@ AV_OPT_TYPE_BINARY
offset must point to a pointer immediately followed by an int for the length
Definition: opt.h:231
@ AV_OPT_TYPE_BOOL
Definition: opt.h:242
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
void av_buffersink_set_frame_size(AVFilterContext *ctx, unsigned frame_size)
Set the frame size for an audio buffer sink.
Definition: buffersink.c:198
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
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
#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
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
AVABufferSinkParams * av_abuffersink_params_alloc(void)
Create an AVABufferSinkParams structure.
Definition: buffersink.c:163
#define AV_BUFFERSINK_FLAG_NO_REQUEST
Tell av_buffersink_get_buffer_ref() not to request a frame from its input.
Definition: buffersink.h:96
AVBufferSinkParams * av_buffersink_params_alloc(void)
Create an AVBufferSinkParams structure.
Definition: buffersink.c:152
#define AVERROR(e)
Definition: error.h:43
void av_frame_move_ref(AVFrame *dst, AVFrame *src)
Move everything contained in src to dst and reset src.
Definition: frame.c:582
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:443
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:203
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:200
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
Definition: mem.c:237
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
AVMediaType
Definition: avutil.h:199
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
for(j=16;j >0;--j)
cl_device_type type
int i
Definition: input.c:407
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
#define attribute_align_arg
Definition: internal.h:61
uint8_t w
Definition: llviddspenc.c:39
enum MovChannelLayoutTag * layouts
Definition: mov_chan.c:434
int frame_size
Definition: mxfenc.c:2206
AVOptions.
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
formats
Definition: signature.h:48
Deprecated and unused struct to use for initializing an abuffersink context.
Definition: buffersink.h:117
A reference to a data buffer.
Definition: buffer.h:84
Deprecated and unused struct to use for initializing a buffersink context.
Definition: buffersink.h:102
enum AVPixelFormat * pixel_fmts
list of allowed pixel formats, terminated by AV_PIX_FMT_NONE
Definition: buffersink.h:103
Describe the class of an AVClass context structure.
Definition: log.h:67
A list of supported channel layouts.
Definition: formats.h:86
An instance of a filter.
Definition: avfilter.h:341
A list of supported formats for one end of a filter link.
Definition: formats.h:65
A filter pad used for either input or output.
Definition: internal.h:54
const char * name
Pad name.
Definition: internal.h:60
Filter definition.
Definition: avfilter.h:145
const char * name
Filter name.
Definition: avfilter.h:149
This structure describes decoded (raw) audio or video data.
Definition: frame.h:318
AVOption.
Definition: opt.h:248
Rational number (pair of numerator and denominator).
Definition: rational.h:58
int64_t * channel_layouts
list of accepted channel layouts, terminated by -1
Definition: buffersink.c:52
enum AVPixelFormat * pixel_fmts
list of accepted pixel formats, must be terminated with -1
Definition: buffersink.c:46
enum AVSampleFormat * sample_fmts
list of accepted sample formats, terminated by AV_SAMPLE_FMT_NONE
Definition: buffersink.c:50
AVFrame * peeked_frame
Definition: buffersink.c:60
int * channel_counts
list of accepted channel counts, terminated by -1
Definition: buffersink.c:54
int channel_layouts_size
Definition: buffersink.c:53
int * sample_rates
list of accepted sample rates, terminated by -1
Definition: buffersink.c:57
unsigned warning_limit
Definition: buffersink.c:43
#define av_malloc(s)
#define av_log(a,...)
FILE * out
Definition: movenc.c:54
AVFormatContext * ctx
Definition: movenc.c:48
static int64_t pts