68 #define CHECK_VIDEO_PARAM_CHANGE(s, c, width, height, format)\
69 if (c->w != width || c->h != height || c->pix_fmt != format) {\
70 av_log(s, AV_LOG_INFO, "Changing frame properties on the fly is not supported by all filters.\n");\
73 #define CHECK_AUDIO_PARAM_CHANGE(s, c, srate, ch_layout, ch_count, format)\
74 if (c->sample_fmt != format || c->sample_rate != srate ||\
75 c->channel_layout != ch_layout || c->channels != ch_count) {\
76 av_log(s, AV_LOG_ERROR, "Changing frame properties on the fly is not supported.\n");\
77 return AVERROR(EINVAL);\
101 av_log(0,
AV_LOG_ERROR,
"Layout indicates a different number of channels than actually present\n");
133 refcounted = !!frame->
buf[0];
187 #if FF_API_AVFILTERBUFFER
191 AVFilterBufferRef *
buf = opaque;
193 avfilter_unref_buffer(buf);
197 static void compat_unref_buffer(
void *opaque,
uint8_t *data)
211 int ret = 0, planes, i;
231 if ((ret = avfilter_copy_buf_props(frame, buf)) < 0)
245 av_frame_unref(frame); \
255 if (!desc || planes <= 0) {
260 for (i = 0; i < planes; i++) {
270 planes = planar ? channels : 1;
332 #define OFFSET(x) offsetof(BufferSourceContext, x)
333 #define A AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_AUDIO_PARAM
334 #define V AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
341 #if FF_API_OLD_FILTER_OPTS
344 {
"time_base_num",
"deprecated, do not use",
OFFSET(time_base.num),
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX,
V },
345 {
"time_base_den",
"deprecated, do not use",
OFFSET(time_base.den),
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX,
V },
393 "Mismatching channel count %d and layout '%s' "
402 "channel layout specified\n");
413 "tb:%d/%d samplefmt:%s samplerate:%d chlayout:%s\n",
468 switch (link->
type) {
525 .description =
NULL_IF_CONFIG_SMALL(
"Buffer video frames, and make them accessible to the filterchain."),
533 .
outputs = avfilter_vsrc_buffer_outputs,
534 .priv_class = &buffer_class,
550 .description =
NULL_IF_CONFIG_SMALL(
"Buffer audio frames, and make them accessible to the filterchain."),
558 .
outputs = avfilter_asrc_abuffer_outputs,
559 .priv_class = &abuffer_class,