Skip to content

compiles with ffmpeg 5.0 #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 13 additions & 29 deletions vf_proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,6 @@ static av_cold void uninit(AVFilterContext* ctx) {
}
}

static int query_formats(AVFilterContext* ctx) {
const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_BGRA,
AV_PIX_FMT_NONE,
};

AVFilterFormats* fmts_list = ff_make_format_list(pix_fmts);
if (!fmts_list) {
return AVERROR(ENOMEM);
}

return ff_set_common_formats(ctx, fmts_list);
}

static void clear_image(AVFrame* out) {
for (int i = 0; i < out->height; i++) {
for (int j = 0; j < out->width; j++) {
Expand Down Expand Up @@ -175,19 +161,17 @@ static int config_input(AVFilterLink* inlink) {
}

static const AVFilterPad inputs[] = {{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.filter_frame = filter_frame,
.config_props = config_input,
.needs_writable = 1,
},
{NULL}};
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.filter_frame = filter_frame,
.config_props = config_input,
.flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
}};

static const AVFilterPad outputs[] = {{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
},
{NULL}};
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
}};

static const AVOption proxy_options[] = {
{"filter_path",
Expand Down Expand Up @@ -219,14 +203,14 @@ static const AVOption proxy_options[] = {

AVFILTER_DEFINE_CLASS(proxy);

AVFilter ff_vf_proxy = {
const AVFilter ff_vf_proxy = {
.name = "proxy",
.description = NULL_IF_CONFIG_SMALL("Video filter proxy."),
.priv_size = sizeof(ProxyContext),
.init = init,
.uninit = uninit,
.query_formats = query_formats,
.inputs = inputs,
.outputs = outputs,
FILTER_INPUTS(inputs),
FILTER_OUTPUTS(outputs),
FILTER_SINGLE_PIXFMT(AV_PIX_FMT_BGRA),
.priv_class = &proxy_class,
};