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
177 static void compat_free_buffer(
void *opaque,
uint8_t *
data)
179 AVFilterBufferRef *
buf = opaque;
185 static void compat_unref_buffer(
void *opaque,
uint8_t *data)
199 int ret = 0, planes, i;
219 if ((ret = avfilter_copy_buf_props(frame, buf)) < 0)
223 #define WRAP_PLANE(ref_out, data, data_size) \
233 av_frame_unref(frame); \
243 if (!desc || planes <= 0) {
248 for (i = 0; i < planes; i++) {
252 WRAP_PLANE(frame->
buf[i], frame->
data[i], plane_size);
258 planes = planar ? channels : 1;
319 #define OFFSET(x) offsetof(BufferSourceContext, x)
320 #define A AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_AUDIO_PARAM
321 #define V AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
328 #if FF_API_OLD_FILTER_OPTS
331 {
"time_base_num",
"deprecated, do not use",
OFFSET(time_base.num),
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX,
V },
332 {
"time_base_den",
"deprecated, do not use",
OFFSET(time_base.den),
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX,
V },
382 "Mismatching channel count %d and layout '%s' "
391 "channel layout specified\n");
402 "tb:%d/%d samplefmt:%s samplerate:%d chlayout:%s\n",
457 switch (link->
type) {
514 .description =
NULL_IF_CONFIG_SMALL(
"Buffer video frames, and make them accessible to the filterchain."),
522 .
outputs = avfilter_vsrc_buffer_outputs,
523 .priv_class = &buffer_class,
539 .description =
NULL_IF_CONFIG_SMALL(
"Buffer audio frames, and make them accessible to the filterchain."),
547 .
outputs = avfilter_asrc_abuffer_outputs,
548 .priv_class = &abuffer_class,