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

Git pushed a commit to branch master
in repository ffmpeg.

commit fe25e54d0f6b939a1c2fbe44431c0af7bd40867f
Author:     Niklas Haas <[email protected]>
AuthorDate: Sat Feb 21 14:24:54 2026 +0100
Commit:     Niklas Haas <[email protected]>
CommitDate: Mon Feb 23 19:39:17 2026 +0000

    swscale/graph: move output image into separate struct
    
    I want to add more metadata to this and also turn it into a refstruct,
    but get the cosmetic diff out of the way first.
    
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/graph.c | 20 +++++++++++---------
 libswscale/graph.h |  9 ++++++++-
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/libswscale/graph.c b/libswscale/graph.c
index 6b9e6f4b25..5d697b2660 100644
--- a/libswscale/graph.c
+++ b/libswscale/graph.c
@@ -38,10 +38,12 @@
 
 static int pass_alloc_output(SwsPass *pass)
 {
-    if (!pass || pass->output.data[0])
+    if (!pass || pass->output.img.data[0])
         return 0;
-    pass->output.fmt = pass->format;
-    return av_image_alloc(pass->output.data, pass->output.linesize, 
pass->width,
+
+    SwsPassBuffer *output = &pass->output;
+    output->img.fmt = pass->format;
+    return av_image_alloc(output->img.data, output->img.linesize, pass->width,
                           pass->num_slices * pass->slice_h, pass->format, 64);
 }
 
@@ -61,7 +63,7 @@ SwsPass *ff_sws_graph_add_pass(SwsGraph *graph, enum 
AVPixelFormat fmt,
     pass->width  = width;
     pass->height = height;
     pass->input  = input;
-    pass->output.fmt = AV_PIX_FMT_NONE;
+    pass->output.img.fmt = AV_PIX_FMT_NONE;
 
     ret = pass_alloc_output(input);
     if (ret < 0) {
@@ -671,8 +673,8 @@ static void sws_graph_worker(void *priv, int jobnr, int 
threadnr, int nb_jobs,
 {
     SwsGraph *graph = priv;
     const SwsPass *pass = graph->exec.pass;
-    const SwsImg *input  = pass->input ? &pass->input->output : 
graph->exec.input;
-    const SwsImg *output = pass->output.data[0] ? &pass->output : 
graph->exec.output;
+    const SwsImg *input  = pass->input ? &pass->input->output.img : 
graph->exec.input;
+    const SwsImg *output = pass->output.img.data[0] ? &pass->output.img : 
graph->exec.output;
     const int slice_y = jobnr * pass->slice_h;
     const int slice_h = FFMIN(pass->slice_h, pass->height - slice_y);
 
@@ -726,7 +728,7 @@ void ff_sws_graph_free(SwsGraph **pgraph)
         SwsPass *pass = graph->passes[i];
         if (pass->free)
             pass->free(pass->priv);
-        av_free(pass->output.data[0]);
+        av_free(pass->output.img.data[0]);
         av_free(pass);
     }
     av_free(graph->passes);
@@ -787,8 +789,8 @@ void ff_sws_graph_run(SwsGraph *graph, const SwsImg 
*output, const SwsImg *input
         const SwsPass *pass = graph->passes[i];
         graph->exec.pass = pass;
         if (pass->setup) {
-            pass->setup(pass->output.data[0] ? &pass->output : output,
-                        pass->input ? &pass->input->output : input, pass);
+            pass->setup(pass->output.img.data[0] ? &pass->output.img : output,
+                        pass->input ? &pass->input->output.img : input, pass);
         }
         avpriv_slicethread_execute(graph->slicethread, pass->num_slices, 0);
     }
diff --git a/libswscale/graph.h b/libswscale/graph.h
index 44944a3c35..b5f7ed5ff2 100644
--- a/libswscale/graph.h
+++ b/libswscale/graph.h
@@ -60,6 +60,13 @@ typedef struct SwsGraph SwsGraph;
 typedef void (*sws_filter_run_t)(const SwsImg *out, const SwsImg *in,
                                  int y, int h, const SwsPass *pass);
 
+/**
+ * Represents an allocated output buffer for a filter pass.
+ */
+typedef struct SwsPassBuffer {
+    SwsImg img;
+} SwsPassBuffer;
+
 /**
  * Represents a single filter pass in the scaling graph. Each filter will
  * read from some previous pass's output, and write to a buffer associated
@@ -88,7 +95,7 @@ struct SwsPass {
     /**
      * Filter output buffer. Allocated on demand and freed automatically.
      */
-    SwsImg output;
+    SwsPassBuffer output;
 
     /**
      * Called once from the main thread before running the filter. Optional.

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

Reply via email to