summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2011-08-17 19:40:08 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2011-08-18 11:17:15 +0200
commit96e7bf53e98970cc51dcc463e61bff50ab995073 (patch)
treeb72564d85c817954a63d5f89cf98eb1f2584004f /ext
parent8304b7b40d2f791947d3e0360c7a50fa6365a28e (diff)
oggstream: new convenience function to get a stream's media type
This will make logging a lot clearer, both in code and in output. https://bugzilla.gnome.org/show_bug.cgi?id=656775
Diffstat (limited to 'ext')
-rw-r--r--ext/ogg/gstoggstream.c13
-rw-r--r--ext/ogg/gstoggstream.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/ext/ogg/gstoggstream.c b/ext/ogg/gstoggstream.c
index 5c9ae296a..1b859a2b2 100644
--- a/ext/ogg/gstoggstream.c
+++ b/ext/ogg/gstoggstream.c
@@ -225,6 +225,19 @@ gst_ogg_stream_extract_tags (GstOggStream * pad, ogg_packet * packet)
mappers[pad->map].extract_tags_func (pad, packet);
}
+const char *
+gst_ogg_stream_get_media_type (GstOggStream * pad)
+{
+ const GstCaps *caps = pad->caps;
+ const GstStructure *structure;
+ if (!caps)
+ return NULL;
+ structure = gst_caps_get_structure (caps, 0);
+ if (!structure)
+ return NULL;
+ return gst_structure_get_name (structure);
+}
+
/* some generic functions */
static gboolean
diff --git a/ext/ogg/gstoggstream.h b/ext/ogg/gstoggstream.h
index 6f4a3f8c8..d6c4de61c 100644
--- a/ext/ogg/gstoggstream.h
+++ b/ext/ogg/gstoggstream.h
@@ -125,6 +125,7 @@ gboolean gst_ogg_stream_granulepos_is_key_frame (GstOggStream *pad,
gboolean gst_ogg_stream_packet_is_header (GstOggStream *pad, ogg_packet *packet);
gint64 gst_ogg_stream_get_packet_duration (GstOggStream * pad, ogg_packet *packet);
void gst_ogg_stream_extract_tags (GstOggStream * pad, ogg_packet * packet);
+const char *gst_ogg_stream_get_media_type (GstOggStream * pad);
gboolean gst_ogg_map_parse_fisbone (GstOggStream * pad, const guint8 * data, guint size,
guint32 * serialno, GstOggSkeleton *type);