64 #define NB_ITEMS(list) (list ## _size / sizeof(*list))
92 "Cannot buffer more frames. Consume some available frames "
93 "before adding new ones.\n");
114 "%d buffers queued in %s, something may be wrong.\n",
204 }
else if (ret < 0) {
244 #define FIFO_INIT_SIZE 8
268 #if FF_API_AVFILTERBUFFER
278 AVFilterBufferRef **pbuf,
int nb_samples,
int flags)
280 AVFilterBufferRef *
buf;
306 buf = avfilter_get_audio_buffer_ref_from_arrays(frame->
extended_data,
317 avfilter_copy_frame_props(buf, frame);
320 buf->buf->priv = frame;
331 int attribute_align_arg av_buffersink_read(
AVFilterContext *ctx, AVFilterBufferRef **buf)
333 return compat_read(ctx, buf, 0, 0);
336 int attribute_align_arg av_buffersink_read_samples(
AVFilterContext *ctx, AVFilterBufferRef **buf,
339 return compat_read(ctx, buf, nb_samples, 0);
342 int attribute_align_arg av_buffersink_get_buffer_ref(
AVFilterContext *ctx,
343 AVFilterBufferRef **bufref,
int flags)
350 || !strcmp(ctx->
filter->
name,
"ffabuffersink"));
352 return compat_read(ctx, bufref, 0, flags);
360 || !strcmp(ctx->
filter->
name,
"ffbuffersink"));
373 || !strcmp(ctx->
filter->
name,
"ffabuffersink"));
392 #define CHECK_LIST_SIZE(field) \
393 if (buf->field ## _size % sizeof(*buf->field)) { \
394 av_log(ctx, AV_LOG_ERROR, "Invalid size for " #field ": %d, " \
395 "should be multiple of %d\n", \
396 buf->field ## _size, (int)sizeof(*buf->field)); \
397 return AVERROR(EINVAL); \
475 "Conflicting all_channel_counts and list in options\n");
495 #define OFFSET(x) offsetof(BufferSinkContext, x)
496 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
502 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
516 #if FF_API_AVFILTERBUFFER
518 #define ffbuffersink_options buffersink_options
519 #define ffabuffersink_options abuffersink_options
533 .
name =
"ffbuffersink",
534 .description =
NULL_IF_CONFIG_SMALL(
"Buffer video frames, and make them available to the end of the filter graph."),
536 .priv_class = &ffbuffersink_class,
541 .
inputs = ffbuffersink_inputs,
545 static const AVFilterPad ffabuffersink_inputs[] = {
555 .
name =
"ffabuffersink",
556 .description =
NULL_IF_CONFIG_SMALL(
"Buffer audio frames, and make them available to the end of the filter graph."),
560 .priv_class = &ffabuffersink_class,
562 .
inputs = ffabuffersink_inputs,
577 .
name =
"buffersink",
578 .description =
NULL_IF_CONFIG_SMALL(
"Buffer video frames, and make them available to the end of the filter graph."),
580 .priv_class = &buffersink_class,
585 .
inputs = avfilter_vsink_buffer_inputs,
599 .
name =
"abuffersink",
600 .description =
NULL_IF_CONFIG_SMALL(
"Buffer audio frames, and make them available to the end of the filter graph."),
601 .priv_class = &abuffersink_class,
607 .
inputs = avfilter_asink_abuffer_inputs,