[FFmpeg-cvslog] lavfi/avfilter: add an "auto" constant to the threads option

Anton Khirnov git at videolan.org
Tue Apr 9 11:54:06 EEST 2024


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Apr  4 11:19:12 2024 +0200| [d7cde009ce7884995bb38505a26e819b9f57a3d2] | committer: Anton Khirnov

lavfi/avfilter: add an "auto" constant to the threads option

Analogous to the same constant in avfiltergraph and avcodec.
Cf. f599ae88c25.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d7cde009ce7884995bb38505a26e819b9f57a3d2
---

 libavfilter/avfilter.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 7f94e71fbc..049e4f62ca 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -652,7 +652,8 @@ static const AVOption avfilter_options[] = {
         { "slice", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AVFILTER_THREAD_SLICE }, .flags = FLAGS, .unit = "thread_type" },
     { "enable", "set enable expression", OFFSET(enable_str), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = TFLAGS },
     { "threads", "Allowed number of threads", OFFSET(nb_threads), AV_OPT_TYPE_INT,
-        { .i64 = 0 }, 0, INT_MAX, FLAGS },
+        { .i64 = 0 }, 0, INT_MAX, FLAGS, .unit = "threads" },
+        {"auto", "autodetect a suitable number of threads to use", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, .flags = FLAGS, .unit = "threads"},
     { "extra_hw_frames", "Number of extra hardware frames to allocate for the user",
         OFFSET(extra_hw_frames), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
     { NULL },



More information about the ffmpeg-cvslog mailing list