pbutils: Add GST_PBUTILS_CAPS_DESCRIPTION_FLAG_METADATA and ONVIF XML Timed MetaData
authorSebastian Dröge <sebastian@centricular.com>
Thu, 19 May 2022 09:17:59 +0000 (12:17 +0300)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 20 May 2022 13:01:44 +0000 (13:01 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2453>

subprojects/gst-plugins-base/gst-libs/gst/pbutils/descriptions.c
subprojects/gst-plugins-base/gst-libs/gst/pbutils/descriptions.h

index a46823b..d289bf3 100644 (file)
@@ -56,7 +56,8 @@ typedef enum
   FLAG_IMAGE = (1 << 4),        /* format is an image format, or image container/tag  */
   FLAG_SUB = (1 << 5),          /* format is a subtitle format, or subtitle container */
   FLAG_TAG = (1 << 6),          /* format is a tag/container                          */
-  FLAG_GENERIC = (1 << 7)       /* format is a generic container (e.g. multipart)     */
+  FLAG_GENERIC = (1 << 7),      /* format is a generic container (e.g. multipart)     */
+  FLAG_METADATA = (1 << 8),     /* format is a metadata format, or metadata container/tag */
 } FormatFlags;
 
 typedef struct
@@ -330,7 +331,8 @@ static const FormatInfo formats[] = {
   {"video/x-svq", NULL, FLAG_VIDEO, ""},
   {"video/x-wmv", NULL, FLAG_VIDEO, ""},
   {"video/x-xan", NULL, FLAG_VIDEO, ""},
-  {"video/x-tscc", NULL, FLAG_VIDEO, ""}
+  {"video/x-tscc", NULL, FLAG_VIDEO, ""},
+  {"application/x-onvif-metadata", "ONVIF XML Timed MetaData", FLAG_METADATA, ""}
 };
 
 static const gchar *
@@ -1346,6 +1348,8 @@ gst_pb_utils_get_caps_description_flags (const GstCaps * caps)
       flags |= GST_PBUTILS_CAPS_DESCRIPTION_FLAG_TAG;
     if ((info->flags | FLAG_GENERIC))
       flags |= GST_PBUTILS_CAPS_DESCRIPTION_FLAG_GENERIC;
+    if ((info->flags | FLAG_METADATA))
+      flags |= GST_PBUTILS_CAPS_DESCRIPTION_FLAG_METADATA;
   }
 
   gst_caps_unref (tmp);
index 8b28bf7..c1b7845 100644 (file)
@@ -40,6 +40,8 @@ G_BEGIN_DECLS
  * @GST_PBUTILS_CAPS_DESCRIPTION_FLAG_TAG: Container format is a tags container.
  * @GST_PBUTILS_CAPS_DESCRIPTION_FLAG_GENERIC: Container format can store any kind of
  *     stream type.
+ * @GST_PBUTILS_CAPS_DESCRIPTION_FLAG_METADATA: Caps describe a metadata
+ *     format, or a container format that can store metadata.
  *
  * Flags that are returned by gst_pb_utils_get_caps_description_flags() and
  * describe the format of the caps.
@@ -54,6 +56,17 @@ typedef enum {
   GST_PBUTILS_CAPS_DESCRIPTION_FLAG_SUBTITLE  = 1 << 4,
   GST_PBUTILS_CAPS_DESCRIPTION_FLAG_TAG       = 1 << 5,
   GST_PBUTILS_CAPS_DESCRIPTION_FLAG_GENERIC   = 1 << 6,
+
+  /**
+   * GST_PBUTILS_CAPS_DESCRIPTION_FLAG_METADATA:
+   *
+   * Caps describe a metadata format, or a container format that can store
+   * metadata.
+   *
+   * Since: 1.22
+   */
+
+  GST_PBUTILS_CAPS_DESCRIPTION_FLAG_METADATA  = 1 << 7,
 } GstPbUtilsCapsDescriptionFlags;
 
 /*