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

Git pushed a commit to branch master
in repository ffmpeg.

commit 228ef8d97bc021630a5956cafb041d017cbe1593
Author:     Niklas Haas <[email protected]>
AuthorDate: Fri May 1 17:50:05 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Tue Jun 9 18:27:20 2026 +0200

    swscale/ops: make compile() take const SwsOpList *
    
    The old x86 backend was the only backend that actually mutated the ops list.
    With this gone, we can constify this parameter.
    
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/aarch64/ops.c   |  3 ++-
 libswscale/ops_dispatch.h  |  2 +-
 libswscale/ops_memcpy.c    |  2 +-
 libswscale/tests/sws_ops.c |  2 +-
 libswscale/uops.c          |  5 +++--
 libswscale/uops_backend.c  |  2 +-
 libswscale/vulkan/ops.c    | 26 +++++++++++++++-----------
 libswscale/x86/ops.c       |  2 +-
 8 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/libswscale/aarch64/ops.c b/libswscale/aarch64/ops.c
index 4598a8db6b..a7e96b16c3 100644
--- a/libswscale/aarch64/ops.c
+++ b/libswscale/aarch64/ops.c
@@ -172,7 +172,8 @@ static int aarch64_optimize(SwsAArch64BackendContext *bctx, 
SwsOpList *ops)
 }
 
 /*********************************************************************/
