1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00

swscale/format: add ff_fmt_clear()

Reset an SwsFormat to its fully unset/invalid state.
This commit is contained in:
Niklas Haas
2025-05-05 12:57:04 +02:00
parent 041a318299
commit 322f606fa8

View File

@@ -85,6 +85,20 @@ typedef struct SwsFormat {
SwsColor color;
} SwsFormat;
static inline void ff_fmt_clear(SwsFormat *fmt)
{
*fmt = (SwsFormat) {
.format = AV_PIX_FMT_NONE,
.range = AVCOL_RANGE_UNSPECIFIED,
.csp = AVCOL_SPC_UNSPECIFIED,
.loc = AVCHROMA_LOC_UNSPECIFIED,
.color = {
.prim = AVCOL_PRI_UNSPECIFIED,
.trc = AVCOL_TRC_UNSPECIFIED,
},
};
}
/**
* This function also sanitizes and strips the input data, removing irrelevant
* fields for certain formats.