Projects
Essentials
A_tw-ffmpeg-7
ffmpeg-7-CVE-2026-66036-shim02.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ffmpeg-7-CVE-2026-66036-shim02.patch of Package A_tw-ffmpeg-7
From 4f623b4c59c3c838f588e9def7b59dcc26dee7b9 Mon Sep 17 00:00:00 2001 From: Niklas Haas <git@haasn.dev> Date: Fri, 16 May 2025 13:05:21 +0200 Subject: [PATCH] avfilter/vf_libplacebo: implement rotation option Flipping can already be accomplished by setting the crop_w/h expressions to their negative values, so together these options can implement any of the common frame orientations. --- doc/filters.texi | 10 ++++++++++ libavfilter/avfilter.c | 3 ++- libavfilter/vf_libplacebo.c | 23 +++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff a/doc/filters.texi b/doc/filters.texi --- a/doc/filters.texi +++ b/doc/filters.texi @@ -16419,6 +16419,16 @@ and @code{(oh-ph)/2}. Set the output placement width/height expressions, default values are @code{ow} and @code{oh}. +@item rotate +Rotate the input frame clockwise by the specified angle. + +@table @samp +@item 0, 360 +@item 90 +@item 180 +@item 270 +@end table + @item fps Set the output frame rate. This can be rational, e.g. @code{60000/1001}. If set to the special string @code{none} (the default), input timestamps will diff a/libavfilter/avfilter.c b/libavfilter/avfilter.c --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -1032,7 +1032,8 @@ int ff_filter_frame(AVFilterLink *link, strcmp(link->dst->filter->name, "format") && strcmp(link->dst->filter->name, "idet") && strcmp(link->dst->filter->name, "null") && - strcmp(link->dst->filter->name, "scale")) { + strcmp(link->dst->filter->name, "scale") && + strcmp(link->dst->filter->name, "libplacebo")) { av_assert1(frame->format == link->format); av_assert1(frame->width == link->w); av_assert1(frame->height == link->h); diff a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -192,6 +192,7 @@ typedef struct LibplaceboContext { int color_range; int color_primaries; int color_trc; + int rotation; AVDictionary *extra_opts; /* pl_render_params */ @@ -787,6 +788,13 @@ static void update_crops(AVFilterContext image->crop.y0 = av_expr_eval(s->crop_y_pexpr, s->var_values, NULL); image->crop.x1 = image->crop.x0 + s->var_values[VAR_CROP_W]; image->crop.y1 = image->crop.y0 + s->var_values[VAR_CROP_H]; + image->rotation = s->rotation; + if (s->rotation % PL_ROTATION_180 == PL_ROTATION_90) { + /* Libplacebo expects the input crop relative to the actual frame + * dimensions, so un-transpose them here */ + FFSWAP(float, image->crop.x0, image->crop.y0); + FFSWAP(float, image->crop.x1, image->crop.y1); + } if (src == ref) { /* Only update the target crop once, for the 'reference' frame */ @@ -1175,6 +1183,14 @@ static int libplacebo_config_input(AVFil AVFilterContext *avctx = inlink->dst; LibplaceboContext *s = avctx->priv; + if (s->rotation % PL_ROTATION_180 == PL_ROTATION_90) { + /* Swap width and height for 90 degree rotations to make the size and + * scaling calculations work out correctly */ + FFSWAP(int, inlink->w, inlink->h); + if (inlink->sample_aspect_ratio.num) + inlink->sample_aspect_ratio = av_inv_q(inlink->sample_aspect_ratio); + } + if (inlink->format == AV_PIX_FMT_VULKAN) return ff_vk_filter_config_input(inlink); @@ -1356,6 +1372,13 @@ static const AVOption libplacebo_options {"smpte2084", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_TRC_SMPTE2084}, INT_MIN, INT_MAX, STATIC, .unit = "color_trc"}, {"arib-std-b67", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_TRC_ARIB_STD_B67}, INT_MIN, INT_MAX, STATIC, .unit = "color_trc"}, + {"rotate", "rotate the input clockwise", OFFSET(rotation), AV_OPT_TYPE_INT, {.i64=PL_ROTATION_0}, PL_ROTATION_0, PL_ROTATION_360, DYNAMIC, .unit = "rotation"}, + {"0", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PL_ROTATION_0}, .flags = STATIC, .unit = "rotation"}, + {"90", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PL_ROTATION_90}, .flags = STATIC, .unit = "rotation"}, + {"180", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PL_ROTATION_180}, .flags = STATIC, .unit = "rotation"}, + {"270", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PL_ROTATION_270}, .flags = STATIC, .unit = "rotation"}, + {"360", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PL_ROTATION_360}, .flags = STATIC, .unit = "rotation"}, + { "upscaler", "Upscaler function", OFFSET(upscaler), AV_OPT_TYPE_STRING, {.str = "spline36"}, .flags = DYNAMIC }, { "downscaler", "Downscaler function", OFFSET(downscaler), AV_OPT_TYPE_STRING, {.str = "mitchell"}, .flags = DYNAMIC }, { "frame_mixer", "Frame mixing function", OFFSET(frame_mixer), AV_OPT_TYPE_STRING, {.str = "none"}, .flags = DYNAMIC },
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.