video-format: Add macro checking for validity of GstVideoFormatInfo

Mostly to maintain consistency with the GST_AUDIO_FORMAT_INFO_IS_VALID_RAW
macro.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2800>
This commit is contained in:
Philippe Normand 2022-12-12 13:43:30 +00:00 committed by GStreamer Marge Bot
parent 3345d16aed
commit d98c78251c

View file

@ -639,6 +639,17 @@ struct _GstVideoFormatInfo {
GstVideoTileInfo tile_info[GST_VIDEO_MAX_PLANES];
};
/**
* GST_VIDEO_FORMAT_INFO_IS_VALID_RAW:
*
* Tests that the given #GstVideoFormatInfo represents a valid un-encoded
* format.
*
* Since: 1.22
*/
#define GST_VIDEO_FORMAT_INFO_IS_VALID_RAW(info) \
(info != NULL && (info)->format > GST_VIDEO_FORMAT_ENCODED)
#define GST_VIDEO_FORMAT_INFO_FORMAT(info) ((info)->format)
#define GST_VIDEO_FORMAT_INFO_NAME(info) ((info)->name)
#define GST_VIDEO_FORMAT_INFO_FLAGS(info) ((info)->flags)