64 #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) {
243 #define FIFO_INIT_SIZE 8
267 #if FF_API_AVFILTERBUFFER
277 AVFilterBufferRef **pbuf,
int nb_samples,
int flags)
279 AVFilterBufferRef *
buf;
305 buf = avfilter_get_audio_buffer_ref_from_arrays(frame->
extended_data,
316 avfilter_copy_frame_props(buf, frame);
319 buf->buf->priv = frame;
330 int attribute_align_arg av_buffersink_read(
AVFilterContext *ctx, AVFilterBufferRef **buf)
332 return compat_read(ctx, buf, 0, 0);
335 int attribute_align_arg av_buffersink_read_samples(
AVFilterContext *ctx, AVFilterBufferRef **buf,
338 return compat_read(ctx, buf, nb_samples, 0);
341 int attribute_align_arg av_buffersink_get_buffer_ref(
AVFilterContext *ctx,
342 AVFilterBufferRef **bufref,
int flags)
349 || !strcmp(ctx->
filter->
name,
"ffabuffersink"));
351 return compat_read(ctx, bufref, 0, flags);
359 || !strcmp(ctx->
filter->
name,
"ffbuffersink"));
372 || !strcmp(ctx->
filter->
name,
"ffabuffersink"));
391 #define CHECK_LIST_SIZE(field) \
392 if (buf->field ## _size % sizeof(*buf->field)) { \
393 av_log(ctx, AV_LOG_ERROR, "Invalid size for " #field ": %d, " \
394 "should be multiple of %d\n", \
395 buf->field ## _size, (int)sizeof(*buf->field)); \
396 return AVERROR(EINVAL); \
474 "Conflicting all_channel_counts and list in options\n");
494 #define OFFSET(x) offsetof(BufferSinkContext, x)
495 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
501 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
515 #if FF_API_AVFILTERBUFFER
517 #define ffbuffersink_options buffersink_options
518 #define ffabuffersink_options abuffersink_options
532 .
name =
"ffbuffersink",
533 .description =
NULL_IF_CONFIG_SMALL(
"Buffer video frames, and make them available to the end of the filter graph."),
535 .priv_class = &ffbuffersink_class,
540 .
inputs = ffbuffersink_inputs,
544 static const AVFilterPad ffabuffersink_inputs[] = {
554 .
name =
"ffabuffersink",
555 .description =
NULL_IF_CONFIG_SMALL(
"Buffer audio frames, and make them available to the end of the filter graph."),
559 .priv_class = &ffabuffersink_class,
561 .
inputs = ffabuffersink_inputs,
576 .
name =
"buffersink",
577 .description =
NULL_IF_CONFIG_SMALL(
"Buffer video frames, and make them available to the end of the filter graph."),
579 .priv_class = &buffersink_class,
584 .
inputs = avfilter_vsink_buffer_inputs,
598 .
name =
"abuffersink",
599 .description =
NULL_IF_CONFIG_SMALL(
"Buffer audio frames, and make them available to the end of the filter graph."),
600 .priv_class = &abuffersink_class,
606 .
inputs = avfilter_asink_abuffer_inputs,