From: <sk...@fr...> - 2005-10-02 23:31:52
|
CVS Root: /cvs/gstreamer Module: gst-plugins Changes by: skaboy Date: Sun Oct 02 2005 07:29:15 PDT Branch: BRANCH-GSTREAMER-0_8 Log message: * gst-libs/gst/media-info/media-info-priv.c (struct) (tag_list_dest, found_tag_callback): - if a tag is mediainfo put it in the mediainfo list - if a tag is streaminfo put it in the streaminfo list. (#313812) Modified files: . : ChangeLog gst-libs/gst/media-info: media-info-priv.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ChangeLog.diff?r1=1.1641.2.380&r2=1.1641.2.381 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst-libs/gst/media-info/media-info-priv.c.diff?r1=1.15&r2=1.15.4.1 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins/ChangeLog,v retrieving revision 1.1641.2.380 retrieving revision 1.1641.2.381 diff -u -d -r1.1641.2.380 -r1.1641.2.381 --- ChangeLog 2 Oct 2005 12:57:47 -0000 1.1641.2.380 +++ ChangeLog 2 Oct 2005 14:29:02 -0000 1.1641.2.381 @@ -1,5 +1,11 @@ 2005-10-02 Luca Ognibene <lu...@ti...> + * gst-libs/gst/media-info/media-info-priv.c (struct) + (tag_list_dest, found_tag_callback): + - if a tag is mediainfo put it in the mediainfo list + - if a tag is streaminfo put it in the streaminfo list. + (#313812) + * tools/gst-launch-ext-m.m: Add support for wavpack to gst-launch-ext (#317592) Index: media-info-priv.c RCS file: /cvs/gstreamer/gst-plugins/gst-libs/gst/media-info/Attic/media-info-priv.c,v retrieving revision 1.15 retrieving revision 1.15.4.1 diff -u -d -r1.15 -r1.15.4.1 --- media-info-priv.c 25 Jun 2004 11:57:25 -0000 1.15 +++ media-info-priv.c 2 Oct 2005 14:29:02 -0000 1.15.4.1 @@ -149,47 +149,46 @@ typedef struct { - guint meta; - guint encoded; + GstTagList *streaminfo; + GstTagList *metadata; } -TagFlagScore; +TagListDest; static void -tag_flag_score (const GstTagList * list, const gchar * tag, gpointer user_data) +tag_list_dest (const GstTagList * list, const gchar * tag, gpointer user_data) - TagFlagScore *score = (TagFlagScore *) user_data; + TagListDest *dest = (TagListDest *) user_data; GstTagFlag flag; flag = gst_tag_get_flag (tag); - if (flag == GST_TAG_FLAG_META) - score->meta++; if (flag == GST_TAG_FLAG_ENCODED) - score->encoded++; + gst_tag_list_remove_tag (dest->metadata, tag); + else if (flag == GST_TAG_FLAG_META) + gst_tag_list_remove_tag (dest->streaminfo, tag); + else + /* default to streaminfo ? */ void found_tag_callback (GObject * pipeline, GstElement * source, GstTagList * tags, GstMediaInfoPriv * priv) - TagFlagScore score; + TagListDest dest; - score.meta = 0; - score.encoded = 0; GST_DEBUG ("element %s found tag", GST_STR_NULL (GST_ELEMENT_NAME (source))); - /* decide if it's likely to be metadata or streaminfo */ - /* FIXME: this is a hack, there must be a better way, - but as long as elements can report both mixed we need to do this */ + dest.streaminfo = gst_tag_list_copy (tags); + dest.metadata = gst_tag_list_copy (tags); - gst_tag_list_foreach (tags, tag_flag_score, &score); + gst_tag_list_foreach (tags, tag_list_dest, &dest); - if (score.meta > score.encoded) { - GST_DEBUG ("found tags from decoder, adding them as metadata"); - priv->metadata = gst_tag_list_copy (tags); - } else { - GST_DEBUG ("found tags, adding them as streaminfo"); - priv->streaminfo = gst_tag_list_copy (tags); - } + priv->metadata = + gst_tag_list_merge (priv->metadata, dest.metadata, GST_TAG_MERGE_REPLACE); + priv->streaminfo = + gst_tag_list_merge (priv->streaminfo, dest.streaminfo, + GST_TAG_MERGE_REPLACE); |