64 #define CHECK_VIDEO_PARAM_CHANGE(s, c, width, height, format)\
65 if (c->w != width || c->h != height || c->pix_fmt != format) {\
66 av_log(s, AV_LOG_ERROR, "Changing frame properties on the fly is not supported.\n");\
67 return AVERROR(EINVAL);\
70 #define CHECK_AUDIO_PARAM_CHANGE(s, c, srate, ch_layout, format)\
71 if (c->sample_fmt != format || c->sample_rate != srate ||\
72 c->channel_layout != ch_layout) {\
73 av_log(s, AV_LOG_ERROR, "Changing frame properties on the fly is not supported.\n");\
74 return AVERROR(EINVAL);\
105 refcounted = !!frame->
buf[0];
148 #if FF_API_AVFILTERBUFFER
152 AVFilterBufferRef *buf = opaque;
153 avfilter_unref_buffer(buf);
156 static void compat_unref_buffer(
void *opaque,
uint8_t *
data)
167 int ret = 0, planes, i;
185 if ((ret = avfilter_copy_buf_props(frame, buf)) < 0)
188 #define WRAP_PLANE(ref_out, data, data_size) \
190 AVBufferRef *dummy_ref = av_buffer_ref(dummy_buf); \
192 ret = AVERROR(ENOMEM); \
195 ref_out = av_buffer_create(data, data_size, compat_unref_buffer, \
198 av_frame_unref(frame); \
199 ret = AVERROR(ENOMEM); \
208 if (!desc || planes <= 0) {
213 for (i = 0; i < planes; i++) {
223 planes = planar ? channels : 1;
280 #define OFFSET(x) offsetof(BufferSourceContext, x)
281 #define A AV_OPT_FLAG_AUDIO_PARAM
282 #define V AV_OPT_FLAG_VIDEO_PARAM
288 #if FF_API_OLD_FILTER_OPTS
291 {
"time_base_num",
"deprecated, do not use",
OFFSET(time_base.num),
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX,
V },
292 {
"time_base_den",
"deprecated, do not use",
OFFSET(time_base.den),
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX,
V },
400 switch (link->
type) {
458 .description =
NULL_IF_CONFIG_SMALL(
"Buffer video frames, and make them accessible to the filterchain."),
460 .priv_class = &buffer_class,
467 .
outputs = avfilter_vsrc_buffer_outputs,
483 .description =
NULL_IF_CONFIG_SMALL(
"Buffer audio frames, and make them accessible to the filterchain."),
485 .priv_class = &abuffer_class,
492 .
outputs = avfilter_asrc_abuffer_outputs,