video/audio: #define metadata strings.
authorMathieu Duponchelle <mathieu.duponchelle@epitech.eu>
Wed, 21 Aug 2013 21:56:15 +0000 (23:56 +0200)
committerSebastian Dröge <slomo@circular-chaos.org>
Mon, 9 Sep 2013 13:37:02 +0000 (15:37 +0200)
For instance "orientation" becomes GST_VIDEO_ORIENTATION_METADATA.

docs/libs/gst-plugins-base-libs-sections.txt
gst-libs/gst/audio/audio.h
gst-libs/gst/audio/gstaudiometa.c
gst-libs/gst/video/gstvideometa.c
gst-libs/gst/video/video.h

index c2bc9ee..35d9cb6 100644 (file)
@@ -157,6 +157,8 @@ GST_AUDIO_INFO_LAYOUT
 
 GST_FRAMES_TO_CLOCK_TIME
 GST_CLOCK_TIME_TO_FRAMES
+GST_META_TAG_AUDIO_STR
+GST_META_TAG_AUDIO_CHANNELS_STR
 GST_AUDIO_NE
 GST_AUDIO_OE
 GST_AUDIO_RATE_RANGE
@@ -2119,6 +2121,11 @@ gst_video_convert_sample_async
 GstVideoAlignment
 gst_video_alignment_reset
 
+GST_META_TAG_VIDEO_STR
+GST_META_TAG_VIDEO_ORIENTATION_STR
+GST_META_TAG_VIDEO_SIZE_STR
+GST_META_TAG_VIDEO_COLORSPACE_STR
+
 #video-event.h
 <SUBSECTION>
 gst_video_event_new_still_frame
index d7a63c7..e3c91fd 100644 (file)
@@ -51,6 +51,23 @@ G_BEGIN_DECLS
 #define GST_CLOCK_TIME_TO_FRAMES(clocktime, rate) \
   gst_util_uint64_scale_round (clocktime, rate, GST_SECOND)
 
+/* metadata macros */
+
+/**
+ * GST_META_TAG_AUDIO_STR:
+ * This metadata is relevant for audio streams.
+ *
+ * Since: 1.2
+ */
+#define GST_META_TAG_AUDIO_STR "audio"
+/**
+ * GST_META_TAG_AUDIO_CHANNELS_STR:
+ * This metadata stays relevant as long as channels are unchanged.
+ *
+ * Since: 1.2
+ */
+#define GST_META_TAG_AUDIO_CHANNELS_STR "channels"
+
 /*
  * this library defines and implements some helper functions for audio
  * handling
index f18e069..b0a1845 100644 (file)
@@ -157,7 +157,8 @@ GType
 gst_audio_downmix_meta_api_get_type (void)
 {
   static volatile GType type;
-  static const gchar *tags[] = { NULL };
+  static const gchar *tags[] =
+      { GST_META_TAG_AUDIO_STR, GST_META_TAG_AUDIO_CHANNELS_STR, NULL };
 
   if (g_once_init_enter (&type)) {
     GType _type = gst_meta_api_type_register ("GstAudioDownmixMetaAPI", tags);
index efefea7..1613560 100644 (file)
@@ -67,7 +67,11 @@ GType
 gst_video_meta_api_get_type (void)
 {
   static volatile GType type = 0;
-  static const gchar *tags[] = { "memory", "colorspace", "size", NULL };
+  static const gchar *tags[] =
+      { GST_META_TAG_VIDEO_STR, GST_META_TAG_MEMORY_STR,
+    GST_META_TAG_VIDEO_COLORSPACE_STR,
+    GST_META_TAG_VIDEO_SIZE_STR, NULL
+  };
 
   if (g_once_init_enter (&type)) {
     GType _type = gst_meta_api_type_register ("GstVideoMetaAPI", tags);
@@ -346,7 +350,10 @@ GType
 gst_video_crop_meta_api_get_type (void)
 {
   static volatile GType type = 0;
-  static const gchar *tags[] = { "size", "orientation", NULL };
+  static const gchar *tags[] =
+      { GST_META_TAG_VIDEO_STR, GST_META_TAG_VIDEO_SIZE_STR,
+    GST_META_TAG_VIDEO_ORIENTATION_STR, NULL
+  };
 
   if (g_once_init_enter (&type)) {
     GType _type = gst_meta_api_type_register ("GstVideoCropMetaAPI", tags);
@@ -393,7 +400,8 @@ GType
 gst_video_gl_texture_upload_meta_api_get_type (void)
 {
   static volatile GType type = 0;
-  static const gchar *tags[] = { "memory", NULL };
+  static const gchar *tags[] =
+      { GST_META_TAG_VIDEO_STR, GST_META_TAG_MEMORY_STR, NULL };
 
   if (g_once_init_enter (&type)) {
     GType _type =
@@ -535,7 +543,10 @@ GType
 gst_video_region_of_interest_meta_api_get_type (void)
 {
   static volatile GType type;
-  static const gchar *tags[] = { "orientation", " size", NULL };
+  static const gchar *tags[] =
+      { GST_META_TAG_VIDEO_STR, GST_META_TAG_VIDEO_ORIENTATION_STR,
+    GST_META_TAG_VIDEO_SIZE_STR, NULL
+  };
 
   if (g_once_init_enter (&type)) {
     GType _type =
index bd01ac5..d18f7df 100644 (file)
@@ -53,6 +53,36 @@ struct _GstVideoAlignment
   guint stride_align[GST_VIDEO_MAX_PLANES];
 };
 
+/* metadata macros */
+/**
+ * GST_META_TAG_VIDEO_STR:
+ * This metadata is relevant for video streams.
+ *
+ * Since: 1.2
+ */
+#define GST_META_TAG_VIDEO_STR "video"
+/**
+ * GST_META_TAG_VIDEO_ORIENTATION_STR:
+ * This metadata stays relevant as long as video orientation is unchanged.
+ *
+ * Since: 1.2
+ */
+#define GST_META_TAG_VIDEO_ORIENTATION_STR "orientation"
+/**
+ * GST_META_TAG_VIDEO_SIZE_STR:
+ * This metadata stays relevant as long as video size is unchanged.
+ *
+ * Since: 1.2
+ */
+#define GST_META_TAG_VIDEO_SIZE_STR "size"
+/**
+ * GST_META_TAG_VIDEO_COLORSPACE_STR:
+ * This metadata stays relevant as long as video colorspace is unchanged.
+ *
+ * Since: 1.2
+ */
+#define GST_META_TAG_VIDEO_COLORSPACE_STR "colorspace"
+
 void           gst_video_alignment_reset         (GstVideoAlignment *align);