This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 26d6ac56c10b5cbc67207b4abe3fae4b2ebe77f4 Author: Niklas Haas <[email protected]> AuthorDate: Thu Feb 26 12:40:33 2026 +0100 Commit: Lynne <[email protected]> CommitDate: Thu Feb 26 14:09:46 2026 +0100 swscale: add sws_test_hw_format() Allows users to test if a given hardware pixel format is supported by swscale. This is only a rough heuristic anyways, because the actual support may depend on the specific *combination* of frame attributes, and ultimately is better served by the `sws_test_frame` and `sws_frame_setup()` APIs anyways. Sponsored-by: Sovereign Tech Fund Signed-off-by: Niklas Haas <[email protected]> --- doc/APIchanges | 3 +++ libswscale/format.c | 8 ++++++++ libswscale/swscale.h | 11 ++++++++++- libswscale/version.h | 2 +- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index b92222e858..88005bb28e 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2025-03-28 API changes, most recent first: +2026-02-xx - xxxxxxxxxx - lsws 9.4.100 - swscale.h + Add sws_test_hw_format(). + 2026-02-19 - xxxxxxxxxx - lavf 62.10.100 - avformat.h Add demuxer command API consisting of: - Add avformat_send_command(). diff --git a/libswscale/format.c b/libswscale/format.c index d53acdbcdc..ae2a701f43 100644 --- a/libswscale/format.c +++ b/libswscale/format.c @@ -527,6 +527,14 @@ int sws_test_format(enum AVPixelFormat format, int output) return output ? sws_isSupportedOutput(format) : sws_isSupportedInput(format); } +int sws_test_hw_format(enum AVPixelFormat format) +{ + switch (format) { + case AV_PIX_FMT_NONE: return 1; + default: return 0; + } +} + int sws_test_colorspace(enum AVColorSpace csp, int output) { switch (csp) { diff --git a/libswscale/swscale.h b/libswscale/swscale.h index 495d500f14..8e6c06f504 100644 --- a/libswscale/swscale.h +++ b/libswscale/swscale.h @@ -267,7 +267,7 @@ void sws_free_context(SwsContext **ctx); ***************************/ /** - * Test if a given pixel format is supported. + * Test if a given (software) pixel format is supported. * * @param output If 0, test if compatible with the source/input frame; * otherwise, with the destination/output frame. @@ -277,6 +277,15 @@ void sws_free_context(SwsContext **ctx); */ int sws_test_format(enum AVPixelFormat format, int output); +/** + * Test if a given hardware pixel format is supported. + * + * @param format The hardware format to check, or AV_PIX_FMT_NONE. + * + * @return A positive integer if supported or AV_PIX_FMT_NONE, 0 otherwise. + */ +int sws_test_hw_format(enum AVPixelFormat format); + /** * Test if a given color space is supported. * diff --git a/libswscale/version.h b/libswscale/version.h index 51eb013a29..12412bd538 100644 --- a/libswscale/version.h +++ b/libswscale/version.h @@ -28,7 +28,7 @@ #include "version_major.h" -#define LIBSWSCALE_VERSION_MINOR 3 +#define LIBSWSCALE_VERSION_MINOR 4 #define LIBSWSCALE_VERSION_MICRO 100 #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
