This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 6f1664382df8351d7d1cb4c7c9d4b2cab7701df3 Author: Niklas Haas <[email protected]> AuthorDate: Fri Mar 27 14:19:09 2026 +0100 Commit: Niklas Haas <[email protected]> CommitDate: Sat Mar 28 16:48:13 2026 +0000 swscale/format: add helper function to get "default" SwsFormat But still apply the sanitization/defaulting logic from ff_fmt_from_frame(). Signed-off-by: Niklas Haas <[email protected]> --- libswscale/format.c | 8 ++++++++ libswscale/format.h | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/libswscale/format.c b/libswscale/format.c index af37ee09c8..17eb405766 100644 --- a/libswscale/format.c +++ b/libswscale/format.c @@ -479,6 +479,14 @@ skip_hdr10: return fmt; } +void ff_fmt_from_pixfmt(enum AVPixelFormat pixfmt, SwsFormat *fmt) +{ + ff_fmt_clear(fmt); + fmt->format = pixfmt; + fmt->desc = av_pix_fmt_desc_get(pixfmt); + sanitize_fmt(fmt, fmt->desc); +} + static int infer_prim_ref(SwsColor *csp, const SwsColor *ref) { if (csp->prim != AVCOL_PRI_UNSPECIFIED) diff --git a/libswscale/format.h b/libswscale/format.h index d66851893f..61a8039f56 100644 --- a/libswscale/format.h +++ b/libswscale/format.h @@ -106,6 +106,11 @@ static inline void ff_fmt_clear(SwsFormat *fmt) */ SwsFormat ff_fmt_from_frame(const AVFrame *frame, int field); +/** + * Subset of ff_fmt_from_frame() that sets default metadata for the format. + */ +void ff_fmt_from_pixfmt(enum AVPixelFormat pixfmt, SwsFormat *fmt); + static inline int ff_color_equal(const SwsColor *c1, const SwsColor *c2) { return c1->prim == c2->prim && _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
