[FFmpeg-cvslog] [ffmpeg] branch master updated. 5929d46f7b avfilter/vf_vignette: use AVFilterContext for logging
ffmpeg-git at ffmpeg.org
ffmpeg-git at ffmpeg.org
Tue Aug 12 12:02:04 EEST 2025
The branch, master has been updated
via 5929d46f7bd8a19b40dbb266161a2146beed3afb (commit)
via ec3c9ecaa7f53e354595786421d7c56be68ea465 (commit)
via a75f673713cf503b5eed8347761c250e51cae920 (commit)
via 2cdf4f08b43fd3229d7819314b97d3d407c5c5f1 (commit)
via 7751f261deb36ff96978b44c545b279e2587e5ca (commit)
via dee56511b051e8177164e04ed5b044d8e7d0dc1e (commit)
via bd59c6651bead05e32c6b993546b4ff7c32174dc (commit)
via 663a37f7f9d360c40a21cf428df7a55de11a96ed (commit)
via a45113c28ab57891181c2c79821513e2b6742b4d (commit)
via ea72804295b0044778e4bc697dfc79f31771a2a6 (commit)
via d1d64c804e0547b04b2311f49018e8cf490572d7 (commit)
via d276875c90ec0ce923518d061ae03c48f6cd3af6 (commit)
via 029f501a95c1bb47a1407dee06992b3a70d2c8fa (commit)
via 86387038f89381cd7c6cba61ee368121e9083f7a (commit)
via b02d6fc5568a3aad365666ba9a64a7b1c9564781 (commit)
via d84a21a0235bbdea07dc91021cd83f856cac5cd2 (commit)
via 8c51a8b9544fa70c97bbfca8c6c9629ad5ec8286 (commit)
via 0b7827cd10e4a44b056a9c9d78125366ba91eaae (commit)
via a47ebee7dfaf8aa6878dd51906f446b1f144290b (commit)
via 09135762257b134fc2fbff377f158ee13f3799cd (commit)
via 96f860853eed202525b63dad1e6dfab32e0eec49 (commit)
via dcd378ad046e2165601c05759f8984137ac0c2d2 (commit)
via d360c212afb35cb9ded9bb984b44180cdb67bca9 (commit)
via 2e8d3548e17df7affa96871073938aa8fedfcb65 (commit)
via 4cc71fb806ac7b6a1c26df454e9a64ba71ecd5fc (commit)
via 892c43952536ab52a927ba3c89ed04502a165d68 (commit)
via fb8f52d66c629f37178d7ed6ba36a26480e0c97e (commit)
from 5733e08c97e50c1b64d671f9dfe26d3bc2d65039 (commit)
- Log -----------------------------------------------------------------
commit 5929d46f7bd8a19b40dbb266161a2146beed3afb
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:57:24 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/vf_vignette: use AVFilterContext for logging
diff --git a/libavfilter/vf_vignette.c b/libavfilter/vf_vignette.c
index 972ef7879d..da4c307964 100644
--- a/libavfilter/vf_vignette.c
+++ b/libavfilter/vf_vignette.c
@@ -283,7 +283,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static int config_props(AVFilterLink *inlink)
{
- VignetteContext *s = inlink->dst->priv;
+ AVFilterContext * ctx = inlink->dst;
+ VignetteContext *s = ctx->priv;
FilterLink *l = ff_filter_link(inlink);
AVRational sar = inlink->sample_aspect_ratio;
@@ -304,7 +305,7 @@ static int config_props(AVFilterLink *inlink)
s->xscale = 1;
}
s->dmax = hypot(inlink->w / 2., inlink->h / 2.);
- av_log(s, AV_LOG_DEBUG, "xscale=%f yscale=%f dmax=%f\n",
+ av_log(ctx, AV_LOG_DEBUG, "xscale=%f yscale=%f dmax=%f\n",
s->xscale, s->yscale, s->dmax);
s->fmap_linesize = FFALIGN(inlink->w, 32);
commit ec3c9ecaa7f53e354595786421d7c56be68ea465
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:56:54 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/vf_tonemap: use AVFilterContext for logging
diff --git a/libavfilter/vf_tonemap.c b/libavfilter/vf_tonemap.c
index 2f09487d3f..6536549daf 100644
--- a/libavfilter/vf_tonemap.c
+++ b/libavfilter/vf_tonemap.c
@@ -227,26 +227,26 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
/* input and output transfer will be linear */
if (in->color_trc == AVCOL_TRC_UNSPECIFIED) {
- av_log(s, AV_LOG_WARNING, "Untagged transfer, assuming linear light\n");
+ av_log(ctx, AV_LOG_WARNING, "Untagged transfer, assuming linear light\n");
out->color_trc = AVCOL_TRC_LINEAR;
} else if (in->color_trc != AVCOL_TRC_LINEAR)
- av_log(s, AV_LOG_WARNING, "Tonemapping works on linear light only\n");
+ av_log(ctx, AV_LOG_WARNING, "Tonemapping works on linear light only\n");
/* read peak from side data if not passed in */
if (!peak) {
peak = ff_determine_signal_peak(in);
- av_log(s, AV_LOG_DEBUG, "Computed signal peak: %f\n", peak);
+ av_log(ctx, AV_LOG_DEBUG, "Computed signal peak: %f\n", peak);
}
/* load original color space even if pixel format is RGB to compute overbrights */
s->coeffs = av_csp_luma_coeffs_from_avcsp(in->colorspace);
if (s->desat > 0 && (in->colorspace == AVCOL_SPC_UNSPECIFIED || !s->coeffs)) {
if (in->colorspace == AVCOL_SPC_UNSPECIFIED)
- av_log(s, AV_LOG_WARNING, "Missing color space information, ");
+ av_log(ctx, AV_LOG_WARNING, "Missing color space information, ");
else if (!s->coeffs)
- av_log(s, AV_LOG_WARNING, "Unsupported color space '%s', ",
+ av_log(ctx, AV_LOG_WARNING, "Unsupported color space '%s', ",
av_color_space_name(in->colorspace));
- av_log(s, AV_LOG_WARNING, "desaturation is disabled\n");
+ av_log(ctx, AV_LOG_WARNING, "desaturation is disabled\n");
s->desat = 0;
}
commit a75f673713cf503b5eed8347761c250e51cae920
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:56:18 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/vf_selectivecolor: use AVFilterContext for logging
diff --git a/libavfilter/vf_selectivecolor.c b/libavfilter/vf_selectivecolor.c
index a45ca398dd..99aa32f013 100644
--- a/libavfilter/vf_selectivecolor.c
+++ b/libavfilter/vf_selectivecolor.c
@@ -146,8 +146,9 @@ static int get_blacks_scale##nbits(int r, int g, int b, int min_val, int max_val
DECLARE_RANGE_SCALE_FUNCS(8)
DECLARE_RANGE_SCALE_FUNCS(16)
-static int register_range(SelectiveColorContext *s, int range_id)
+static int register_range(AVFilterContext *ctx, int range_id)
{
+ SelectiveColorContext *s = ctx->priv;
const float *cmyk = s->cmyk_adjust[range_id];
/* If the color range has user settings, register the color range
@@ -159,7 +160,7 @@ static int register_range(SelectiveColorContext *s, int range_id)
cmyk[1] < -1.0 || cmyk[1] > 1.0 ||
cmyk[2] < -1.0 || cmyk[2] > 1.0 ||
cmyk[3] < -1.0 || cmyk[3] > 1.0) {
- av_log(s, AV_LOG_ERROR, "Invalid %s adjustments (%g %g %g %g). "
+ av_log(ctx, AV_LOG_ERROR, "Invalid %s adjustments (%g %g %g %g). "
"Settings must be set in [-1;1] range\n",
color_names[range_id], cmyk[0], cmyk[1], cmyk[2], cmyk[3]);
return AVERROR(EINVAL);
@@ -205,7 +206,7 @@ static int parse_psfile(AVFilterContext *ctx, const char *fname)
READ16(version);
if (version != 1)
- av_log(s, AV_LOG_WARNING, "Unsupported selective color file version %d, "
+ av_log(ctx, AV_LOG_WARNING, "Unsupported selective color file version %d, "
"the settings might not be loaded properly\n", version);
READ16(s->correction_method);
@@ -214,7 +215,7 @@ static int parse_psfile(AVFilterContext *ctx, const char *fname)
for (i = 0; i < FF_ARRAY_ELEMS(s->cmyk_adjust[0]); i++) {
READ16(val);
if (val)
- av_log(s, AV_LOG_WARNING, "%c value of first CMYK entry is not 0 "
+ av_log(ctx, AV_LOG_WARNING, "%c value of first CMYK entry is not 0 "
"but %d\n", "CMYK"[i], val);
}
@@ -224,7 +225,7 @@ static int parse_psfile(AVFilterContext *ctx, const char *fname)
READ16(val);
s->cmyk_adjust[i][k] = val / 100.f;
}
- ret = register_range(s, i);
+ ret = register_range(ctx, i);
if (ret < 0)
goto end;
}
@@ -265,19 +266,19 @@ static int config_input(AVFilterLink *inlink)
float *cmyk = s->cmyk_adjust[i];
sscanf(s->opt_cmyk_adjust[i], "%f %f %f %f", cmyk, cmyk+1, cmyk+2, cmyk+3);
- ret = register_range(s, i);
+ ret = register_range(ctx, i);
if (ret < 0)
return ret;
}
}
}
- av_log(s, AV_LOG_VERBOSE, "Adjustments:%s\n", s->nb_process_ranges ? "" : " none");
+ av_log(ctx, AV_LOG_VERBOSE, "Adjustments:%s\n", s->nb_process_ranges ? "" : " none");
for (i = 0; i < s->nb_process_ranges; i++) {
const struct process_range *pr = &s->process_ranges[i];
const float *cmyk = s->cmyk_adjust[pr->range_id];
- av_log(s, AV_LOG_VERBOSE, "%8ss: C=%6g M=%6g Y=%6g K=%6g\n",
+ av_log(ctx, AV_LOG_VERBOSE, "%8ss: C=%6g M=%6g Y=%6g K=%6g\n",
color_names[pr->range_id], cmyk[0], cmyk[1], cmyk[2], cmyk[3]);
}
commit 2cdf4f08b43fd3229d7819314b97d3d407c5c5f1
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:55:16 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/vf_scdet_vulkan: use AVFilterContext for logging
diff --git a/libavfilter/vf_scdet_vulkan.c b/libavfilter/vf_scdet_vulkan.c
index fadc0842ae..ee2bf248a2 100644
--- a/libavfilter/vf_scdet_vulkan.c
+++ b/libavfilter/vf_scdet_vulkan.c
@@ -330,7 +330,7 @@ done:
if (score >= s->threshold) {
const char *pts = av_ts2timestr(in->pts, &link->time_base);
av_dict_set(&in->metadata, "lavfi.scd.time", pts, 0);
- av_log(s, AV_LOG_INFO, "lavfi.scd.score: %.3f, lavfi.scd.time: %s\n",
+ av_log(ctx, AV_LOG_INFO, "lavfi.scd.score: %.3f, lavfi.scd.time: %s\n",
score, pts);
}
commit 7751f261deb36ff96978b44c545b279e2587e5ca
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:54:55 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/vf_scdet: use AVFilterContext for logging
diff --git a/libavfilter/vf_scdet.c b/libavfilter/vf_scdet.c
index 8aa2f0a73b..6b1de13610 100644
--- a/libavfilter/vf_scdet.c
+++ b/libavfilter/vf_scdet.c
@@ -164,7 +164,7 @@ static int activate(AVFilterContext *ctx)
set_meta(s, frame, "lavfi.scd.score", buf);
if (s->scene_score >= s->threshold) {
- av_log(s, AV_LOG_INFO, "lavfi.scd.score: %.3f, lavfi.scd.time: %s\n",
+ av_log(ctx, AV_LOG_INFO, "lavfi.scd.score: %.3f, lavfi.scd.time: %s\n",
s->scene_score, av_ts2timestr(frame->pts, &inlink->time_base));
set_meta(s, frame, "lavfi.scd.time",
av_ts2timestr(frame->pts, &inlink->time_base));
commit dee56511b051e8177164e04ed5b044d8e7d0dc1e
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:54:35 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/vf_scale_vulkan: use AVFilterContext for logging
diff --git a/libavfilter/vf_scale_vulkan.c b/libavfilter/vf_scale_vulkan.c
index 9d550c5180..c23cfe262f 100644
--- a/libavfilter/vf_scale_vulkan.c
+++ b/libavfilter/vf_scale_vulkan.c
@@ -122,9 +122,10 @@ static const char write_444[] = {
C(0, } )
};
-static int init_scale_shader(ScaleVulkanContext *s, FFVulkanShader *shd,
+static int init_scale_shader(AVFilterContext *ctx, FFVulkanShader *shd,
FFVulkanDescriptorSetBinding *desc, AVFrame *in)
{
+ ScaleVulkanContext *s = ctx->priv;
GLSLD( scale_bilinear );
if (s->vkctx.output_format != s->vkctx.input_format) {
@@ -179,7 +180,7 @@ static int init_scale_shader(ScaleVulkanContext *s, FFVulkanShader *shd,
lcoeffs = av_csp_luma_coeffs_from_avcsp(in->colorspace);
if (!lcoeffs) {
- av_log(s, AV_LOG_ERROR, "Unsupported colorspace\n");
+ av_log(ctx, AV_LOG_ERROR, "Unsupported colorspace\n");
return AVERROR(EINVAL);
}
@@ -305,7 +306,7 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in)
if (debayer)
err = init_debayer_shader(s, shd, desc, in);
else
- err = init_scale_shader(s, shd, desc, in);
+ err = init_scale_shader(ctx, shd, desc, in);
if (err < 0)
goto fail;
commit bd59c6651bead05e32c6b993546b4ff7c32174dc
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:53:45 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/vf_photosensitivity: use AVFilterContext for logging
diff --git a/libavfilter/vf_photosensitivity.c b/libavfilter/vf_photosensitivity.c
index 7c8476b446..b8d3667ff8 100644
--- a/libavfilter/vf_photosensitivity.c
+++ b/libavfilter/vf_photosensitivity.c
@@ -223,7 +223,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
convert_frame(ctx, in, &ef, s->skip);
this_badness = get_badness(&ef, &s->last_frame_e);
new_badness = current_badness + this_badness;
- av_log(s, AV_LOG_VERBOSE, "badness: %6d -> %6d / %6d (%3d%% - %s)\n",
+ av_log(ctx, AV_LOG_VERBOSE, "badness: %6d -> %6d / %6d (%3d%% - %s)\n",
current_badness, new_badness, s->badness_threshold,
100 * new_badness / s->badness_threshold, new_badness < s->badness_threshold ? "OK" : "EXCEEDED");
@@ -250,7 +250,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
convert_frame(ctx, s->last_frame_av, &ef, s->skip);
this_badness = get_badness(&ef, &s->last_frame_e);
fixed_badness = current_badness + this_badness;
- av_log(s, AV_LOG_VERBOSE, " fixed: %6d -> %6d / %6d (%3d%%) factor=%5.3f\n",
+ av_log(ctx, AV_LOG_VERBOSE, " fixed: %6d -> %6d / %6d (%3d%%) factor=%5.3f\n",
current_badness, fixed_badness, s->badness_threshold,
100 * new_badness / s->badness_threshold, factor);
s->last_frame_e = ef;
commit 663a37f7f9d360c40a21cf428df7a55de11a96ed
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:53:01 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/vf_libvmaf: use AVFilterContext for logging
diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c
index 10d5b7f59b..3ab67d3dba 100644
--- a/libavfilter/vf_libvmaf.c
+++ b/libavfilter/vf_libvmaf.c
@@ -149,20 +149,20 @@ static int do_vmaf(FFFrameSync *fs)
err = copy_picture_data(ref, &pic_ref, s->bpc);
if (err) {
- av_log(s, AV_LOG_ERROR, "problem during vmaf_picture_alloc.\n");
+ av_log(ctx, AV_LOG_ERROR, "problem during vmaf_picture_alloc.\n");
return AVERROR(ENOMEM);
}
err = copy_picture_data(dist, &pic_dist, s->bpc);
if (err) {
- av_log(s, AV_LOG_ERROR, "problem during vmaf_picture_alloc.\n");
+ av_log(ctx, AV_LOG_ERROR, "problem during vmaf_picture_alloc.\n");
vmaf_picture_unref(&pic_ref);
return AVERROR(ENOMEM);
}
err = vmaf_read_pictures(s->vmaf, &pic_ref, &pic_dist, s->frame_cnt++);
if (err) {
- av_log(s, AV_LOG_ERROR, "problem during vmaf_read_pictures.\n");
+ av_log(ctx, AV_LOG_ERROR, "problem during vmaf_read_pictures.\n");
return AVERROR(EINVAL);
}
@@ -680,7 +680,7 @@ static int config_props_cuda(AVFilterLink *outlink)
};
if (!format_is_supported(frames_ctx->sw_format)) {
- av_log(s, AV_LOG_ERROR,
+ av_log(ctx, AV_LOG_ERROR,
"Unsupported input format: %s\n", desc->name);
return AVERROR(EINVAL);
}
@@ -776,20 +776,20 @@ static int do_vmaf_cuda(FFFrameSync* fs)
err = copy_picture_data_cuda(s->vmaf, device_hwctx, ref, &pic_ref,
frames_ctx->sw_format);
if (err) {
- av_log(s, AV_LOG_ERROR, "problem during copy_picture_data_cuda.\n");
+ av_log(ctx, AV_LOG_ERROR, "problem during copy_picture_data_cuda.\n");
return AVERROR(ENOMEM);
}
err = copy_picture_data_cuda(s->vmaf, device_hwctx, dist, &pic_dist,
frames_ctx->sw_format);
if (err) {
- av_log(s, AV_LOG_ERROR, "problem during copy_picture_data_cuda.\n");
+ av_log(ctx, AV_LOG_ERROR, "problem during copy_picture_data_cuda.\n");
return AVERROR(ENOMEM);
}
err = vmaf_read_pictures(s->vmaf, &pic_ref, &pic_dist, s->frame_cnt++);
if (err) {
- av_log(s, AV_LOG_ERROR, "problem during vmaf_read_pictures.\n");
+ av_log(ctx, AV_LOG_ERROR, "problem during vmaf_read_pictures.\n");
return AVERROR(EINVAL);
}
commit a45113c28ab57891181c2c79821513e2b6742b4d
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:51:55 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/vf_libplacebo: use AVFilterContext for logging
diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c
index 01ce9d56b7..af18a05258 100644
--- a/libavfilter/vf_libplacebo.c
+++ b/libavfilter/vf_libplacebo.c
@@ -380,14 +380,15 @@ static int find_scaler(AVFilterContext *avctx,
return AVERROR(EINVAL);
}
-static int parse_custom_lut(LibplaceboContext *s)
+static int parse_custom_lut(AVFilterContext *avctx)
{
+ LibplaceboContext *s = avctx->priv;
int ret;
uint8_t *lutbuf;
size_t lutbuf_size;
if ((ret = av_file_map(s->lut_filename, &lutbuf, &lutbuf_size, 0, s)) < 0) {
- av_log(s, AV_LOG_ERROR,
+ av_log(avctx, AV_LOG_ERROR,
"The LUT file '%s' could not be read: %s\n",
s->lut_filename, av_err2str(ret));
return ret;
@@ -508,7 +509,7 @@ static int update_settings(AVFilterContext *ctx)
#else
(void) e;
if (av_dict_count(s->extra_opts) > 0)
- av_log(s, AV_LOG_WARNING, "extra_opts requires libplacebo >= 6.309!\n");
+ av_log(avctx, AV_LOG_WARNING, "extra_opts requires libplacebo >= 6.309!\n");
#endif
return 0;
@@ -524,7 +525,7 @@ static int parse_shader(AVFilterContext *avctx, const void *shader, size_t len)
hook = pl_mpv_user_shader_parse(s->gpu, shader, len);
if (!hook) {
- av_log(s, AV_LOG_ERROR, "Failed parsing custom shader!\n");
+ av_log(avctx, AV_LOG_ERROR, "Failed parsing custom shader!\n");
return AVERROR(EINVAL);
}
@@ -723,7 +724,7 @@ static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext *hwct
/* Import libavfilter vulkan context into libplacebo */
s->vulkan = pl_vulkan_import(s->log, &import_params);
#else
- av_log(s, AV_LOG_ERROR, "libplacebo version %s too old to import "
+ av_log(avctx, AV_LOG_ERROR, "libplacebo version %s too old to import "
"Vulkan device, remove it or upgrade libplacebo to >= 5.278\n",
PL_VERSION);
err = AVERROR_EXTERNAL;
@@ -738,7 +739,7 @@ static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext *hwct
}
if (!s->vulkan) {
- av_log(s, AV_LOG_ERROR, "Failed %s Vulkan device!\n",
+ av_log(avctx, AV_LOG_ERROR, "Failed %s Vulkan device!\n",
hwctx ? "importing" : "creating");
err = AVERROR_EXTERNAL;
goto fail;
@@ -759,7 +760,7 @@ static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext *hwct
}
if (s->lut_filename)
- RET(parse_custom_lut(s));
+ RET(parse_custom_lut(avctx));
/* Initialize inputs */
s->inputs = av_calloc(s->nb_inputs, sizeof(*s->inputs));
@@ -1415,9 +1416,9 @@ static int libplacebo_config_output(AVFilterLink *outlink)
}
if (!ok) {
- av_log(s, AV_LOG_WARNING, "Failed to create a linear texture for "
- "compositing multiple inputs, falling back to non-linear "
- "blending.\n");
+ av_log(avctx, AV_LOG_WARNING, "Failed to create a linear texture "
+ "for compositing multiple inputs, falling back to non-linear "
+ "blending.\n");
}
}
commit ea72804295b0044778e4bc697dfc79f31771a2a6
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:49:47 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/vf_gblur_vulkan: use AVFilterContext for logging
diff --git a/libavfilter/vf_gblur_vulkan.c b/libavfilter/vf_gblur_vulkan.c
index fb676a7fc9..1b447e2754 100644
--- a/libavfilter/vf_gblur_vulkan.c
+++ b/libavfilter/vf_gblur_vulkan.c
@@ -96,29 +96,30 @@ static void init_gaussian_kernel(float *kernel, float sigma, float kernel_size)
}
}
-static inline void init_kernel_size(GBlurVulkanContext *s, int *out_size)
+static inline void init_kernel_size(void *log_ctx, int *out_size)
{
int size = *out_size;
if (!(size & 1)) {
- av_log(s, AV_LOG_WARNING, "The kernel size should be odd\n");
+ av_log(log_ctx, AV_LOG_WARNING, "The kernel size should be odd\n");
size++;
}
*out_size = (size >> 1) + 1;
}
-static av_cold void init_gaussian_params(GBlurVulkanContext *s)
+static av_cold void init_gaussian_params(AVFilterContext *ctx)
{
+ GBlurVulkanContext *s = ctx->priv;
if (s->sigmaV <= 0)
s->sigmaV = s->sigma;
- init_kernel_size(s, &s->size);
+ init_kernel_size(ctx, &s->size);
if (s->sizeV <= 0)
s->sizeV = s->size;
else
- init_kernel_size(s, &s->sizeV);
+ init_kernel_size(ctx, &s->sizeV);
}
static int init_gblur_pipeline(GBlurVulkanContext *s,
@@ -235,7 +236,7 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in)
},
};
- init_gaussian_params(s);
+ init_gaussian_params(ctx);
{
shd = &s->shd_hor;
commit d1d64c804e0547b04b2311f49018e8cf490572d7
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:48:38 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/vf_freezedetect: use AVFilterContext for logging
diff --git a/libavfilter/vf_freezedetect.c b/libavfilter/vf_freezedetect.c
index 465a2e640b..45b280ddfb 100644
--- a/libavfilter/vf_freezedetect.c
+++ b/libavfilter/vf_freezedetect.c
@@ -135,9 +135,9 @@ static int is_frozen(FreezeDetectContext *s, AVFrame *reference, AVFrame *frame)
return (mafd <= s->noise);
}
-static int set_meta(FreezeDetectContext *s, AVFrame *frame, const char *key, const char *value)
+static int set_meta(void *log_ctx, AVFrame *frame, const char *key, const char *value)
{
- av_log(s, AV_LOG_INFO, "%s: %s\n", key, value);
+ av_log(log_ctx, AV_LOG_INFO, "%s: %s\n", key, value);
return av_dict_set(&frame->metadata, key, value, 0);
}
@@ -170,10 +170,10 @@ static int activate(AVFilterContext *ctx)
frozen = is_frozen(s, s->reference_frame, frame);
if (duration >= s->duration) {
if (!s->frozen)
- set_meta(s, frame, "lavfi.freezedetect.freeze_start", av_ts2timestr(s->reference_frame->pts, &inlink->time_base));
+ set_meta(ctx, frame, "lavfi.freezedetect.freeze_start", av_ts2timestr(s->reference_frame->pts, &inlink->time_base));
if (!frozen) {
- set_meta(s, frame, "lavfi.freezedetect.freeze_duration", av_ts2timestr(duration, &AV_TIME_BASE_Q));
- set_meta(s, frame, "lavfi.freezedetect.freeze_end", av_ts2timestr(frame->pts, &inlink->time_base));
+ set_meta(ctx, frame, "lavfi.freezedetect.freeze_duration", av_ts2timestr(duration, &AV_TIME_BASE_Q));
+ set_meta(ctx, frame, "lavfi.freezedetect.freeze_end", av_ts2timestr(frame->pts, &inlink->time_base));
}
s->frozen = frozen;
}
commit d276875c90ec0ce923518d061ae03c48f6cd3af6
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:47:48 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/vf_drawtext: use AVFilterContext for logging
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 674e1e53c1..c2f6f52f43 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -1269,11 +1269,12 @@ static void update_alpha(DrawTextContext *s)
s->alpha = 256 * alpha;
}
-static int draw_glyphs(DrawTextContext *s, AVFrame *frame,
+static int draw_glyphs(AVFilterContext *ctx, AVFrame *frame,
FFDrawColor *color,
TextMetrics *metrics,
int x, int y, int borderw)
{
+ DrawTextContext *s = ctx->priv;
int g, l, x1, y1, w1, h1, idx;
int dx = 0, dy = 0, pdx = 0;
GlyphInfo *info;
@@ -1297,7 +1298,7 @@ static int draw_glyphs(DrawTextContext *s, AVFrame *frame,
if ((!j_left || j_right) && !s->tab_warning_printed && s->tab_count > 0) {
s->tab_warning_printed = 1;
- av_log(s, AV_LOG_WARNING, "Tab characters are only supported with left horizontal alignment\n");
+ av_log(ctx, AV_LOG_WARNING, "Tab characters are only supported with left horizontal alignment\n");
}
clip_x = FFMIN(metrics->rect_x + s->box_width + s->bb_right, frame->width);
@@ -1510,7 +1511,7 @@ continue_on_failed2:
cur_line->width64 = w64;
- av_log(s, AV_LOG_DEBUG, " Line: %d -- glyphs count: %d - width64: %d - offset_left64: %d - offset_right64: %d)\n",
+ av_log(ctx, AV_LOG_DEBUG, " Line: %d -- glyphs count: %d - width64: %d - offset_left64: %d - offset_right64: %d)\n",
line_count, hb->glyph_count, cur_line->width64, cur_line->offset_left64, cur_line->offset_right64);
if (w64 > width64) {
@@ -1613,7 +1614,7 @@ static int draw_text(AVFilterContext *ctx, AVFrame *frame)
return ret;
if (!av_bprint_is_complete(&s->expanded_fontcolor))
return AVERROR(ENOMEM);
- av_log(s, AV_LOG_DEBUG, "Evaluated fontcolor is '%s'\n", s->expanded_fontcolor.str);
+ av_log(ctx, AV_LOG_DEBUG, "Evaluated fontcolor is '%s'\n", s->expanded_fontcolor.str);
ret = av_parse_color(s->fontcolor.rgba, s->expanded_fontcolor.str, -1, s);
if (ret)
return ret;
@@ -1797,20 +1798,20 @@ static int draw_text(AVFilterContext *ctx, AVFrame *frame)
}
if (s->shadowx || s->shadowy) {
- if ((ret = draw_glyphs(s, frame, &shadowcolor, &metrics,
+ if ((ret = draw_glyphs(ctx, frame, &shadowcolor, &metrics,
s->shadowx, s->shadowy, s->borderw)) < 0) {
return ret;
}
}
if (s->borderw) {
- if ((ret = draw_glyphs(s, frame, &bordercolor, &metrics,
+ if ((ret = draw_glyphs(ctx, frame, &bordercolor, &metrics,
0, 0, s->borderw)) < 0) {
return ret;
}
}
- if ((ret = draw_glyphs(s, frame, &fontcolor, &metrics, 0,
+ if ((ret = draw_glyphs(ctx, frame, &fontcolor, &metrics, 0,
0, 0)) < 0) {
return ret;
}
@@ -1846,7 +1847,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
header = (AVDetectionBBoxHeader *)sd->data;
loop = header->nb_bboxes;
} else {
- av_log(s, AV_LOG_WARNING, "No detection bboxes.\n");
+ av_log(ctx, AV_LOG_WARNING, "No detection bboxes.\n");
return ff_filter_frame(outlink, frame);
}
}
commit 029f501a95c1bb47a1407dee06992b3a70d2c8fa
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:45:56 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/vf_drawbox: use AVFilterContext for logging
diff --git a/libavfilter/vf_drawbox.c b/libavfilter/vf_drawbox.c
index 95f61df5ae..571988416c 100644
--- a/libavfilter/vf_drawbox.c
+++ b/libavfilter/vf_drawbox.c
@@ -371,7 +371,8 @@ static av_pure av_always_inline int pixel_belongs_to_box(DrawBoxContext *s, int
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
{
- DrawBoxContext *s = inlink->dst->priv;
+ AVFilterContext *ctx = inlink->dst;
+ DrawBoxContext *s = ctx->priv;
const AVDetectionBBoxHeader *header = NULL;
const AVDetectionBBox *bbox;
AVFrameSideData *sd;
@@ -383,7 +384,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
header = (AVDetectionBBoxHeader *)sd->data;
loop = header->nb_bboxes;
} else {
- av_log(s, AV_LOG_WARNING, "No detection bboxes.\n");
+ av_log(ctx, AV_LOG_WARNING, "No detection bboxes.\n");
return ff_filter_frame(inlink->dst->outputs[0], frame);
}
}
commit 86387038f89381cd7c6cba61ee368121e9083f7a
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:44:55 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/vf_delogo: use AVFilterContext for logging
diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c
index bfbf8e6f4c..83f7f66ad5 100644
--- a/libavfilter/vf_delogo.c
+++ b/libavfilter/vf_delogo.c
@@ -248,8 +248,8 @@ static av_cold int init(AVFilterContext *ctx)
s->h = av_expr_eval(s->h_pexpr, s->var_values, s);
#define CHECK_UNSET_OPT(opt) \
- if (s->opt == -1) { \
- av_log(s, AV_LOG_ERROR, "Option %s was not set.\n", #opt); \
+ if (s->opt == -1) { \
+ av_log(ctx, AV_LOG_ERROR, "Option %s was not set.\n", #opt); \
return AVERROR(EINVAL); \
}
CHECK_UNSET_OPT(x);
@@ -272,12 +272,13 @@ static av_cold int init(AVFilterContext *ctx)
static int config_input(AVFilterLink *inlink)
{
- DelogoContext *s = inlink->dst->priv;
+ AVFilterContext *ctx = inlink->dst;
+ DelogoContext *s = ctx->priv;
/* Check whether the logo area fits in the frame */
if (s->x + (s->band - 1) < 0 || s->x + s->w - (s->band*2 - 2) > inlink->w ||
s->y + (s->band - 1) < 0 || s->y + s->h - (s->band*2 - 2) > inlink->h) {
- av_log(s, AV_LOG_ERROR, "Logo area is outside of the frame.\n");
+ av_log(ctx, AV_LOG_ERROR, "Logo area is outside of the frame.\n");
return AVERROR(EINVAL);
}
@@ -287,7 +288,8 @@ static int config_input(AVFilterLink *inlink)
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
{
FilterLink *inl = ff_filter_link(inlink);
- DelogoContext *s = inlink->dst->priv;
+ AVFilterContext *ctx = inlink->dst;
+ DelogoContext *s = ctx->priv;
AVFilterLink *outlink = inlink->dst->outputs[0];
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
AVFrame *out;
@@ -307,7 +309,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (s->x + (s->band - 1) <= 0 || s->x + s->w - (s->band*2 - 2) > inlink->w ||
s->y + (s->band - 1) <= 0 || s->y + s->h - (s->band*2 - 2) > inlink->h) {
- av_log(s, AV_LOG_WARNING, "Logo area is outside of the frame,"
+ av_log(ctx, AV_LOG_WARNING, "Logo area is outside of the frame,"
" auto set the area inside of the frame\n");
}
commit b02d6fc5568a3aad365666ba9a64a7b1c9564781
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:43:45 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/vf_dctdnoiz: use AVFilterContext for logging
diff --git a/libavfilter/vf_dctdnoiz.c b/libavfilter/vf_dctdnoiz.c
index 50cd18f7ce..9241b3a9eb 100644
--- a/libavfilter/vf_dctdnoiz.c
+++ b/libavfilter/vf_dctdnoiz.c
@@ -632,7 +632,7 @@ static av_cold int init(AVFilterContext *ctx)
s->overlap = s->bsize - 1;
if (s->overlap > s->bsize - 1) {
- av_log(s, AV_LOG_ERROR, "Overlap value can not except %d "
+ av_log(ctx, AV_LOG_ERROR, "Overlap value can not except %d "
"with a block size of %dx%d\n",
s->bsize - 1, s->bsize, s->bsize);
return AVERROR(EINVAL);
commit d84a21a0235bbdea07dc91021cd83f856cac5cd2
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:43:22 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/vf_curves: use AVFilterContext for logging
diff --git a/libavfilter/vf_curves.c b/libavfilter/vf_curves.c
index d54e9ed1b9..d8dfd32858 100644
--- a/libavfilter/vf_curves.c
+++ b/libavfilter/vf_curves.c
@@ -641,7 +641,7 @@ end:
static int dump_curves(const char *fname, uint16_t *graph[NB_COMP + 1],
struct keypoint *comp_points[NB_COMP + 1],
- int lut_size)
+ int lut_size, void *log_ctx)
{
int i;
AVBPrint buf;
@@ -653,7 +653,7 @@ static int dump_curves(const char *fname, uint16_t *graph[NB_COMP + 1],
if (!f) {
int ret = AVERROR(errno);
- av_log(NULL, AV_LOG_ERROR, "Cannot open file '%s' for writing: %s\n",
+ av_log(log_ctx, AV_LOG_ERROR, "Cannot open file '%s' for writing: %s\n",
fname, av_err2str(ret));
return ret;
}
@@ -912,7 +912,7 @@ static int config_input(AVFilterLink *inlink)
}
if (curves->plot_filename && !curves->saved_plot) {
- dump_curves(curves->plot_filename, curves->graph, comp_points, curves->lut_size);
+ dump_curves(curves->plot_filename, curves->graph, comp_points, curves->lut_size, ctx);
curves->saved_plot = 1;
}
commit 8c51a8b9544fa70c97bbfca8c6c9629ad5ec8286
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:42:34 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/vf_blackdetect_vulkan: use AVFilterContext for logging
diff --git a/libavfilter/vf_blackdetect_vulkan.c b/libavfilter/vf_blackdetect_vulkan.c
index fdebfd955a..279b057148 100644
--- a/libavfilter/vf_blackdetect_vulkan.c
+++ b/libavfilter/vf_blackdetect_vulkan.c
@@ -164,7 +164,7 @@ static void report_black_region(AVFilterContext *ctx, int64_t black_end)
return;
if ((black_end - s->black_start) >= s->black_min_duration_time / av_q2d(inlink->time_base)) {
- av_log(s, AV_LOG_INFO,
+ av_log(ctx, AV_LOG_INFO,
"black_start:%s black_end:%s black_duration:%s\n",
av_ts2timestr(s->black_start, &inlink->time_base),
av_ts2timestr(black_end, &inlink->time_base),
commit 0b7827cd10e4a44b056a9c9d78125366ba91eaae
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:14:32 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/vf_blackdetect: log with correct filter ID
If we use the private BlackDetectContext for logging, the filter ID does
not get printed alongside the filter name. Using the parent AVFilterContext
makes this consistent with other filters.
diff --git a/libavfilter/vf_blackdetect.c b/libavfilter/vf_blackdetect.c
index b233bdfd60..27130170a3 100644
--- a/libavfilter/vf_blackdetect.c
+++ b/libavfilter/vf_blackdetect.c
@@ -140,7 +140,7 @@ static int config_input(AVFilterLink *inlink)
if (!s->counter)
return AVERROR(ENOMEM);
- av_log(s, AV_LOG_VERBOSE,
+ av_log(ctx, AV_LOG_VERBOSE,
"black_min_duration:%s pixel_black_th:%f picture_black_ratio_th:%f alpha:%d\n",
av_ts2timestr(s->black_min_duration, &s->time_base),
s->pixel_black_th, s->picture_black_ratio_th, s->alpha);
@@ -152,7 +152,7 @@ static void check_black_end(AVFilterContext *ctx)
BlackDetectContext *s = ctx->priv;
if ((s->black_end - s->black_start) >= s->black_min_duration) {
- av_log(s, AV_LOG_INFO,
+ av_log(ctx, AV_LOG_INFO,
"black_start:%s black_end:%s black_duration:%s\n",
av_ts2timestr(s->black_start, &s->time_base),
av_ts2timestr(s->black_end, &s->time_base),
commit a47ebee7dfaf8aa6878dd51906f446b1f144290b
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:41:17 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/f_bench: use AVFilterContext for logging
diff --git a/libavfilter/f_bench.c b/libavfilter/f_bench.c
index 9898e94c76..2546adc281 100644
--- a/libavfilter/f_bench.c
+++ b/libavfilter/f_bench.c
@@ -80,7 +80,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
s->n++;
s->min = FFMIN(s->min, diff);
s->max = FFMAX(s->max, diff);
- av_log(s, AV_LOG_INFO, "t:%f avg:%f max:%f min:%f\n",
+ av_log(ctx, AV_LOG_INFO, "t:%f avg:%f max:%f min:%f\n",
T2F(diff), T2F(s->sum / s->n), T2F(s->max), T2F(s->min));
}
av_dict_set(&in->metadata, START_TIME_KEY, NULL, 0);
commit 09135762257b134fc2fbff377f158ee13f3799cd
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:31:46 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/avf_aphasemeter: use AVFilterContext for logging
diff --git a/libavfilter/avf_aphasemeter.c b/libavfilter/avf_aphasemeter.c
index 4c6b4ae02c..eb55d56664 100644
--- a/libavfilter/avf_aphasemeter.c
+++ b/libavfilter/avf_aphasemeter.c
@@ -171,8 +171,9 @@ static inline void add_metadata(AVFrame *insamples, const char *key, char *value
av_dict_set(&insamples->metadata, buf, value, 0);
}
-static inline void update_mono_detection(AudioPhaseMeterContext *s, AVFrame *insamples, int mono_measurement)
+static inline void update_mono_detection(AVFilterContext *ctx, AVFrame *insamples, int mono_measurement)
{
+ AudioPhaseMeterContext *s = ctx->priv;
int64_t mono_duration;
if (!s->is_mono && mono_measurement) {
s->is_mono = 1;
@@ -184,7 +185,7 @@ static inline void update_mono_detection(AudioPhaseMeterContext *s, AVFrame *ins
mono_duration = get_duration(s->mono_idx);
if (mono_duration >= s->duration) {
add_metadata(insamples, "mono_start", av_ts2timestr(s->mono_idx[0], &s->time_base));
- av_log(s, AV_LOG_INFO, "mono_start: %s\n", av_ts2timestr(s->mono_idx[0], &s->time_base));
+ av_log(ctx, AV_LOG_INFO, "mono_start: %s\n", av_ts2timestr(s->mono_idx[0], &s->time_base));
s->start_mono_presence = 0;
}
}
@@ -196,14 +197,15 @@ static inline void update_mono_detection(AudioPhaseMeterContext *s, AVFrame *ins
add_metadata(insamples, "mono_end", av_ts2timestr(s->mono_idx[1], &s->time_base));
add_metadata(insamples, "mono_duration", av_ts2timestr(mono_duration, &s->time_base));
}
- av_log(s, AV_LOG_INFO, "mono_end: %s | mono_duration: %s\n", av_ts2timestr(s->mono_idx[1], &s->time_base), av_ts2timestr(mono_duration, &s->time_base));
+ av_log(ctx, AV_LOG_INFO, "mono_end: %s | mono_duration: %s\n", av_ts2timestr(s->mono_idx[1], &s->time_base), av_ts2timestr(mono_duration, &s->time_base));
}
s->is_mono = 0;
}
}
-static inline void update_out_phase_detection(AudioPhaseMeterContext *s, AVFrame *insamples, int out_phase_measurement)
+static inline void update_out_phase_detection(AVFilterContext *ctx, AVFrame *insamples, int out_phase_measurement)
{
+ AudioPhaseMeterContext *s = ctx->priv;
int64_t out_phase_duration;
if (!s->is_out_phase && out_phase_measurement) {
s->is_out_phase = 1;
@@ -215,7 +217,7 @@ static inline void update_out_phase_detection(AudioPhaseMeterContext *s, AVFrame
out_phase_duration = get_duration(s->out_phase_idx);
if (out_phase_duration >= s->duration) {
add_metadata(insamples, "out_phase_start", av_ts2timestr(s->out_phase_idx[0], &s->time_base));
- av_log(s, AV_LOG_INFO, "out_phase_start: %s\n", av_ts2timestr(s->out_phase_idx[0], &s->time_base));
+ av_log(ctx, AV_LOG_INFO, "out_phase_start: %s\n", av_ts2timestr(s->out_phase_idx[0], &s->time_base));
s->start_out_phase_presence = 0;
}
}
@@ -227,7 +229,7 @@ static inline void update_out_phase_detection(AudioPhaseMeterContext *s, AVFrame
add_metadata(insamples, "out_phase_end", av_ts2timestr(s->out_phase_idx[1], &s->time_base));
add_metadata(insamples, "out_phase_duration", av_ts2timestr(out_phase_duration, &s->time_base));
}
- av_log(s, AV_LOG_INFO, "out_phase_end: %s | out_phase_duration: %s\n", av_ts2timestr(s->out_phase_idx[1], &s->time_base), av_ts2timestr(out_phase_duration, &s->time_base));
+ av_log(ctx, AV_LOG_INFO, "out_phase_end: %s | out_phase_duration: %s\n", av_ts2timestr(s->out_phase_idx[1], &s->time_base), av_ts2timestr(out_phase_duration, &s->time_base));
}
s->is_out_phase = 0;
}
@@ -322,8 +324,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
mono_measurement = (tolerance - fphase) < FLT_EPSILON;
out_phase_measurement = (angle - fphase) > FLT_EPSILON;
- update_mono_detection(s, in, mono_measurement);
- update_out_phase_detection(s, in, out_phase_measurement);
+ update_mono_detection(ctx, in, mono_measurement);
+ update_out_phase_detection(ctx, in, out_phase_measurement);
}
if (s->do_video)
@@ -386,8 +388,8 @@ static av_cold void uninit(AVFilterContext *ctx)
AudioPhaseMeterContext *s = ctx->priv;
if (s->do_phasing_detection) {
- update_mono_detection(s, NULL, 0);
- update_out_phase_detection(s, NULL, 0);
+ update_mono_detection(ctx, NULL, 0);
+ update_out_phase_detection(ctx, NULL, 0);
}
av_frame_free(&s->out);
}
commit 96f860853eed202525b63dad1e6dfab32e0eec49
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:28:54 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/asrc_sine: use AVFilterContext for logging
diff --git a/libavfilter/asrc_sine.c b/libavfilter/asrc_sine.c
index 337efda8eb..1175a79746 100644
--- a/libavfilter/asrc_sine.c
+++ b/libavfilter/asrc_sine.c
@@ -257,7 +257,7 @@ static int activate(AVFilterContext *ctx)
if (!ff_outlink_frame_wanted(outlink))
return FFERROR_NOT_READY;
if (nb_samples <= 0) {
- av_log(sine, AV_LOG_WARNING, "nb samples expression evaluated to %d, "
+ av_log(ctx, AV_LOG_WARNING, "nb samples expression evaluated to %d, "
"defaulting to 1024\n", nb_samples);
nb_samples = 1024;
}
commit dcd378ad046e2165601c05759f8984137ac0c2d2
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:28:25 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/asrc_sinc: use AVFilterContext for logging
diff --git a/libavfilter/asrc_sinc.c b/libavfilter/asrc_sinc.c
index 05cf53fed8..ef6841c876 100644
--- a/libavfilter/asrc_sinc.c
+++ b/libavfilter/asrc_sinc.c
@@ -201,8 +201,9 @@ static float safe_log(float x)
return -26;
}
-static int fir_to_phase(SincContext *s, float **h, int *len, int *post_len, float phase)
+static int fir_to_phase(AVFilterContext *ctx, float **h, int *len, int *post_len, float phase)
{
+ SincContext *s = ctx->priv;
float *pi_wraps, *work, phase1 = (phase > 50.f ? 100.f - phase : phase) / 50.f;
int i, work_len, begin, end, imp_peak = 0, peak = 0, ret;
float imp_sum = 0, peak_imp_sum = 0, scale = 1.f;
@@ -313,7 +314,7 @@ static int fir_to_phase(SincContext *s, float **h, int *len, int *post_len, floa
}
*post_len = phase > 50 ? peak - begin : begin + *len - (peak + 1);
- av_log(s, AV_LOG_DEBUG, "%d nPI=%g peak-sum@%i=%g (val@%i=%g); len=%i post=%i (%g%%)\n",
+ av_log(ctx, AV_LOG_DEBUG, "%d nPI=%g peak-sum@%i=%g (val@%i=%g); len=%i post=%i (%g%%)\n",
work_len, pi_wraps[work_len >> 1] / M_PI, peak, peak_imp_sum, imp_peak,
work[imp_peak], *len, *post_len, 100.f - 100.f * *post_len / (*len - 1));
@@ -360,7 +361,7 @@ static int config_output(AVFilterLink *outlink)
}
if (s->phase != 50.f) {
- ret = fir_to_phase(s, &h[longer], &n, &post_peak, s->phase);
+ ret = fir_to_phase(ctx, &h[longer], &n, &post_peak, s->phase);
if (ret < 0)
goto cleanup;
} else {
commit d360c212afb35cb9ded9bb984b44180cdb67bca9
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:27:30 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/asrc_hilbert: use AVFilterContext for logging
diff --git a/libavfilter/asrc_hilbert.c b/libavfilter/asrc_hilbert.c
index aeaf49e642..1470056e9b 100644
--- a/libavfilter/asrc_hilbert.c
+++ b/libavfilter/asrc_hilbert.c
@@ -61,7 +61,7 @@ static av_cold int init(AVFilterContext *ctx)
HilbertContext *s = ctx->priv;
if (!(s->nb_taps & 1)) {
- av_log(s, AV_LOG_ERROR, "Number of taps %d must be odd length.\n", s->nb_taps);
+ av_log(ctx, AV_LOG_ERROR, "Number of taps %d must be odd length.\n", s->nb_taps);
return AVERROR(EINVAL);
}
commit 2e8d3548e17df7affa96871073938aa8fedfcb65
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:27:02 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/asrc_afirsrc: use AVFilterContext for logging
diff --git a/libavfilter/asrc_afirsrc.c b/libavfilter/asrc_afirsrc.c
index 49ee4122fb..5efcbdcca0 100644
--- a/libavfilter/asrc_afirsrc.c
+++ b/libavfilter/asrc_afirsrc.c
@@ -92,7 +92,7 @@ static av_cold int init(AVFilterContext *ctx)
AudioFIRSourceContext *s = ctx->priv;
if (!(s->nb_taps & 1)) {
- av_log(s, AV_LOG_WARNING, "Number of taps %d must be odd length.\n", s->nb_taps);
+ av_log(ctx, AV_LOG_WARNING, "Number of taps %d must be odd length.\n", s->nb_taps);
s->nb_taps |= 1;
}
commit 4cc71fb806ac7b6a1c26df454e9a64ba71ecd5fc
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:39:17 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/af_silencedetect: use AVFilterContext for logging
diff --git a/libavfilter/af_silencedetect.c b/libavfilter/af_silencedetect.c
index 7011978b0e..532f6b08af 100644
--- a/libavfilter/af_silencedetect.c
+++ b/libavfilter/af_silencedetect.c
@@ -45,7 +45,7 @@ typedef struct SilenceDetectContext {
int last_sample_rate; ///< last sample rate to check for sample rate changes
AVRational time_base; ///< time_base
- void (*silencedetect)(struct SilenceDetectContext *s, AVFrame *insamples,
+ void (*silencedetect)(AVFilterContext *ctx, AVFrame *insamples,
int nb_samples, int64_t nb_samples_notify,
AVRational time_base);
} SilenceDetectContext;
@@ -75,10 +75,11 @@ static void set_meta(AVFrame *insamples, int channel, const char *key, char *val
snprintf(key2, sizeof(key2), "lavfi.%s", key);
av_dict_set(&insamples->metadata, key2, value, 0);
}
-static av_always_inline void update(SilenceDetectContext *s, AVFrame *insamples,
+static av_always_inline void update(AVFilterContext *ctx, AVFrame *insamples,
int is_silence, int current_sample, int64_t nb_samples_notify,
AVRational time_base)
{
+ SilenceDetectContext *s = ctx->priv;
int channel = current_sample % s->independent_channels;
if (is_silence) {
if (s->start[channel] == INT64_MIN) {
@@ -89,8 +90,8 @@ static av_always_inline void update(SilenceDetectContext *s, AVFrame *insamples,
set_meta(insamples, s->mono ? channel + 1 : 0, "silence_start",
av_ts2timestr(s->start[channel], &time_base));
if (s->mono)
- av_log(s, AV_LOG_INFO, "channel: %d | ", channel);
- av_log(s, AV_LOG_INFO, "silence_start: %s\n",
+ av_log(ctx, AV_LOG_INFO, "channel: %d | ", channel);
+ av_log(ctx, AV_LOG_INFO, "silence_start: %s\n",
av_ts2timestr(s->start[channel], &time_base));
}
}
@@ -107,8 +108,8 @@ static av_always_inline void update(SilenceDetectContext *s, AVFrame *insamples,
av_ts2timestr(duration_ts, &time_base));
}
if (s->mono)
- av_log(s, AV_LOG_INFO, "channel: %d | ", channel);
- av_log(s, AV_LOG_INFO, "silence_end: %s | silence_duration: %s\n",
+ av_log(ctx, AV_LOG_INFO, "channel: %d | ", channel);
+ av_log(ctx, AV_LOG_INFO, "silence_end: %s | silence_duration: %s\n",
av_ts2timestr(end_pts, &time_base),
av_ts2timestr(duration_ts, &time_base));
}
@@ -118,24 +119,26 @@ static av_always_inline void update(SilenceDetectContext *s, AVFrame *insamples,
}
#define SILENCE_DETECT(name, type) \
-static void silencedetect_##name(SilenceDetectContext *s, AVFrame *insamples, \
+static void silencedetect_##name(AVFilterContext *ctx, AVFrame *insamples, \
int nb_samples, int64_t nb_samples_notify, \
AVRational time_base) \
{ \
+ SilenceDetectContext *s = ctx->priv; \
const type *p = (const type *)insamples->data[0]; \
const type noise = s->noise; \
int i; \
\
for (i = 0; i < nb_samples; i++, p++) \
- update(s, insamples, *p < noise && *p > -noise, i, \
+ update(ctx, insamples, *p < noise && *p > -noise, i, \
nb_samples_notify, time_base); \
}
#define SILENCE_DETECT_PLANAR(name, type) \
-static void silencedetect_##name(SilenceDetectContext *s, AVFrame *insamples, \
+static void silencedetect_##name(AVFilterContext *ctx, AVFrame *insamples, \
int nb_samples, int64_t nb_samples_notify, \
AVRational time_base) \
{ \
+ SilenceDetectContext *s = ctx->priv; \
const int channels = insamples->ch_layout.nb_channels; \
const type noise = s->noise; \
\
@@ -143,7 +146,7 @@ static void silencedetect_##name(SilenceDetectContext *s, AVFrame *insamples,
for (int i = 0; i < nb_samples; i++) { \
for (int ch = 0; ch < insamples->ch_layout.nb_channels; ch++) { \
const type *p = (const type *)insamples->extended_data[ch]; \
- update(s, insamples, p[i] < noise && p[i] > -noise, \
+ update(ctx, insamples, p[i] < noise && p[i] > -noise, \
channels * i + ch, \
nb_samples_notify, time_base); \
} \
@@ -209,7 +212,8 @@ static int config_input(AVFilterLink *inlink)
static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
{
- SilenceDetectContext *s = inlink->dst->priv;
+ AVFilterContext *ctx = inlink->dst;
+ SilenceDetectContext *s = ctx->priv;
const int nb_channels = inlink->ch_layout.nb_channels;
const int srate = inlink->sample_rate;
const int nb_samples = insamples->nb_samples * nb_channels;
@@ -226,7 +230,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
s->frame_end = insamples->pts + av_rescale_q(insamples->nb_samples,
(AVRational){ 1, s->last_sample_rate }, inlink->time_base);
- s->silencedetect(s, insamples, nb_samples, nb_samples_notify,
+ s->silencedetect(ctx, insamples, nb_samples, nb_samples_notify,
inlink->time_base);
return ff_filter_frame(inlink->dst->outputs[0], insamples);
@@ -239,7 +243,7 @@ static av_cold void uninit(AVFilterContext *ctx)
for (c = 0; c < s->independent_channels; c++)
if (s->start[c] > INT64_MIN)
- update(s, NULL, 0, c, 0, s->time_base);
+ update(ctx, NULL, 0, c, 0, s->time_base);
av_freep(&s->nb_null_samples);
av_freep(&s->start);
}
commit 892c43952536ab52a927ba3c89ed04502a165d68
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:19:36 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/af_lv2: use AVFilterContext when logging
diff --git a/libavfilter/af_lv2.c b/libavfilter/af_lv2.c
index 44405b04f9..e5097d60d4 100644
--- a/libavfilter/af_lv2.c
+++ b/libavfilter/af_lv2.c
@@ -166,8 +166,9 @@ static const char *uri_table_unmap(LV2_URID_Map_Handle handle, LV2_URID urid)
return NULL;
}
-static void connect_ports(LV2Context *s, AVFrame *in, AVFrame *out)
+static void connect_ports(AVFilterContext *ctx, AVFrame *in, AVFrame *out)
{
+ LV2Context *s = ctx->priv;
int ich = 0, och = 0, i;
for (i = 0; i < s->nb_ports; i++) {
@@ -180,7 +181,7 @@ static void connect_ports(LV2Context *s, AVFrame *in, AVFrame *out)
} else if (lilv_port_is_a(s->plugin, port, s->lv2_OutputPort)) {
lilv_instance_connect_port(s->instance, i, out->extended_data[och++]);
} else {
- av_log(s, AV_LOG_WARNING, "port %d neither input nor output, skipping\n", i);
+ av_log(ctx, AV_LOG_WARNING, "port %d neither input nor output, skipping\n", i);
}
} else if (lilv_port_is_a(s->plugin, port, s->atom_AtomPort)) {
if (lilv_port_is_a(s->plugin, port, s->lv2_InputPort)) {
@@ -217,7 +218,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
av_frame_copy_props(out, in);
}
- connect_ports(s, in, out);
+ connect_ports(ctx, in, out);
lilv_instance_run(s->instance, in->nb_samples);
@@ -245,7 +246,7 @@ static int request_frame(AVFilterLink *outlink)
if (!out)
return AVERROR(ENOMEM);
- connect_ports(s, out, out);
+ connect_ports(ctx, out, out);
lilv_instance_run(s->instance, out->nb_samples);
@@ -302,7 +303,7 @@ static int config_output(AVFilterLink *outlink)
s->instance = lilv_plugin_instantiate(s->plugin, sample_rate, s->features);
if (!s->instance) {
- av_log(s, AV_LOG_ERROR, "Failed to instantiate <%s>\n", lilv_node_as_uri(lilv_plugin_get_uri(s->plugin)));
+ av_log(ctx, AV_LOG_ERROR, "Failed to instantiate <%s>\n", lilv_node_as_uri(lilv_plugin_get_uri(s->plugin)));
return AVERROR(EINVAL);
}
@@ -370,7 +371,7 @@ static int config_output(AVFilterLink *outlink)
port = lilv_plugin_get_port_by_symbol(s->plugin, sym);
lilv_node_free(sym);
if (!port) {
- av_log(s, AV_LOG_WARNING, "Unknown option: <%s>\n", str);
+ av_log(ctx, AV_LOG_WARNING, "Unknown option: <%s>\n", str);
} else {
index = lilv_port_get_index(s->plugin, port);
s->controls[index] = val;
@@ -404,7 +405,7 @@ static av_cold int init(AVFilterContext *ctx)
uri = lilv_new_uri(s->world, s->plugin_uri);
if (!uri) {
- av_log(s, AV_LOG_ERROR, "Invalid plugin URI <%s>\n", s->plugin_uri);
+ av_log(ctx, AV_LOG_ERROR, "Invalid plugin URI <%s>\n", s->plugin_uri);
return AVERROR(EINVAL);
}
@@ -414,7 +415,7 @@ static av_cold int init(AVFilterContext *ctx)
lilv_node_free(uri);
if (!plugin) {
- av_log(s, AV_LOG_ERROR, "Plugin <%s> not found\n", s->plugin_uri);
+ av_log(ctx, AV_LOG_ERROR, "Plugin <%s> not found\n", s->plugin_uri);
return AVERROR(EINVAL);
}
@@ -549,7 +550,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
port = lilv_plugin_get_port_by_symbol(s->plugin, sym);
lilv_node_free(sym);
if (!port) {
- av_log(s, AV_LOG_WARNING, "Unknown option: <%s>\n", cmd);
+ av_log(ctx, AV_LOG_WARNING, "Unknown option: <%s>\n", cmd);
} else {
index = lilv_port_get_index(s->plugin, port);
s->controls[index] = atof(args);
commit fb8f52d66c629f37178d7ed6ba36a26480e0c97e
Author: Niklas Haas <git at haasn.dev>
AuthorDate: Mon Aug 11 15:24:38 2025 +0200
Commit: Niklas Haas <ffmpeg at haasn.dev>
CommitDate: Tue Aug 12 09:01:39 2025 +0000
avfilter/af_afftdn: use AVFilterContext for logging
diff --git a/libavfilter/af_afftdn.c b/libavfilter/af_afftdn.c
index ce71d1f511..e97dfe1f0d 100644
--- a/libavfilter/af_afftdn.c
+++ b/libavfilter/af_afftdn.c
@@ -541,8 +541,9 @@ static void set_band_parameters(AudioFFTDeNoiseContext *s,
dnch->noise_band_auto_var[i] = dnch->max_var * exp((process_get_band_noise(s, dnch, i) - 2.0) * C);
}
-static void read_custom_noise(AudioFFTDeNoiseContext *s, int ch)
+static void read_custom_noise(AVFilterContext *ctx, int ch)
{
+ AudioFFTDeNoiseContext *s = ctx->priv;
DeNoiseChannel *dnch = &s->dnch[ch];
char *custom_noise_str, *p, *arg, *saveptr = NULL;
double band_noise[NB_PROFILE_BANDS] = { 0.f };
@@ -565,7 +566,7 @@ static void read_custom_noise(AudioFFTDeNoiseContext *s, int ch)
ret = av_sscanf(arg, "%f", &noise);
if (ret != 1) {
- av_log(s, AV_LOG_ERROR, "Custom band noise must be float.\n");
+ av_log(ctx, AV_LOG_ERROR, "Custom band noise must be float.\n");
break;
}
@@ -735,7 +736,7 @@ static int config_input(AVFilterLink *inlink)
dnch->band_noise[i] = get_band_noise(s, i, 1.0, 500.0, 1.0E10);
break;
case CUSTOM_NOISE:
- read_custom_noise(s, ch);
+ read_custom_noise(ctx, ch);
break;
default:
return AVERROR_BUG;
@@ -1009,10 +1010,11 @@ static void finish_sample_noise(AudioFFTDeNoiseContext *s,
}
}
-static void set_noise_profile(AudioFFTDeNoiseContext *s,
+static void set_noise_profile(AVFilterContext *ctx,
DeNoiseChannel *dnch,
double *sample_noise)
{
+ AudioFFTDeNoiseContext *s = ctx->priv;
double new_band_noise[NB_PROFILE_BANDS];
double temp[NB_PROFILE_BANDS];
double sum = 0.0;
@@ -1036,13 +1038,13 @@ static void set_noise_profile(AudioFFTDeNoiseContext *s,
reduce_mean(temp);
- av_log(s, AV_LOG_INFO, "bn=");
+ av_log(ctx, AV_LOG_INFO, "bn=");
for (int m = 0; m < NB_PROFILE_BANDS; m++) {
new_band_noise[m] = temp[m];
new_band_noise[m] = av_clipd(new_band_noise[m], -24.0, 24.0);
- av_log(s, AV_LOG_INFO, "%f ", new_band_noise[m]);
+ av_log(ctx, AV_LOG_INFO, "%f ", new_band_noise[m]);
}
- av_log(s, AV_LOG_INFO, "\n");
+ av_log(ctx, AV_LOG_INFO, "\n");
memcpy(dnch->band_noise, new_band_noise, sizeof(new_band_noise));
}
@@ -1182,7 +1184,7 @@ static int output_frame(AVFilterLink *inlink, AVFrame *in)
if (s->sample_noise_blocks <= 0)
break;
finish_sample_noise(s, dnch, sample_noise);
- set_noise_profile(s, dnch, sample_noise);
+ set_noise_profile(ctx, dnch, sample_noise);
set_parameters(s, dnch, 1, 1);
}
s->sample_noise = 0;
-----------------------------------------------------------------------
Summary of changes:
libavfilter/af_afftdn.c | 18 ++++++++++--------
libavfilter/af_lv2.c | 19 ++++++++++---------
libavfilter/af_silencedetect.c | 30 +++++++++++++++++-------------
libavfilter/asrc_afirsrc.c | 2 +-
libavfilter/asrc_hilbert.c | 2 +-
libavfilter/asrc_sinc.c | 7 ++++---
libavfilter/asrc_sine.c | 2 +-
libavfilter/avf_aphasemeter.c | 22 ++++++++++++----------
libavfilter/f_bench.c | 2 +-
libavfilter/vf_blackdetect.c | 4 ++--
libavfilter/vf_blackdetect_vulkan.c | 2 +-
libavfilter/vf_curves.c | 6 +++---
libavfilter/vf_dctdnoiz.c | 2 +-
libavfilter/vf_delogo.c | 14 ++++++++------
libavfilter/vf_drawbox.c | 5 +++--
libavfilter/vf_drawtext.c | 17 +++++++++--------
libavfilter/vf_freezedetect.c | 10 +++++-----
libavfilter/vf_gblur_vulkan.c | 13 +++++++------
libavfilter/vf_libplacebo.c | 21 +++++++++++----------
libavfilter/vf_libvmaf.c | 14 +++++++-------
libavfilter/vf_photosensitivity.c | 4 ++--
libavfilter/vf_scale_vulkan.c | 7 ++++---
libavfilter/vf_scdet.c | 2 +-
libavfilter/vf_scdet_vulkan.c | 2 +-
libavfilter/vf_selectivecolor.c | 17 +++++++++--------
libavfilter/vf_tonemap.c | 12 ++++++------
libavfilter/vf_vignette.c | 5 +++--
27 files changed, 140 insertions(+), 121 deletions(-)
hooks/post-receive
--
More information about the ffmpeg-cvslog
mailing list