diff --git a/girs/GstVideo-1.0.gir b/girs/GstVideo-1.0.gir index 6cdf873170..11a83ad97f 100644 --- a/girs/GstVideo-1.0.gir +++ b/girs/GstVideo-1.0.gir @@ -10110,6 +10110,12 @@ for details about the layout and packing of these formats in memory. @GST_VIDEO_FORMAT_NV12_10LE40 with 4x4 pixels tiles (5 bytes per tile row) (Since: 1.24) + + DMA DRM special format. It's only used with + memory:DMABuf #GstCapsFeatures, where an extra + parameter (drm-format) is required to define the + image format and its memory layout. + Converts a FOURCC value into the corresponding #GstVideoFormat. If the FOURCC cannot be represented by #GstVideoFormat, diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-converter.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-converter.c index 197622abca..2048c4bfb9 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-converter.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-converter.c @@ -7355,6 +7355,7 @@ get_scale_format (GstVideoFormat format, gint plane) case GST_VIDEO_FORMAT_NV12_8L128: case GST_VIDEO_FORMAT_NV12_10BE_8L128: case GST_VIDEO_FORMAT_NV12_10LE40_4L4: + case GST_VIDEO_FORMAT_DMA_DRM: res = format; g_assert_not_reached (); break; diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-format.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-format.c index 74d2cab35c..04408c9b5e 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-format.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-format.c @@ -7343,6 +7343,8 @@ static const VideoFormat formats[] = { MAKE_YUV_T_FORMAT (NV12_10LE40_4L4, "raw video", GST_MAKE_FOURCC ('M', 'H', '2', '1'), DPTH10_10_10, PSTR0, PLANE011, OFFS001, SUB420, PACK_NV12_10LE40_TILED, TILE_10bit_4x4 (LINEAR)), + {0x00000000, {GST_VIDEO_FORMAT_DMA_DRM, "DMA_DRM", "DMA DRM video", + GST_VIDEO_FORMAT_FLAG_COMPLEX, DPTH0, PSTR0, PLANE_NA, OFFS0}}, }; G_GNUC_END_IGNORE_DEPRECATIONS; @@ -7818,7 +7820,8 @@ generate_raw_video_formats (gpointer data) all->formats[i] = gst_video_format_from_string (g_value_get_string (v)); g_assert (all->formats[i] != GST_VIDEO_FORMAT_UNKNOWN - && all->formats[i] != GST_VIDEO_FORMAT_ENCODED); + && all->formats[i] != GST_VIDEO_FORMAT_ENCODED + && all->formats[i] != GST_VIDEO_FORMAT_DMA_DRM); } g_value_unset (&list); @@ -7905,7 +7908,8 @@ gst_video_make_raw_caps_with_features (const GstVideoFormat formats[], GValue v = G_VALUE_INIT; g_return_val_if_fail (formats[i] != GST_VIDEO_FORMAT_UNKNOWN - && formats[i] != GST_VIDEO_FORMAT_ENCODED, NULL); + && formats[i] != GST_VIDEO_FORMAT_ENCODED + && formats[i] != GST_VIDEO_FORMAT_DMA_DRM, NULL); g_value_init (&v, G_TYPE_STRING); g_value_set_static_string (&v, gst_video_format_to_string (formats[i])); diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-format.h b/subprojects/gst-plugins-base/gst-libs/gst/video/video-format.h index b2381a8584..40bbbf692e 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-format.h +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-format.h @@ -146,6 +146,10 @@ G_BEGIN_DECLS * @GST_VIDEO_FORMAT_NV12_8L128 : NV12 with 8x128 tiles in linear order (Since: 1.22) * @GST_VIDEO_FORMAT_NV12_10BE_8L128 : NV12 10bit big endian with 8x128 tiles in linear order (Since: 1.22) * @GST_VIDEO_FORMAT_NV12_10LE40_4L4: @GST_VIDEO_FORMAT_NV12_10LE40 with 4x4 pixels tiles (5 bytes per tile row) (Since: 1.24) + * @GST_VIDEO_FORMAT_DMA_DRM: DMA DRM special format. It's only used with + * memory:DMABuf #GstCapsFeatures, where an extra + * parameter (drm-format) is required to define the + * image format and its memory layout. * * Enum value describing the most common video formats. * @@ -411,6 +415,17 @@ typedef enum { * Since: 1.24 */ GST_VIDEO_FORMAT_NV12_10LE40_4L4, + /** + * GST_VIDEO_FORMAT_DMA_DRM: + * + * @GST_VIDEO_FORMAT_DMA_DRM represent the DMA DRM special format. It's + * only used with memory:DMABuf #GstCapsFeatures, where an extra + * parameter (drm-format) is required to define the image format and + * its memory layout. + * + * Since: 1.24 + */ + GST_VIDEO_FORMAT_DMA_DRM, } GstVideoFormat; #define GST_VIDEO_MAX_PLANES 4 diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c index f363e86731..e49ad3dcf0 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c @@ -1268,6 +1268,7 @@ fill_planes (GstVideoInfo * info, gsize plane_size[GST_VIDEO_MAX_PLANES]) break; } case GST_VIDEO_FORMAT_ENCODED: + case GST_VIDEO_FORMAT_DMA_DRM: break; case GST_VIDEO_FORMAT_UNKNOWN: GST_ERROR ("invalid format");