summaryrefslogtreecommitdiffstats
path: root/gst-libs/gst/media-info
diff options
context:
space:
mode:
Diffstat (limited to 'gst-libs/gst/media-info')
-rw-r--r--gst-libs/gst/media-info/media-info-priv.c17
-rw-r--r--gst-libs/gst/media-info/media-info-test.c56
-rw-r--r--gst-libs/gst/media-info/media-info.c6
3 files changed, 15 insertions, 64 deletions
diff --git a/gst-libs/gst/media-info/media-info-priv.c b/gst-libs/gst/media-info/media-info-priv.c
index 77981598..c7f470ea 100644
--- a/gst-libs/gst/media-info/media-info-priv.c
+++ b/gst-libs/gst/media-info/media-info-priv.c
@@ -136,13 +136,13 @@ gmi_reset (GstMediaInfo *info)
if (priv->format)
{
GMI_DEBUG ("unreffing priv->format, error before this ?\n");
- gst_caps_unref (priv->format);
+ gst_caps_free (priv->format);
priv->format = NULL;
}
if (priv->metadata)
{
GMI_DEBUG ("unreffing priv->metadata, error before this ?\n");
- gst_caps_unref (priv->metadata);
+ gst_caps_free (priv->metadata);
priv->metadata = NULL;
}
if (priv->stream)
@@ -193,12 +193,12 @@ gmi_seek_to_track (GstMediaInfo *info, long track)
/* clear structs because of the seek */
if (priv->metadata)
{
- gst_caps_unref (priv->metadata);
+ gst_caps_free (priv->metadata);
priv->metadata = NULL;
}
if (priv->streaminfo)
{
- gst_caps_unref (priv->streaminfo);
+ gst_caps_free (priv->streaminfo);
priv->streaminfo = NULL;
}
return TRUE;
@@ -304,7 +304,7 @@ gmip_find_type_pre (GstMediaInfoPriv *priv)
if (priv->type)
{
/* we don't need to unref, this is done inside gsttypefind.c
- gst_caps_unref (priv->type);
+ gst_caps_free (priv->type);
*/
priv->type = NULL;
}
@@ -573,14 +573,13 @@ gmip_find_track_streaminfo_post (GstMediaInfoPriv *priv)
&format, &value_end);
if (res)
{
- GstPropsEntry *length;
/* substract to get the length */
GMI_DEBUG("DEBUG: start %lld, end %lld\n", value_start, value_end);
value_end -= value_start;
/* FIXME: check units; this is in seconds */
- length = gst_props_entry_new ("length",
- GST_PROPS_INT ((int) (value_end / 1E6)));
- gst_props_add_entry (gst_caps_get_props (priv->streaminfo), length);
+
+ gst_caps_set_simple (priv->streaminfo,
+ "length", G_TYPE_INT, (int) (value_end / 1E6), NULL);
}
}
}
diff --git a/gst-libs/gst/media-info/media-info-test.c b/gst-libs/gst/media-info/media-info-test.c
index 553e97c6..5a73c8bd 100644
--- a/gst-libs/gst/media-info/media-info-test.c
+++ b/gst-libs/gst/media-info/media-info-test.c
@@ -5,56 +5,6 @@
#include "media-info.h"
static void
-caps_print (GstCaps *caps)
-{
- if (caps == NULL) return;
- /*
- if (!strcmp (gst_caps_get_mime (caps), "application/x-gst-metadata") ||
- !strcmp (gst_caps_get_mime (caps), "application/x-gst-streaminfo"))
- */
- if (TRUE)
- {
- GstProps *props = caps->properties;
- GList *walk;
-
- if (props == NULL)
- {
- g_print (" none\n");
- return;
- }
- walk = props->properties;
-
- while (walk) {
- GstPropsEntry *entry = (GstPropsEntry *) walk->data;
- const gchar *name;
- const gchar *str_val;
- gint int_val;
- GstPropsType type;
-
- name = gst_props_entry_get_name (entry);
- type = gst_props_entry_get_props_type (entry);
- switch (type) {
- case GST_PROPS_STRING_TYPE:
- gst_props_entry_get_string (entry, &str_val);
- g_print (" %s='%s'\n", name, str_val);
- break;
- case GST_PROPS_INT_TYPE:
- gst_props_entry_get_int (entry, &int_val);
- g_print (" %s=%d\n", name, int_val);
- break;
- default:
- break;
- }
-
- walk = g_list_next (walk);
- }
- }
- else {
- g_print (" unkown caps type\n");
- }
-}
-
-static void
info_print (GstMediaInfoStream *stream)
{
int i;
@@ -77,11 +27,11 @@ info_print (GstMediaInfoStream *stream)
g_print ("- track %d\n", i);
track = (GstMediaInfoTrack *) p->data;
g_print (" - metadata:\n");
- caps_print (track->metadata);
+ g_print ("%s\n", gst_caps_to_string (track->metadata));
g_print (" - streaminfo:\n");
- caps_print (track->streaminfo);
+ g_print ("%s\n", gst_caps_to_string (track->streaminfo));
g_print (" - format:\n");
- caps_print (track->format);
+ g_print ("%s\n", gst_caps_to_string (track->format));
p = p->next;
}
}
diff --git a/gst-libs/gst/media-info/media-info.c b/gst-libs/gst/media-info/media-info.c
index 92957e16..e214e8e1 100644
--- a/gst-libs/gst/media-info/media-info.c
+++ b/gst-libs/gst/media-info/media-info.c
@@ -294,7 +294,8 @@ gst_media_info_read_idler (GstMediaInfo *info, GstMediaInfoStream **streamp)
GMI_DEBUG("doing find_type_post\n");
gmip_find_type_post (priv);
GMI_DEBUG("finding out mime type\n");
- mime = g_strdup (gst_caps_get_mime (priv->type));
+ mime = g_strdup (gst_structure_get_name (
+ gst_caps_get_structure(priv->type, 0)));
GMI_DEBUG("found out mime type: %s\n", mime);
decoder = gmi_get_decoder (info, mime);
if (decoder == NULL)
@@ -443,7 +444,8 @@ gst_media_info_read (GstMediaInfo *info, const char *location, guint16 flags)
if (!gmip_find_type (priv)) return NULL;
- mime = g_strdup (gst_caps_get_mime (priv->type));
+ mime = g_strdup (gst_structure_get_name (
+ gst_caps_get_structure(priv->type, 0)));
GMI_DEBUG("mime type: %s\n", mime);
/* c) figure out decoder */