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 #define FF_INTERNAL_FIELDS 1
34 #include "framequeue.h"
35 
36 #include "audio.h"
37 #include "avfilter.h"
38 #include "buffersink.h"
39 #include "filters.h"
40 #include "formats.h"
41 #include "internal.h"
42 #include "video.h"
43 
44 typedef struct BufferSinkContext {
45  const AVClass *class;
46  unsigned warning_limit;
47 
48  /* only used for video */
49  enum AVPixelFormat *pixel_fmts; ///< list of accepted pixel formats
51 
52  /* only used for audio */
53  enum AVSampleFormat *sample_fmts; ///< list of accepted sample formats
55 #if FF_API_OLD_CHANNEL_LAYOUT
56  int64_t *channel_layouts; ///< list of accepted channel layouts
57  int channel_layouts_size;
58  int *channel_counts; ///< list of accepted channel counts
59  int channel_counts_size;
60 #endif
61  char *channel_layouts_str; ///< list of accepted channel layouts
63  int *sample_rates; ///< list of accepted sample rates
65 
68 
69 #define NB_ITEMS(list) (list ## _size / sizeof(*list))
70 
71 #if FF_API_OLD_CHANNEL_LAYOUT
72 static void cleanup_redundant_layouts(AVFilterContext *ctx)
73 {
74  BufferSinkContext *buf = ctx->priv;
75  int nb_layouts = NB_ITEMS(buf->channel_layouts);
76  int nb_counts = NB_ITEMS(buf->channel_counts);
77  uint64_t counts = 0;
78  int i, lc, n;
79 
80  for (i = 0; i < nb_counts; i++)
81  if (buf->channel_counts[i] < 64)
82  counts |= (uint64_t)1 << buf->channel_counts[i];
83  for (i = lc = 0; i < nb_layouts; i++) {
84  n = av_popcount64(buf->channel_layouts[i]);
85  if (n < 64 && (counts & ((uint64_t)1 << n)))
87  "Removing channel layout 0x%"PRIx64", redundant with %d channels\n",
88  buf->channel_layouts[i], n);
89  else
90  buf->channel_layouts[lc++] = buf->channel_layouts[i];
91  }
92  buf->channel_layouts_size = lc * sizeof(*buf->channel_layouts);
93 }
94 #endif
95 
97 {
99 }
100 
102 {
103  if ((flags & AV_BUFFERSINK_FLAG_PEEK)) {
104  buf->peeked_frame = in;
105  return out ? av_frame_ref(out, in) : 0;
106  } else {
107  av_assert1(out);
108  buf->peeked_frame = NULL;
109  av_frame_move_ref(out, in);
110  av_frame_free(&in);
111  return 0;
112  }
113 }
114 
116 {
117  BufferSinkContext *buf = ctx->priv;
118  AVFilterLink *inlink = ctx->inputs[0];
119  int status, ret;
120  AVFrame *cur_frame;
121  int64_t pts;
122 
123  if (buf->peeked_frame)
124  return return_or_keep_frame(buf, frame, buf->peeked_frame, flags);
125 
126  while (1) {
128  ff_inlink_consume_frame(inlink, &cur_frame);
129  if (ret < 0) {
130  return ret;
131  } else if (ret) {
132  /* TODO return the frame instead of copying it */
133  return return_or_keep_frame(buf, frame, cur_frame, flags);
134  } else if (ff_inlink_acknowledge_status(inlink, &status, &pts)) {
135  return status;
136  } else if ((flags & AV_BUFFERSINK_FLAG_NO_REQUEST)) {
137  return AVERROR(EAGAIN);
138  } else if (inlink->frame_wanted_out) {
139  ret = ff_filter_graph_run_once(ctx->graph);
140  if (ret < 0)
141  return ret;
142  } else {
144  }
145  }
146 }
147 
149 {
150  return get_frame_internal(ctx, frame, flags, ctx->inputs[0]->min_samples);
151 }
152 
154  AVFrame *frame, int nb_samples)
155 {
156  return get_frame_internal(ctx, frame, 0, nb_samples);
157 }
158 
160 {
161  BufferSinkContext *buf = ctx->priv;
162 
163  buf->warning_limit = 100;
164  return 0;
165 }
166 
168 {
169  BufferSinkContext *buf = ctx->priv;
170 
171  if (buf->warning_limit &&
172  ff_framequeue_queued_frames(&ctx->inputs[0]->fifo) >= buf->warning_limit) {
174  "%d buffers queued in %s, something may be wrong.\n",
175  buf->warning_limit,
176  (char *)av_x_if_null(ctx->name, ctx->filter->name));
177  buf->warning_limit *= 10;
178  }
179 
180  /* The frame is queued, the rest is up to get_frame_internal */
181  return 0;
182 }
183 
185 {
186  AVFilterLink *inlink = ctx->inputs[0];
187 
188  inlink->min_samples = inlink->max_samples = frame_size;
189 }
190 
191 #define MAKE_AVFILTERLINK_ACCESSOR(type, field) \
192 type av_buffersink_get_##field(const AVFilterContext *ctx) { \
193  av_assert0(ctx->filter->activate == activate); \
194  return ctx->inputs[0]->field; \
195 }
196 
200 
204 MAKE_AVFILTERLINK_ACCESSOR(AVRational , sample_aspect_ratio)
205 
206 #if FF_API_OLD_CHANNEL_LAYOUT
208 MAKE_AVFILTERLINK_ACCESSOR(uint64_t , channel_layout )
210 #endif
212 
213 MAKE_AVFILTERLINK_ACCESSOR(AVBufferRef * , hw_frames_ctx )
214 
216 {
217  av_assert0(ctx->filter->activate == activate);
218  return ctx->inputs[0]->ch_layout.nb_channels;
219 }
220 
222 {
223  AVChannelLayout ch_layout = { 0 };
224  int ret;
225 
226  av_assert0(ctx->filter->activate == activate);
227  ret = av_channel_layout_copy(&ch_layout, &ctx->inputs[0]->ch_layout);
228  if (ret < 0)
229  return ret;
230  *out = ch_layout;
231  return 0;
232 }
233 
234 #define CHECK_LIST_SIZE(field) \
235  if (buf->field ## _size % sizeof(*buf->field)) { \
236  av_log(ctx, AV_LOG_ERROR, "Invalid size for " #field ": %d, " \
237  "should be multiple of %d\n", \
238  buf->field ## _size, (int)sizeof(*buf->field)); \
239  return AVERROR(EINVAL); \
240  }
242 {
243  BufferSinkContext *buf = ctx->priv;
245  unsigned i;
246  int ret;
247 
249  if (buf->pixel_fmts_size) {
250  for (i = 0; i < NB_ITEMS(buf->pixel_fmts); i++)
251  if ((ret = ff_add_format(&formats, buf->pixel_fmts[i])) < 0)
252  return ret;
253  if ((ret = ff_set_common_formats(ctx, formats)) < 0)
254  return ret;
255  } else {
256  if ((ret = ff_default_query_formats(ctx)) < 0)
257  return ret;
258  }
259 
260  return 0;
261 }
262 
264 {
265  BufferSinkContext *buf = ctx->priv;
267  AVChannelLayout layout = { 0 };
269  unsigned i;
270  int ret;
271 
274 #if FF_API_OLD_CHANNEL_LAYOUT
276  CHECK_LIST_SIZE(channel_counts)
277 #endif
278 
279  if (buf->sample_fmts_size) {
280  for (i = 0; i < NB_ITEMS(buf->sample_fmts); i++)
281  if ((ret = ff_add_format(&formats, buf->sample_fmts[i])) < 0)
282  return ret;
283  if ((ret = ff_set_common_formats(ctx, formats)) < 0)
284  return ret;
285  }
286 
287  if (
289  buf->channel_layouts_size || buf->channel_counts_size ||
290 #endif
292 #if FF_API_OLD_CHANNEL_LAYOUT
293  cleanup_redundant_layouts(ctx);
294  for (i = 0; i < NB_ITEMS(buf->channel_layouts); i++)
295  if ((ret = av_channel_layout_from_mask(&layout, buf->channel_layouts[i])) < 0 ||
297  return ret;
298  for (i = 0; i < NB_ITEMS(buf->channel_counts); i++) {
299  layout = FF_COUNT2LAYOUT(buf->channel_counts[i]);
300  if ((ret = ff_add_channel_layout(&layouts, &layout)) < 0)
301  return ret;
302  }
303 #endif
304  if (buf->channel_layouts_str) {
305  const char *cur = buf->channel_layouts_str;
306 
307 #if FF_API_OLD_CHANNEL_LAYOUT
308  if (layouts)
310  "Conflicting ch_layouts and list of channel_counts/channel_layouts. Ignoring the former\n");
311  else
312 #endif
313  while (cur) {
314  char *next = strchr(cur, '|');
315  if (next)
316  *next++ = 0;
317 
319  if (ret < 0) {
320  av_log(ctx, AV_LOG_ERROR, "Error parsing channel layout: %s.\n", cur);
321  return ret;
322  }
325  if (ret < 0)
326  return ret;
327 
328  cur = next;
329  }
330  }
331 
332  if (buf->all_channel_counts) {
333  if (layouts)
335  "Conflicting all_channel_counts and list in options\n");
336  else if (!(layouts = ff_all_channel_counts()))
337  return AVERROR(ENOMEM);
338  }
340  return ret;
341  }
342 
343  if (buf->sample_rates_size) {
344  formats = NULL;
345  for (i = 0; i < NB_ITEMS(buf->sample_rates); i++)
346  if ((ret = ff_add_format(&formats, buf->sample_rates[i])) < 0)
347  return ret;
349  return ret;
350  }
351 
352  return 0;
353 }
354 
355 #define OFFSET(x) offsetof(BufferSinkContext, x)
356 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
357 static const AVOption buffersink_options[] = {
358  { "pix_fmts", "set the supported pixel formats", OFFSET(pixel_fmts), AV_OPT_TYPE_BINARY, .flags = FLAGS },
359  { NULL },
360 };
361 #undef FLAGS
362 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_AUDIO_PARAM
363 static const AVOption abuffersink_options[] = {
364  { "sample_fmts", "set the supported sample formats", OFFSET(sample_fmts), AV_OPT_TYPE_BINARY, .flags = FLAGS },
365  { "sample_rates", "set the supported sample rates", OFFSET(sample_rates), AV_OPT_TYPE_BINARY, .flags = FLAGS },
366 #if FF_API_OLD_CHANNEL_LAYOUT
367  { "channel_layouts", "set the supported channel layouts (deprecated, use ch_layouts)",
369  { "channel_counts", "set the supported channel counts (deprecated, use ch_layouts)",
370  OFFSET(channel_counts), AV_OPT_TYPE_BINARY, .flags = FLAGS | AV_OPT_FLAG_DEPRECATED },
371 #endif
372  { "ch_layouts", "set a '|'-separated list of supported channel layouts",
373  OFFSET(channel_layouts_str), AV_OPT_TYPE_STRING, .flags = FLAGS },
374  { "all_channel_counts", "accept all channel counts", OFFSET(all_channel_counts), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS },
375  { NULL },
376 };
377 #undef FLAGS
378 
379 AVFILTER_DEFINE_CLASS(buffersink);
380 AVFILTER_DEFINE_CLASS(abuffersink);
381 
383  .name = "buffersink",
384  .description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them available to the end of the filter graph."),
385  .priv_size = sizeof(BufferSinkContext),
386  .priv_class = &buffersink_class,
387  .init = common_init,
388  .activate = activate,
390  .outputs = NULL,
392 };
393 
395  .name = "abuffersink",
396  .description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them available to the end of the filter graph."),
397  .priv_class = &abuffersink_class,
398  .priv_size = sizeof(BufferSinkContext),
399  .init = common_init,
400  .activate = activate,
402  .outputs = NULL,
404 };
formats
formats
Definition: signature.h:48
FF_ENABLE_DEPRECATION_WARNINGS
#define FF_ENABLE_DEPRECATION_WARNINGS
Definition: internal.h:73
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:221
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:153
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
abuffersink_options
static const AVOption abuffersink_options[]
Definition: buffersink.c:363
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:53
out
FILE * out
Definition: movenc.c:54
av_popcount64
#define av_popcount64
Definition: common.h:153
sample_fmts
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:947
layouts
enum MovChannelLayoutTag * layouts
Definition: mov_chan.c:326
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:148
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:100
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:587
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:340
w
uint8_t w
Definition: llviddspenc.c:38
AVOption
AVOption.
Definition: opt.h:251
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:169
pixel_fmts
static enum AVPixelFormat pixel_fmts[]
Definition: vf_amplify.c:51
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:1341
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:170
BufferSinkContext::sample_fmts_size
int sample_fmts_size
Definition: buffersink.c:54
video.h
sample_rate
sample_rate
Definition: ffmpeg_filter.c:368
CHECK_LIST_SIZE
#define CHECK_LIST_SIZE(field)
Definition: buffersink.c:234
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:1383
ff_asink_abuffer
const AVFilter ff_asink_abuffer
Definition: buffersink.c:394
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:184
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:231
BufferSinkContext::channel_layouts_str
char * channel_layouts_str
list of accepted channel layouts
Definition: buffersink.c:61
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:643
BufferSinkContext::pixel_fmts
enum AVPixelFormat * pixel_fmts
list of accepted pixel formats
Definition: buffersink.c:49
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:770
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:36
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:88
ff_inlink_request_frame
void ff_inlink_request_frame(AVFilterLink *link)
Mark that a frame is wanted on the link.
Definition: avfilter.c:1506
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:101
frame_size
int frame_size
Definition: mxfenc.c:2311
av_channel_layout_from_mask
FF_ENABLE_DEPRECATION_WARNINGS int av_channel_layout_from_mask(AVChannelLayout *channel_layout, uint64_t mask)
Initialize a native channel layout from a bitmask indicating which channels are present.
Definition: channel_layout.c:399
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
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:96
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:48
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:192
FLAGS
#define FLAGS
Definition: buffersink.c:362
frame
static AVFrame * frame
Definition: demux_decode.c:54
activate
static int activate(AVFilterContext *ctx)
Definition: buffersink.c:167
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:1402
NULL
#define NULL
Definition: coverity.c:32
framequeue.h
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
vsink_query_formats
static int vsink_query_formats(AVFilterContext *ctx)
Definition: buffersink.c:241
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:470
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:32
ff_add_channel_layout
int ff_add_channel_layout(AVFilterChannelLayouts **l, const AVChannelLayout *channel_layout)
Definition: formats.c:487
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:1337
buffersink_options
static const AVOption buffersink_options[]
Definition: buffersink.c:357
BufferSinkContext::sample_rates_size
int sample_rates_size
Definition: buffersink.c:64
attribute_align_arg
#define attribute_align_arg
Definition: internal.h:50
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:106
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:361
ff_default_query_formats
int ff_default_query_formats(AVFilterContext *ctx)
Definition: formats.c:781
AVChannelLayout
An AVChannelLayout holds information about the channel layout of audio data.
Definition: channel_layout.h:307
for
for(k=2;k<=8;++k)
Definition: h264pred_template.c:425
FF_API_OLD_CHANNEL_LAYOUT
#define FF_API_OLD_CHANNEL_LAYOUT
Definition: version.h:111
NB_ITEMS
#define NB_ITEMS(list)
Definition: buffersink.c:69
common_init
static av_cold int common_init(AVFilterContext *ctx)
Definition: buffersink.c:159
sample_rates
sample_rates
Definition: ffmpeg_filter.c:368
internal.h
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
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:412
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:255
internal.h
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
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:649
BufferSinkContext
Definition: buffersink.c:44
ff_vsink_buffer
const AVFilter ff_vsink_buffer
Definition: buffersink.c:382
AVFilter
Filter definition.
Definition: avfilter.h:166
OFFSET
#define OFFSET(x)
Definition: buffersink.c:355
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:95
ret
ret
Definition: filter_design.txt:187
BufferSinkContext::warning_limit
unsigned warning_limit
Definition: buffersink.c:46
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
status
ov_status_e status
Definition: dnn_backend_openvino.c:119
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:640
av_buffersink_get_channels
int av_buffersink_get_channels(const AVFilterContext *ctx)
Definition: buffersink.c:215
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:397
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:647
FF_DISABLE_DEPRECATION_WARNINGS
#define FF_DISABLE_DEPRECATION_WARNINGS
Definition: internal.h:72
get_frame_internal
static int get_frame_internal(AVFilterContext *ctx, AVFrame *frame, int flags, int samples)
Definition: buffersink.c:115
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:191
asink_query_formats
static int asink_query_formats(AVFilterContext *ctx)
Definition: buffersink.c:263
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:244
channel_layouts
static const uint16_t channel_layouts[7]
Definition: dca_lbr.c:111
BufferSinkContext::all_channel_counts
int all_channel_counts
Definition: buffersink.c:62
BufferSinkContext::peeked_frame
AVFrame * peeked_frame
Definition: buffersink.c:66
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:474
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:747
h
h
Definition: vp9dsp_template.c:2038
avstring.h
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229
int
int
Definition: ffmpeg_filter.c:368
BufferSinkContext::sample_rates
int * sample_rates
list of accepted sample rates
Definition: buffersink.c:63
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:729
BufferSinkContext::pixel_fmts_size
int pixel_fmts_size
Definition: buffersink.c:50
AV_OPT_FLAG_DEPRECATED
#define AV_OPT_FLAG_DEPRECATED
set if option is deprecated, users should refer to AVOption.help text for more information
Definition: opt.h:298