69 #define CHECK_VIDEO_PARAM_CHANGE(s, c, width, height, format)\
70 if (c->w != width || c->h != height || c->pix_fmt != format) {\
71 av_log(s, AV_LOG_INFO, "Changing frame properties on the fly is not supported by all filters.\n");\
74 #define CHECK_AUDIO_PARAM_CHANGE(s, c, srate, ch_layout, ch_count, format)\
75 if (c->sample_fmt != format || c->sample_rate != srate ||\
76 c->channel_layout != ch_layout || c->channels != ch_count) {\
77 av_log(s, AV_LOG_ERROR, "Changing frame properties on the fly is not supported.\n");\
78 return AVERROR(EINVAL);\
102 av_log(0,
AV_LOG_ERROR,
"Layout indicates a different number of channels than actually present\n");
176 #if FF_API_AVFILTERBUFFER
178 static void compat_free_buffer(
void *opaque,
uint8_t *
data)
180 AVFilterBufferRef *
buf = opaque;
182 avfilter_unref_buffer(buf);
186 static void compat_unref_buffer(
void *opaque,
uint8_t *data)
200 int ret = 0, planes, i;
220 if ((ret = avfilter_copy_buf_props(frame, buf)) < 0)
224 #define WRAP_PLANE(ref_out, data, data_size) \
234 av_frame_unref(frame); \
244 if (!desc || planes <= 0) {
249 for (i = 0; i < planes; i++) {
253 WRAP_PLANE(frame->
buf[i], frame->
data[i], plane_size);
259 planes = planar ? channels : 1;
321 #define OFFSET(x) offsetof(BufferSourceContext, x)
322 #define A AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_AUDIO_PARAM
323 #define V AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
330 #if FF_API_OLD_FILTER_OPTS
333 {
"time_base_num",
"deprecated, do not use",
OFFSET(time_base.num),
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX,
V },
334 {
"time_base_den",
"deprecated, do not use",
OFFSET(time_base.den),
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX,
V },
384 "Mismatching channel count %d and layout '%s' "
393 "channel layout specified\n");
404 "tb:%d/%d samplefmt:%s samplerate:%d chlayout:%s\n",
459 switch (link->
type) {
516 .description =
NULL_IF_CONFIG_SMALL(
"Buffer video frames, and make them accessible to the filterchain."),
524 .
outputs = avfilter_vsrc_buffer_outputs,
525 .priv_class = &buffer_class,
541 .description =
NULL_IF_CONFIG_SMALL(
"Buffer audio frames, and make them accessible to the filterchain."),
549 .
outputs = avfilter_asrc_abuffer_outputs,
550 .priv_class = &abuffer_class,