This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 945151851e93da81ca41cb886efb9622771868be
Author:     Niklas Haas <[email protected]>
AuthorDate: Mon Jun 1 17:32:03 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Wed Jun 3 21:39:55 2026 +0000

    swscale/tests/swscale: add -backends option
    
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/tests/swscale.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c
index deb450b894..a7b2474714 100644
--- a/libswscale/tests/swscale.c
+++ b/libswscale/tests/swscale.c
@@ -62,6 +62,7 @@ struct options {
     int align_dst;
     int legacy;
     int pretty;
+    int backends;
 };
 
 struct mode {
@@ -246,6 +247,7 @@ static int scale_new(AVFrame *dst, const AVFrame *src,
     sws_src_dst->flags  = mode->flags;
     sws_src_dst->dither = mode->dither;
     sws_src_dst->threads = opts->threads;
+    sws_src_dst->backends = opts->backends;
 
     int ret = sws_frame_setup(sws_src_dst, dst, src);
     if (ret < 0) {
@@ -912,6 +914,8 @@ static int parse_options(int argc, char **argv, struct 
options *opts, FILE **fp)
                     "       Test with a specific combination of flags\n"
                     "   -dither <mode>\n"
                     "       Test with a specific dither mode\n"
+                    "   -backends <backends>\n"
+                    "       Restrict to the given set of allowed swscale 
backends\n"
                     "   -unscaled <1 or 0>\n"
                     "       If 1, test only conversions that do not involve 
scaling\n"
                     "   -align_src <alignment>\n"
@@ -984,6 +988,15 @@ static int parse_options(int argc, char **argv, struct 
options *opts, FILE **fp)
                 fprintf(stderr, "invalid flags %s\n", argv[i + 1]);
                 return -1;
             }
+        } else if (!strcmp(argv[i], "-backends")) {
+            SwsContext *dummy = sws_alloc_context();
+            const AVOption *backends_opt = av_opt_find(dummy, "sws_backends", 
NULL, 0, 0);
+            int ret = av_opt_eval_flags(dummy, backends_opt, argv[i + 1], 
&opts->backends);
+            sws_free_context(&dummy);
+            if (ret < 0) {
+                fprintf(stderr, "invalid backends %s\n", argv[i + 1]);
+                return -1;
+            }
         } else if (!strcmp(argv[i], "-dither")) {
             opts->dither = atoi(argv[i + 1]);
         } else if (!strcmp(argv[i], "-unscaled")) {

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to