-static int aarch64_compile(SwsContext *ctx, SwsOpList *ops, SwsCompiledOp *out)
+static int aarch64_compile(SwsContext *ctx, const SwsOpList *ops,
+                           SwsCompiledOp *out)
 {
     SwsAArch64BackendContext bctx;
     int ret;
diff --git a/libswscale/ops_dispatch.h b/libswscale/ops_dispatch.h
index a2aa00a813..7f1304dcc4 100644
--- a/libswscale/ops_dispatch.h
+++ b/libswscale/ops_dispatch.h
@@ -140,7 +140,7 @@ typedef struct SwsOpBackend {
      *
      * Returns 0 or a negative error code.
      */
-    int (*compile)(SwsContext *ctx, SwsOpList *ops, SwsCompiledOp *out);
+    int (*compile)(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out);
 
     /**
      * If NONE, backend only supports software frames.
diff --git a/libswscale/ops_memcpy.c b/libswscale/ops_memcpy.c
index 769de96747..cce7aa3013 100644
--- a/libswscale/ops_memcpy.c
+++ b/libswscale/ops_memcpy.c
@@ -70,7 +70,7 @@ static void process(const SwsOpExec *exec, const void *priv,
     }
 }
 
-static int compile(SwsContext *ctx, SwsOpList *ops, SwsCompiledOp *out)
+static int compile(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out)
 {
     MemcpyPriv p = {0};
 
diff --git a/libswscale/tests/sws_ops.c b/libswscale/tests/sws_ops.c
index fdd618775a..30b9893e36 100644
--- a/libswscale/tests/sws_ops.c
+++ b/libswscale/tests/sws_ops.c
@@ -32,7 +32,7 @@
 
 static int pass_idx;
 
-static int print_ops(SwsContext *ctx, SwsOpList *ops, SwsCompiledOp *out)
+static int print_ops(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out)
 {
     if (pass_idx > 0)
         av_log(NULL, AV_LOG_INFO, " Sub-pass #%d:\n", pass_idx);
diff --git a/libswscale/uops.c b/libswscale/uops.c
index 3f2b81c205..66cefcd55f 100644
--- a/libswscale/uops.c
+++ b/libswscale/uops.c
@@ -769,7 +769,7 @@ static int register_uop(struct AVTreeNode **root, const 
SwsUOp *uop)
     return 0;
 }
 
-static int register_flags(SwsContext *ctx, SwsOpList *ops, SwsUOpFlags flags)
+static int register_flags(SwsContext *ctx, const SwsOpList *ops, SwsUOpFlags 
flags)
 {
     SwsUOpList *uops = ff_sws_uop_list_alloc();
     if (!uops)
@@ -796,7 +796,8 @@ static const SwsUOpFlags uop_flags[] = {
     SWS_UOP_FLAG_FMA, /* x86 backend */
 };
 
-static int register_uops(SwsContext *ctx, SwsOpList *ops, SwsCompiledOp *out)
+static int register_uops(SwsContext *ctx, const SwsOpList *ops,
+                         SwsCompiledOp *out)
 {
     for (int i = 0; i < FF_ARRAY_ELEMS(uop_flags); i++) {
         int ret = register_flags(ctx, ops, uop_flags[i]);
diff --git a/libswscale/uops_backend.c b/libswscale/uops_backend.c
index ee4d7465a7..fd7220a57a 100644
--- a/libswscale/uops_backend.c
+++ b/libswscale/uops_backend.c
@@ -134,7 +134,7 @@ static void process(const SwsOpExec *exec, const void *priv,
     }
 }
 
-static int compile(SwsContext *ctx, SwsOpList *ops, SwsCompiledOp *out)
+static int compile(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out)
 {
     int ret;
 
diff --git a/libswscale/vulkan/ops.c b/libswscale/vulkan/ops.c
index 5f289baf12..702bbdf38f 100644
--- a/libswscale/vulkan/ops.c
+++ b/libswscale/vulkan/ops.c
@@ -251,7 +251,7 @@ fail:
     return err;
 }
 
-static int create_bufs(FFVulkanOpsCtx *s, VulkanPriv *p, SwsOpList *ops)
+static int create_bufs(FFVulkanOpsCtx *s, VulkanPriv *p, const SwsOpList *ops)
 {
     int err;
     p->nb_data_bufs = 0;
@@ -390,8 +390,8 @@ typedef struct SPIRVIDs {
 } SPIRVIDs;
 
 /* Section 1: Function to define all shader header data, and decorations */
-static void define_shader_header(SwsContext *sws, FFVulkanShader *shd, 
SwsOpList *ops,
-                                 SPICtx *spi, SPIRVIDs *id)
+static void define_shader_header(SwsContext *sws, FFVulkanShader *shd,
+                                 const SwsOpList *ops, SPICtx *spi, SPIRVIDs 
*id)
 {
     spi_OpCapability(spi, SpvCapabilityShader); /* Shader type */
 
@@ -492,7 +492,8 @@ static void define_shader_header(SwsContext *sws, 
FFVulkanShader *shd, SwsOpList
 }
 
 /* Section 2: Define all types and constants */
-static void define_shader_consts(SwsContext *sws, SwsOpList *ops, SPICtx *spi, 
SPIRVIDs *id)
+static void define_shader_consts(SwsContext *sws, const SwsOpList *ops,
+                                 SPICtx *spi, SPIRVIDs *id)
 {
     /* Define scalar types */
     id->void_type    = spi_OpTypeVoid(spi);
@@ -651,7 +652,7 @@ static void define_shader_consts(SwsContext *sws, SwsOpList 
*ops, SPICtx *spi, S
 }
 
 /* Section 3: Define bindings */
-static void define_shader_bindings(SwsOpList *ops, SPICtx *spi, SPIRVIDs *id,
+static void define_shader_bindings(const SwsOpList *ops, SPICtx *spi, SPIRVIDs 
*id,
                                    int in_img_count, int out_img_count)
 {
     id->dither_ptr_elem_id = spi_OpTypePointer(spi, SpvStorageClassUniform,
@@ -908,7 +909,7 @@ static int read_filtered(SPICtx *spi, SPIRVIDs *id, const 
SwsOpList *ops,
 }
 
 static int add_ops_spirv(SwsContext *sws, VulkanPriv *p, FFVulkanOpsCtx *s,
-                         SwsOpList *ops, FFVulkanShader *shd)
+                         const SwsOpList *ops, FFVulkanShader *shd)
 {
     uint8_t spvbuf[1024*16];
     SPICtx spi_context = { 0 }, *spi = &spi_context;
@@ -1311,7 +1312,7 @@ static void 
add_desc_read_write(FFVulkanDescriptorSetBinding *out_desc,
 #define QSTR "(%i/%i%s)"
 #define QTYPE(Q) (Q).num, (Q).den, cur_type == SWS_PIXEL_F32 ? ".0f" : ""
 
-static void read_glsl(SwsOpList *ops, const SwsOp *op, FFVulkanShader *shd,
+static void read_glsl(const SwsOpList *ops, const SwsOp *op, FFVulkanShader 
*shd,
                       int idx, const char *type_name,
                       const char *type_v, const char *type_s)
 {
@@ -1356,7 +1357,7 @@ static void read_glsl(SwsOpList *ops, const SwsOp *op, 
FFVulkanShader *shd,
 }
 
 static int add_ops_glsl(SwsContext *sws, VulkanPriv *p, FFVulkanOpsCtx *s,
-                        SwsOpList *ops, FFVulkanShader *shd)
+                        const SwsOpList *ops, FFVulkanShader *shd)
 {
     int err;
     uint8_t *spv_data;
@@ -1608,7 +1609,8 @@ static int add_ops_glsl(SwsContext *sws, VulkanPriv *p, 
FFVulkanOpsCtx *s,
 }
 #endif
 
-static int compile(SwsContext *sws, SwsOpList *ops, SwsCompiledOp *out, int 
glsl)
+static int compile(SwsContext *sws, const SwsOpList *ops, SwsCompiledOp *out,
+                   int glsl)
 {
     int err;
     SwsInternal *c = sws_internal(sws);
@@ -1682,7 +1684,8 @@ fail:
 }
 
 #if HAVE_SPIRV_HEADERS_SPIRV_H || HAVE_SPIRV_UNIFIED1_SPIRV_H
-static int compile_spirv(SwsContext *sws, SwsOpList *ops, SwsCompiledOp *out)
+static int compile_spirv(SwsContext *sws, const SwsOpList *ops,
+                         SwsCompiledOp *out)
 {
     return compile(sws, ops, out, 0);
 }
@@ -1696,7 +1699,8 @@ const SwsOpBackend backend_spirv = {
 #endif
 
 #if CONFIG_LIBSHADERC || CONFIG_LIBGLSLANG
-static int compile_glsl(SwsContext *sws, SwsOpList *ops, SwsCompiledOp *out)
+static int compile_glsl(SwsContext *sws, const SwsOpList *ops,
+                        SwsCompiledOp *out)
 {
     return compile(sws, ops, out, 1);
 }
diff --git a/libswscale/x86/ops.c b/libswscale/x86/ops.c
index 335d0a85a8..0c0899479e 100644
--- a/libswscale/x86/ops.c
+++ b/libswscale/x86/ops.c
@@ -565,7 +565,7 @@ static void normalize_clear(SwsUOp *uop)
         uop->data.vec4[i].u32 = expand32(uop->type, uop->data.vec4[i]);
 }
 
-static int compile(SwsContext *ctx, SwsOpList *ops, SwsCompiledOp *out)
+static int compile(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out)
 {
     const int cpu_flags = av_get_cpu_flags();
     int ret, mmsize;

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

Reply via email to