This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 90669ab52e923fdcbab2b163d5165f90f1176dda Author: Niklas Haas <[email protected]> AuthorDate: Wed Apr 22 18:45:04 2026 +0200 Commit: Niklas Haas <[email protected]> CommitDate: Fri May 15 18:53:05 2026 +0200 swscale/ops: move ff_sws_compile_pass() and friends to ops_dispatch.h This function actually lives in ops_dispatch.c, and doesn't really make sense in ops.h anymore. We should also move some stuff out of ops_internal.h, which doesn't depend on any external ops stuff, here. This allows the backend/compilation-related stuff to co-exist more nicely. Signed-off-by: Niklas Haas <[email protected]> --- libswscale/graph.c | 1 + libswscale/ops.h | 11 ----------- libswscale/ops_dispatch.h | 48 +++++++++++++++++++++++++++++++++++++++++++++++ libswscale/ops_internal.h | 37 ------------------------------------ 4 files changed, 49 insertions(+), 48 deletions(-) diff --git a/libswscale/graph.c b/libswscale/graph.c index 24882b8a95..757c1097ef 100644 --- a/libswscale/graph.c +++ b/libswscale/graph.c @@ -37,6 +37,7 @@ #include "swscale_internal.h" #include "graph.h" #include "ops.h" +#include "ops_dispatch.h" int ff_sws_pass_aligned_width(const SwsPass *pass, int width) { diff --git a/libswscale/ops.h b/libswscale/ops.h index b23f500695..24eccacc79 100644 --- a/libswscale/ops.h +++ b/libswscale/ops.h @@ -372,17 +372,6 @@ enum SwsOpCompileFlags { SWS_OP_FLAG_OPTIMIZE = 1 << 0, }; -/** - * Resolves an operation list to a graph pass. The first and last operations - * must be a read/write respectively. `flags` is a list of SwsOpCompileFlags. - * - * Takes over ownership of `ops` and sets it to NULL, even on failure. - * - * Note: `ops` may be modified by this function. - */ -int ff_sws_compile_pass(SwsGraph *graph, SwsOpList **ops, int flags, - SwsPass *input, SwsPass **output); - /** * Helper function to enumerate over all possible (optimized) operation lists, * under the current set of options in `ctx`, and run the given callback on diff --git a/libswscale/ops_dispatch.h b/libswscale/ops_dispatch.h index a35e9be907..715f51139d 100644 --- a/libswscale/ops_dispatch.h +++ b/libswscale/ops_dispatch.h @@ -127,4 +127,52 @@ typedef struct SwsCompiledOp { void ff_sws_compiled_op_unref(SwsCompiledOp *comp); +typedef struct SwsOpBackend { + const char *name; /* Descriptive name for this backend */ + + /** + * Compile an operation list to an implementation chain. May modify `ops` + * freely; the original list will be freed automatically by the caller. + * + * Returns 0 or a negative error code. + */ + int (*compile)(SwsContext *ctx, SwsOpList *ops, SwsCompiledOp *out); + + /** + * If NONE, backend only supports software frames. + * Otherwise, frame hardware format must match hw_format for the backend + * to be used. + */ + enum AVPixelFormat hw_format; +} SwsOpBackend; + +/* List of all backends, terminated by NULL */ +extern const SwsOpBackend *const ff_sws_op_backends[]; + +/** + * Attempt to compile a list of operations using a specific backend. + * + * Returns 0 on success, or a negative error code on failure. + */ +int ff_sws_ops_compile_backend(SwsContext *ctx, const SwsOpBackend *backend, + const SwsOpList *ops, SwsCompiledOp *out); + +/** + * Compile a list of operations using the best available backend. + * + * Returns 0 on success, or a negative error code on failure. + */ +int ff_sws_ops_compile(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out); + +/** + * Resolves an operation list to a graph pass. The first and last operations + * must be a read/write respectively. `flags` is a list of SwsOpCompileFlags. + * + * Takes over ownership of `ops` and sets it to NULL, even on failure. + * + * Note: `ops` may be modified by this function. + */ +int ff_sws_compile_pass(SwsGraph *graph, SwsOpList **ops, int flags, + SwsPass *input, SwsPass **output); + #endif /* SWSCALE_OPS_DISPATCH_H */ diff --git a/libswscale/ops_internal.h b/libswscale/ops_internal.h index 91509ce67d..9d8da6bbb5 100644 --- a/libswscale/ops_internal.h +++ b/libswscale/ops_internal.h @@ -52,43 +52,6 @@ static inline void ff_sws_pack_op_decode(const SwsOp *op, uint64_t mask[4], int } } -typedef struct SwsOpBackend { - const char *name; /* Descriptive name for this backend */ - - /** - * Compile an operation list to an implementation chain. May modify `ops` - * freely; the original list will be freed automatically by the caller. - * - * Returns 0 or a negative error code. - */ - int (*compile)(SwsContext *ctx, SwsOpList *ops, SwsCompiledOp *out); - - /** - * If NONE, backend only supports software frames. - * Otherwise, frame hardware format must match hw_format for the backend - * to be used. - */ - enum AVPixelFormat hw_format; -} SwsOpBackend; - -/* List of all backends, terminated by NULL */ -extern const SwsOpBackend *const ff_sws_op_backends[]; - -/** - * Attempt to compile a list of operations using a specific backend. - * - * Returns 0 on success, or a negative error code on failure. - */ -int ff_sws_ops_compile_backend(SwsContext *ctx, const SwsOpBackend *backend, - const SwsOpList *ops, SwsCompiledOp *out); - -/** - * Compile a list of operations using the best available backend. - * - * Returns 0 on success, or a negative error code on failure. - */ -int ff_sws_ops_compile(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out); - /** * "Solve" an op list into a fixed shuffle mask, with an optional ability to * also directly clear the output value (for e.g. rgb24 -> rgb0). This can _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
