pbutils: descriptions: add meta/x-klv
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-base / gst-libs / gst / pbutils / descriptions.c
index 8caa116..2544aa9 100644 (file)
@@ -37,7 +37,7 @@
 # include "config.h"
 #endif
 
-#include "gst/gst-i18n-plugin.h"
+#include <glib/gi18n-lib.h>
 
 #include <gst/audio/audio.h>
 #include <gst/video/video.h>
@@ -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,10 @@ 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, ""},
+  /* metadata */
+  {"application/x-onvif-metadata", "ONVIF Timed Metadata", FLAG_METADATA, ""},
+  {"meta/x-klv", "KLV Metadata", FLAG_METADATA, ""},
 };
 
 static const gchar *
@@ -649,7 +653,7 @@ format_info_get_desc (const FormatInfo * info, const GstCaps * caps)
       case 1:
       case 2:
       case 3:
-        if (str && strncmp (str, "MSS", 3)) {
+        if (str && !strncmp (str, "MSS", 3)) {
           return g_strdup_printf ("Windows Media Video %d Screen", ver + 6);
         } else {
           return g_strdup_printf ("Windows Media Video %d", ver + 6);
@@ -1332,20 +1336,22 @@ gst_pb_utils_get_caps_description_flags (const GstCaps * caps)
   /* A separate flags type is used because internally more flags are needed
    * for filtering purposes, e.g. the SYSTEMSTREAM flag */
   if (info) {
-    if ((info->flags | FLAG_CONTAINER))
+    if ((info->flags & FLAG_CONTAINER))
       flags |= GST_PBUTILS_CAPS_DESCRIPTION_FLAG_CONTAINER;
-    if ((info->flags | FLAG_AUDIO))
+    if ((info->flags & FLAG_AUDIO))
       flags |= GST_PBUTILS_CAPS_DESCRIPTION_FLAG_AUDIO;
-    if ((info->flags | FLAG_VIDEO))
+    if ((info->flags & FLAG_VIDEO))
       flags |= GST_PBUTILS_CAPS_DESCRIPTION_FLAG_VIDEO;
-    if ((info->flags | FLAG_IMAGE))
+    if ((info->flags & FLAG_IMAGE))
       flags |= GST_PBUTILS_CAPS_DESCRIPTION_FLAG_IMAGE;
-    if ((info->flags | FLAG_SUB))
+    if ((info->flags & FLAG_SUB))
       flags |= GST_PBUTILS_CAPS_DESCRIPTION_FLAG_SUBTITLE;
-    if ((info->flags | FLAG_TAG))
+    if ((info->flags & FLAG_TAG))
       flags |= GST_PBUTILS_CAPS_DESCRIPTION_FLAG_TAG;
-    if ((info->flags | FLAG_GENERIC))
+    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);