diff options
Diffstat (limited to 'gst-libs/gst/media-info')
-rw-r--r-- | gst-libs/gst/media-info/media-info-priv.c | 21 | ||||
-rw-r--r-- | gst-libs/gst/media-info/media-info-priv.h | 8 | ||||
-rw-r--r-- | gst-libs/gst/media-info/media-info-test.c | 56 | ||||
-rw-r--r-- | gst-libs/gst/media-info/media-info.c | 6 | ||||
-rw-r--r-- | gst-libs/gst/media-info/media-info.h | 14 |
5 files changed, 28 insertions, 77 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..b613ab86 100644 --- a/gst-libs/gst/media-info/media-info-priv.c +++ b/gst-libs/gst/media-info/media-info-priv.c @@ -78,7 +78,7 @@ gmi_track_new (void) /* callbacks */ static void -have_type_callback (GstElement *typefind, GstCaps *type, GstMediaInfoPriv *priv) +have_type_callback (GstElement *typefind, GstCaps2 *type, GstMediaInfoPriv *priv) { priv->type = type; } @@ -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_caps2_free (priv->format); priv->format = NULL; } if (priv->metadata) { GMI_DEBUG ("unreffing priv->metadata, error before this ?\n"); - gst_caps_unref (priv->metadata); + gst_caps2_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_caps2_free (priv->metadata); priv->metadata = NULL; } if (priv->streaminfo) { - gst_caps_unref (priv->streaminfo); + gst_caps2_free (priv->streaminfo); priv->streaminfo = NULL; } return TRUE; @@ -293,7 +293,7 @@ gmi_clear_decoder (GstMediaInfo *info) /**** * typefind functions * find the type of a file and store it in the caps of the info - * FIXME: we might better return GstCaps instead of storing them + * FIXME: we might better return GstCaps2 instead of storing them * internally */ /* prepare for typefind, move from NULL to TYPEFIND */ @@ -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_caps2_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_caps2_set_simple (priv->streaminfo, + "length", G_TYPE_INT, (int) (value_end / 1E6), NULL); } } } diff --git a/gst-libs/gst/media-info/media-info-priv.h b/gst-libs/gst/media-info/media-info-priv.h index 0a7aa500..24da7333 100644 --- a/gst-libs/gst/media-info/media-info-priv.h +++ b/gst-libs/gst/media-info/media-info-priv.h @@ -64,14 +64,14 @@ struct GstMediaInfoPriv GstElement *typefind; - GstCaps *type; + GstCaps2 *type; GstPad *decoder_pad; /* pad for querying decoded caps */ GstPad *source_pad; /* pad for querying encoded caps */ - GstCaps *format; - GstCaps *metadata; + GstCaps2 *format; + GstCaps2 *metadata; gint metadata_iters; - GstCaps *streaminfo; + GstCaps2 *streaminfo; GstElement *decoder; /* will be != NULL during collection */ gchar *source_element; /* type of element used as source */ diff --git a/gst-libs/gst/media-info/media-info-test.c b/gst-libs/gst/media-info/media-info-test.c index 553e97c6..8e0c1f72 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_caps2_to_string (track->metadata)); g_print (" - streaminfo:\n"); - caps_print (track->streaminfo); + g_print ("%s\n", gst_caps2_to_string (track->streaminfo)); g_print (" - format:\n"); - caps_print (track->format); + g_print ("%s\n", gst_caps2_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..d22bdbb4 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_caps2_get_nth_cap(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_caps2_get_nth_cap(priv->type, 0))); GMI_DEBUG("mime type: %s\n", mime); /* c) figure out decoder */ diff --git a/gst-libs/gst/media-info/media-info.h b/gst-libs/gst/media-info/media-info.h index a718b626..4ff62819 100644 --- a/gst-libs/gst/media-info/media-info.h +++ b/gst-libs/gst/media-info/media-info.h @@ -55,7 +55,7 @@ typedef struct gboolean seekable; gchar *mime; gchar *path; - GstCaps *caps; /* properties of the complete bitstream */ + GstCaps2 *caps; /* properties of the complete bitstream */ guint64 length_time; glong length_tracks; @@ -68,9 +68,9 @@ typedef struct * or one of a set of sequentially muxed streams */ typedef struct { - GstCaps *metadata; /* changeable metadata or tags */ - GstCaps *streaminfo; /* codec property stuff */ - GstCaps *format; /* properties of the logical stream */ + GstCaps2 *metadata; /* changeable metadata or tags */ + GstCaps2 *streaminfo; /* codec property stuff */ + GstCaps2 *format; /* properties of the logical stream */ guint64 length_time; @@ -80,7 +80,7 @@ typedef struct typedef struct { - GstCaps *caps; /* properties of the muxed concurrent stream */ + GstCaps2 *caps; /* properties of the muxed concurrent stream */ } GstMediaInfoConcurrent; #define GST_MEDIA_INFO_ERROR gst_media_info_error_quark () @@ -116,13 +116,13 @@ gboolean gst_media_info_read_many (GstMediaInfo *media_info, GList *locations, guint16 GST_MEDIA_INFO_FLAGS, GError **error); -GstCaps * gst_media_info_get_next (GstMediaInfo *media_info, +GstCaps2 * gst_media_info_get_next (GstMediaInfo *media_info, GError **error); /* * FIXME: reset ? gboolean gst_media_info_write (GstMediaInfo *media_info, const char *location, - GstCaps *media_info); + GstCaps2 *media_info); */ G_END_DECLS |