summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu.duponchelle@epitech.eu>2013-08-21 23:56:15 +0200
committerSebastian Dröge <slomo@circular-chaos.org>2013-09-09 15:37:02 +0200
commitd1cb9c994bafeb7114bc35b36a53f12a274602f8 (patch)
treeae8c2cf7b2b66e3be0d113206f3504015e114183
parent9613f79c1e63ca6a7257484402cc3fb4e0a9fc51 (diff)
video/audio: #define metadata strings.
For instance "orientation" becomes GST_VIDEO_ORIENTATION_METADATA.
-rw-r--r--docs/libs/gst-plugins-base-libs-sections.txt7
-rw-r--r--gst-libs/gst/audio/audio.h17
-rw-r--r--gst-libs/gst/audio/gstaudiometa.c3
-rw-r--r--gst-libs/gst/video/gstvideometa.c19
-rw-r--r--gst-libs/gst/video/video.h30
5 files changed, 71 insertions, 5 deletions
diff --git a/docs/libs/gst-plugins-base-libs-sections.txt b/docs/libs/gst-plugins-base-libs-sections.txt
index c2bc9ee5a..35d9cb630 100644
--- a/docs/libs/gst-plugins-base-libs-sections.txt
+++ b/docs/libs/gst-plugins-base-libs-sections.txt
@@ -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
diff --git a/gst-libs/gst/audio/audio.h b/gst-libs/gst/audio/audio.h
index d7a63c7e2..e3c91fd0c 100644
--- a/gst-libs/gst/audio/audio.h
+++ b/gst-libs/gst/audio/audio.h
@@ -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
diff --git a/gst-libs/gst/audio/gstaudiometa.c b/gst-libs/gst/audio/gstaudiometa.c
index f18e069f2..b0a18459a 100644
--- a/gst-libs/gst/audio/gstaudiometa.c
+++ b/gst-libs/gst/audio/gstaudiometa.c
@@ -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);
diff --git a/gst-libs/gst/video/gstvideometa.c b/gst-libs/gst/video/gstvideometa.c
index efefea768..16135609d 100644
--- a/gst-libs/gst/video/gstvideometa.c
+++ b/gst-libs/gst/video/gstvideometa.c
@@ -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 =
diff --git a/gst-libs/gst/video/video.h b/gst-libs/gst/video/video.h
index bd01ac539..d18f7df83 100644
--- a/gst-libs/gst/video/video.h
+++ b/gst-libs/gst/video/video.h
@@ -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);