63 #define NB_ITEMS(list) (list ## _size / sizeof(*list))
91 "Cannot buffer more frames. Consume some available frames "
92 "before adding new ones.\n");
113 "%d buffers queued in %s, something may be wrong.\n",
203 }
else if (ret < 0) {
244 #define FIFO_INIT_SIZE 8
267 #if FF_API_AVFILTERBUFFER
268 static void compat_free_buffer(AVFilterBuffer *
buf)
276 AVFilterBufferRef **pbuf,
int nb_samples,
int flags)
278 AVFilterBufferRef *
buf;
299 buf = avfilter_get_video_buffer_ref_from_arrays(frame->
data, frame->
linesize,
304 buf = avfilter_get_audio_buffer_ref_from_arrays(frame->
extended_data,
318 buf->buf->priv = frame;
319 buf->
buf->free = compat_free_buffer;
331 return compat_read(ctx, buf, 0, 0);
334 int av_buffersink_read_samples(
AVFilterContext *ctx, AVFilterBufferRef **buf,
337 return compat_read(ctx, buf, nb_samples, 0);
341 AVFilterBufferRef **bufref,
int flags)
348 || !strcmp(ctx->
filter->
name,
"ffabuffersink"));
350 return compat_read(ctx, bufref, 0, flags);
357 || !strcmp(ctx->
filter->
name,
"ffbuffersink"));
370 || !strcmp(ctx->
filter->
name,
"ffabuffersink"));
389 #define CHECK_LIST_SIZE(field) \
390 if (buf->field ## _size % sizeof(*buf->field)) { \
391 av_log(ctx, AV_LOG_ERROR, "Invalid size for " #field ": %d, " \
392 "should be multiple of %d\n", \
393 buf->field ## _size, (int)sizeof(*buf->field)); \
394 return AVERROR(EINVAL); \
472 "Conflicting all_channel_counts and list in options\n");
492 #define OFFSET(x) offsetof(BufferSinkContext, x)
493 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
499 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
513 #if FF_API_AVFILTERBUFFER
515 #define ffbuffersink_options buffersink_options
516 #define ffabuffersink_options abuffersink_options
529 AVFilter avfilter_vsink_ffbuffersink = {
530 .
name =
"ffbuffersink",
531 .description =
NULL_IF_CONFIG_SMALL(
"Buffer video frames, and make them available to the end of the filter graph."),
533 .priv_class = &ffbuffersink_class,
538 .
inputs = ffbuffersink_inputs,
542 static const AVFilterPad ffabuffersink_inputs[] = {
551 AVFilter avfilter_asink_ffabuffersink = {
552 .
name =
"ffabuffersink",
553 .description =
NULL_IF_CONFIG_SMALL(
"Buffer audio frames, and make them available to the end of the filter graph."),
557 .priv_class = &ffabuffersink_class,
559 .
inputs = ffabuffersink_inputs,
574 .
name =
"buffersink",
575 .description =
NULL_IF_CONFIG_SMALL(
"Buffer video frames, and make them available to the end of the filter graph."),
577 .priv_class = &buffersink_class,
582 .
inputs = avfilter_vsink_buffer_inputs,
596 .
name =
"abuffersink",
597 .description =
NULL_IF_CONFIG_SMALL(
"Buffer audio frames, and make them available to the end of the filter graph."),
598 .priv_class = &abuffersink_class,
604 .
inputs = avfilter_asink_abuffer_inputs,