From: <tp...@fr...> - 2006-02-06 11:44:49
|
CVS Root: /cvs/gstreamer Module: gst-plugins-good Changes by: tpm Date: Mon Feb 06 2006 03:41:55 PST Log message: * gst/apetag/gstapedemux.h: Fix include, for now GstTagDemux is in the apetag dir. Modified files: . : ChangeLog gst/apetag : gstapedemux.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.2123&r2=1.2124 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/apetag/gstapedemux.h.diff?r1=1.1&r2=1.2 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v retrieving revision 1.2123 retrieving revision 1.2124 diff -u -d -r1.2123 -r1.2124 --- ChangeLog 6 Feb 2006 11:34:23 -0000 1.2123 +++ ChangeLog 6 Feb 2006 11:41:43 -0000 1.2124 @@ -1,5 +1,10 @@ 2006-02-06 Tim-Philipp Müller <tim at centricular dot net> + * gst/apetag/gstapedemux.h: + Fix include, for now GstTagDemux is in the apetag dir. + +2006-02-06 Tim-Philipp Müller <tim at centricular dot net> * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-good-plugins-docs.sgml: * docs/plugins/gst-plugins-good-plugins-sections.txt: Index: gstapedemux.h RCS file: /cvs/gstreamer/gst-plugins-good/gst/apetag/gstapedemux.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gstapedemux.h 6 Feb 2006 10:56:07 -0000 1.1 +++ gstapedemux.h 6 Feb 2006 11:41:43 -0000 1.2 @@ -21,7 +21,7 @@ #ifndef __GST_APE_DEMUX_H__ #define __GST_APE_DEMUX_H__ -#include <gst/tag/gsttagdemux.h> +#include "gsttagdemux.h" G_BEGIN_DECLS |
From: <tp...@fr...> - 2006-02-11 13:57:56
|
CVS Root: /cvs/gstreamer Module: gst-plugins-good Changes by: tpm Date: Sat Feb 11 2006 05:54:38 PST Log message: * gst/apetag/gsttagdemux.c: (gst_tag_demux_get_upstream_size), (gst_tag_demux_do_typefind): ... and fix the very same leaks in GstTagDemux. Modified files: . : ChangeLog gst/apetag : gsttagdemux.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.2143&r2=1.2144 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/apetag/gsttagdemux.c.diff?r1=1.1&r2=1.2 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v retrieving revision 1.2143 retrieving revision 1.2144 diff -u -d -r1.2143 -r1.2144 --- ChangeLog 11 Feb 2006 13:35:13 -0000 1.2143 +++ ChangeLog 11 Feb 2006 13:54:25 -0000 1.2144 @@ -1,3 +1,9 @@ +2006-02-11 Tim-Philipp Müller <tim at centricular dot net> + + * gst/apetag/gsttagdemux.c: (gst_tag_demux_get_upstream_size), + (gst_tag_demux_do_typefind): + ... and fix the very same leaks in GstTagDemux. 2006-02-11 Jan Schmidt <th...@ma...> * gst/id3demux/gstid3demux.c: (id3demux_get_upstream_size), Index: gsttagdemux.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/apetag/gsttagdemux.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gsttagdemux.c 6 Feb 2006 10:56:07 -0000 1.1 +++ gsttagdemux.c 11 Feb 2006 13:54:26 -0000 1.2 @@ -621,7 +621,6 @@ static gboolean gst_tag_demux_get_upstream_size (GstTagDemux * tagdemux) { - GstQuery *query; GstPad *peer = NULL; GstFormat format; gint64 result; @@ -634,21 +633,13 @@ if ((peer = gst_pad_get_peer (tagdemux->priv->sinkpad)) == NULL) return FALSE; - query = gst_query_new_duration (GST_FORMAT_BYTES); - gst_query_set_duration (query, GST_FORMAT_BYTES, -1); - - if (!gst_pad_query (peer, query)) - goto out; - gst_query_parse_duration (query, &format, &result); - if (format != GST_FORMAT_BYTES || result == -1) - tagdemux->priv->upstream_size = result; - res = TRUE; + format = GST_FORMAT_BYTES; + if (gst_pad_query_duration (peer, &format, &result) && + format == GST_FORMAT_BYTES && result > 0) { + tagdemux->priv->upstream_size = result; + res = TRUE; + } -out: gst_object_unref (peer); return res; } @@ -1319,6 +1310,7 @@ return find.caps; } + gst_caps_replace (&find.caps, NULL); return NULL; |
From: <tp...@ke...> - 2006-03-02 15:14:39
|
CVS Root: /cvs/gstreamer Module: gst-plugins-good Changes by: tpm Date: Thu Mar 02 2006 15:14:34 UTC Log message: * configure.ac: Bump requirements to current core and -base CVS (core for new typefind helper API, and -base for the WAVFORMATEX support that was added to libgstriff and is needed by wavparse). * gst/apetag/Makefile.am: * gst/apetag/gsttagdemux.c: (gst_tag_demux_chain), (gst_tag_demux_sink_activate): Use new typefind helpers for typefinding instead of our home-grown stuff; also, do typefinding in pull-mode if upstream supports that. Modified files: . : ChangeLog configure.ac gst/apetag : Makefile.am gsttagdemux.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.2191&r2=1.2192 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/configure.ac.diff?r1=1.640&r2=1.641 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/apetag/Makefile.am.diff?r1=1.1&r2=1.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/apetag/gsttagdemux.c.diff?r1=1.2&r2=1.3 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v retrieving revision 1.2191 retrieving revision 1.2192 diff -u -d -r1.2191 -r1.2192 --- ChangeLog 28 Feb 2006 10:40:01 -0000 1.2191 +++ ChangeLog 2 Mar 2006 15:14:22 -0000 1.2192 @@ -1,3 +1,18 @@ +2006-03-02 Tim-Philipp Müller <tim at centricular dot net> + + * configure.ac: + Bump requirements to current core and -base CVS + (core for new typefind helper API, and -base for the + WAVFORMATEX support that was added to libgstriff and + is needed by wavparse). + + * gst/apetag/Makefile.am: + * gst/apetag/gsttagdemux.c: (gst_tag_demux_chain), + (gst_tag_demux_sink_activate): + Use new typefind helpers for typefinding instead of our + home-grown stuff; also, do typefinding in pull-mode if + upstream supports that. 2006-02-28 Jürg Billeter <j (at) bitron.ch> Reviewed by: Christian Schaller <chr...@fl...> Index: configure.ac RCS file: /cvs/gstreamer/gst-plugins-good/configure.ac,v retrieving revision 1.640 retrieving revision 1.641 diff -u -d -r1.640 -r1.641 --- configure.ac 24 Feb 2006 19:51:29 -0000 1.640 +++ configure.ac 2 Mar 2006 15:14:22 -0000 1.641 @@ -36,8 +36,8 @@ AM_PROG_LIBTOOL dnl *** required versions of GStreamer stuff *** -GST_REQ=0.10.2.2 -GSTPB_REQ=0.10.2.2 +GST_REQ=0.10.3.1 +GSTPB_REQ=0.10.3.1 dnl *** autotools stuff **** Index: Makefile.am RCS file: /cvs/gstreamer/gst-plugins-good/gst/apetag/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 6 Feb 2006 10:56:07 -0000 1.1 +++ Makefile.am 2 Mar 2006 15:14:22 -0000 1.2 @@ -3,8 +3,10 @@ libgstapetag_la_SOURCES = gstapedemux.c gsttagdemux.c libgstapetag_la_CFLAGS = \ -I$(top_srcdir)/gst-libs \ + $(GST_BASE_CFLAGS) \ $(GST_CFLAGS) libgstapetag_la_LIBADD = \ + $(GST_BASE_LIBS) \ $(GST_LIBS) libgstapetag_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) Index: gsttagdemux.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/apetag/gsttagdemux.c,v retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gsttagdemux.c 11 Feb 2006 13:54:26 -0000 1.2 +++ gsttagdemux.c 2 Mar 2006 15:14:22 -0000 1.3 @@ -74,6 +74,7 @@ #include "gsttagdemux.h" +#include <gst/base/gsttypefindhelper.h> #include <gst/gst-i18n-plugin.h> #include <string.h> @@ -148,8 +149,6 @@ static gboolean gst_tag_demux_pad_query (GstPad * pad, GstQuery * query); static const GstQueryType *gst_tag_demux_get_query_types (GstPad * pad); static gboolean gst_tag_demux_get_upstream_size (GstTagDemux * tagdemux); -static GstCaps *gst_tag_demux_do_typefind (GstTagDemux * tagdemux, - GstBuffer * buffer); static void gst_tag_demux_send_tag_event (GstTagDemux * tagdemux); static void gst_tag_demux_base_init (gpointer g_class); @@ -537,8 +536,9 @@ break; /* Fall-through */ case GST_TAG_DEMUX_TYPEFINDING:{ - GstCaps *caps; + GstTypeFindProbability probability = 0; GstBuffer *typefind_buf = NULL; + GstCaps *caps; if (GST_BUFFER_SIZE (demux->priv->collect) < TYPE_FIND_MIN_SIZE) break; /* Go get more data first */ @@ -552,7 +552,8 @@ if (!gst_tag_demux_trim_buffer (demux, &typefind_buf)) return GST_FLOW_ERROR; - caps = gst_tag_demux_do_typefind (demux, typefind_buf); + caps = gst_type_find_helper_for_buffer (GST_OBJECT (demux), + typefind_buf, &probability); if (caps == NULL) { if (GST_BUFFER_SIZE (typefind_buf) < TYPE_FIND_MAX_SIZE) { @@ -570,6 +571,9 @@ } gst_buffer_unref (typefind_buf); + GST_DEBUG_OBJECT (demux, "Found type %" GST_PTR_FORMAT " with a " + "probability of %u", caps, probability); if (!gst_tag_demux_add_srcpad (demux, caps)) { GST_DEBUG_OBJECT (demux, "Failed to add srcpad"); gst_caps_unref (caps); @@ -994,11 +998,10 @@ static gboolean gst_tag_demux_sink_activate (GstPad * sinkpad) { + GstTypeFindProbability probability = 0; GstTagDemux *demux = GST_TAG_DEMUX (GST_PAD_PARENT (sinkpad)); gboolean ret = FALSE; - GstBuffer *buf = NULL; GstCaps *caps = NULL; - GstFlowReturn flow_ret; /* 1: */ /* If we can activate pull_range upstream, then read any end and start @@ -1039,17 +1042,14 @@ demux->priv->send_tag_event = TRUE; } - flow_ret = gst_tag_demux_read_range (demux, 0, TYPE_FIND_MAX_SIZE, &buf); - if (flow_ret != GST_FLOW_OK) { - GST_DEBUG_OBJECT (demux, "Could not read data from start of file ret=%s", - gst_flow_get_name (flow_ret)); - goto done_activate; - } + /* 3 - Do typefinding on data */ + caps = gst_type_find_helper_get_range (GST_OBJECT (demux), + (GstTypeFindHelperGetRangeFunction) gst_tag_demux_read_range, + demux->priv->upstream_size + - (demux->priv->strip_start + demux->priv->strip_end), &probability); - /* gst_util_dump_mem (GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf)); */ - caps = gst_tag_demux_do_typefind (demux, buf); - gst_buffer_unref (buf); - buf = NULL; + GST_DEBUG_OBJECT (demux, "Found type %" GST_PTR_FORMAT " with a " + "probability of %u", caps, probability); /* 4 - Deactivate pull mode */ if (!gst_pad_activate_pull (sinkpad, FALSE)) { @@ -1086,8 +1086,6 @@ done_activate: - if (buf) - gst_buffer_unref (buf); return ret; } @@ -1245,75 +1243,6 @@ return types; -typedef struct -{ - guint best_probability; - GstCaps *caps; - GstBuffer *buffer; -} SimpleTypeFind; - -static guint8 * -simple_find_peek (gpointer data, gint64 offset, guint size) - SimpleTypeFind *find = (SimpleTypeFind *) data; - if (offset < 0) - return NULL; - if (GST_BUFFER_SIZE (find->buffer) >= offset + size) { - return GST_BUFFER_DATA (find->buffer) + offset; - return NULL; -} -static void -simple_find_suggest (gpointer data, guint probability, const GstCaps * caps) - if (probability > find->best_probability) { - GstCaps *copy = gst_caps_copy (caps); - gst_caps_replace (&find->caps, copy); - gst_caps_unref (copy); - find->best_probability = probability; -static GstCaps * -gst_tag_demux_do_typefind (GstTagDemux * tagdemux, GstBuffer * buffer) - GList *walk, *type_list; - SimpleTypeFind find; - GstTypeFind gst_find; - walk = type_list = gst_type_find_factory_get_list (); - find.buffer = buffer; - find.best_probability = 0; - find.caps = NULL; - gst_find.data = &find; - gst_find.peek = simple_find_peek; - gst_find.get_length = NULL; - gst_find.suggest = simple_find_suggest; - while (walk) { - GstTypeFindFactory *factory = GST_TYPE_FIND_FACTORY (walk->data); - gst_type_find_factory_call_function (factory, &gst_find); - if (find.best_probability >= GST_TYPE_FIND_MAXIMUM) - break; - walk = g_list_next (walk); - gst_plugin_feature_list_free (type_list); - if (find.best_probability > 0) { - GST_DEBUG ("Found caps %" GST_PTR_FORMAT " with buf size %u", find.caps, - GST_BUFFER_SIZE (buffer)); - return find.caps; - gst_caps_replace (&find.caps, NULL); static void gst_tag_demux_send_tag_event (GstTagDemux * demux) |
From: <tp...@ke...> - 2006-05-28 14:38:29
|
CVS Root: /cvs/gstreamer Module: gst-plugins-good Changes by: tpm Date: Sun May 28 2006 14:38:23 UTC Log message: Patch by: Sebastian Dröge <slomo at ubuntu dot com> * gst/apetag/gstapedemux.c: (ape_demux_get_gst_tag_from_tag), (ape_demux_parse_tags): Some clean-ups and additions: map APE 'file' tag to GST_TAG_LOCATION (#343123); add support for extracting the track count and clean up parsing a bit (#343127). Modified files: . : ChangeLog gst/apetag : gstapedemux.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.2366&r2=1.2367 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/apetag/gstapedemux.c.diff?r1=1.3&r2=1.4 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v retrieving revision 1.2366 retrieving revision 1.2367 diff -u -d -r1.2366 -r1.2367 --- ChangeLog 28 May 2006 13:49:11 -0000 1.2366 +++ ChangeLog 28 May 2006 14:38:11 -0000 1.2367 @@ -1,3 +1,13 @@ +2006-05-28 Tim-Philipp Müller <tim at centricular dot net> + + Patch by: Sebastian Dröge <slomo at ubuntu dot com> + * gst/apetag/gstapedemux.c: (ape_demux_get_gst_tag_from_tag), + (ape_demux_parse_tags): + Some clean-ups and additions: map APE 'file' tag to + GST_TAG_LOCATION (#343123); add support for extracting + the track count and clean up parsing a bit (#343127). 2006-05-28 Edward Hervey <ed...@fl...> * ext/jpeg/gstjpegdec.c: (gst_jpeg_dec_change_state): Index: gstapedemux.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/apetag/gstapedemux.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gstapedemux.c 6 May 2006 00:05:20 -0000 1.3 +++ gstapedemux.c 28 May 2006 14:38:11 -0000 1.4 @@ -62,7 +62,7 @@ #define APE_VERSION_MAJOR(ver) ((ver)/1000) -GST_DEBUG_CATEGORY (apedemux_debug); +GST_DEBUG_CATEGORY_STATIC (apedemux_debug); #define GST_CAT_DEFAULT (apedemux_debug) static const GstElementDetails gst_ape_demux_details = @@ -141,7 +141,8 @@ "genre", GST_TAG_GENRE}, { "isrc", GST_TAG_ISRC}, { "track", GST_TAG_TRACK_NUMBER}, { - "year", GST_TAG_DATE} + "year", GST_TAG_DATE}, { + "file", GST_TAG_LOCATION} }; static gboolean @@ -154,6 +155,7 @@ if (g_ascii_strcasecmp (tag_table[i].ape_tag, ape_tag) == 0) { *gst_tag = tag_table[i].gst_tag; *gst_tag_type = gst_tag_get_type (tag_table[i].gst_tag); + GST_LOG ("Mapped APE tag '%s' to GStreamer tag '%s'", ape_tag, *gst_tag); return TRUE; } } @@ -205,29 +207,62 @@ GValue v = { 0, }; switch (gst_tag_type) { - case G_TYPE_INT: - g_value_init (&v, G_TYPE_INT); - g_value_set_int (&v, atoi (val)); + case G_TYPE_INT:{ + gint v_int; + if (sscanf (val, "%d", &v_int) == 1) { + g_value_init (&v, G_TYPE_INT); + g_value_set_int (&v, v_int); + } break; - case G_TYPE_UINT: - g_value_init (&v, G_TYPE_UINT); - g_value_set_uint (&v, (guint) atof (val)); /* hmmm */ + } + case G_TYPE_UINT:{ + guint v_uint, count; + if (strcmp (gst_tag, GST_TAG_TRACK_NUMBER) == 0) { + gint dummy; + if (sscanf (val, "%u", &v_uint) == 1 && v_uint > 0) { + g_value_init (&v, G_TYPE_UINT); + g_value_set_uint (&v, v_uint); + } + GST_LOG ("checking for count: %s", val); + /* might be 0/N or -1/N to specify that there is only a count */ + if (sscanf (val, "%d/%u", &dummy, &count) == 2 && count > 0) { + gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND, + GST_TAG_TRACK_COUNT, count, NULL); + } else if (sscanf (val, "%u", &v_uint) == 1) { + g_value_init (&v, G_TYPE_UINT); + g_value_set_uint (&v, v_uint); - case G_TYPE_STRING: + case G_TYPE_STRING:{ g_value_init (&v, G_TYPE_STRING); g_value_set_string (&v, val); - case G_TYPE_DOUBLE: - g_value_init (&v, G_TYPE_DOUBLE); - g_value_set_double (&v, atof (val)); + case G_TYPE_DOUBLE:{ + gdouble v_double; + if (sscanf (val, "%lf", &v_double) == 1) { + g_value_init (&v, G_TYPE_DOUBLE); + g_value_set_double (&v, v_double); default:{ if (gst_tag_type == GST_TYPE_DATE) { - GDate *date = g_date_new_dmy (1, 1, atoi (val)); + gint v_int; - g_value_init (&v, GST_TYPE_DATE); - gst_value_set_date (&v, date); - g_date_free (date); + if (sscanf (val, "%d", &v_int) == 1) { + GDate *date = g_date_new_dmy (1, 1, v_int); + g_value_init (&v, GST_TYPE_DATE); + gst_value_set_date (&v, date); + g_date_free (date); } else { GST_WARNING ("Unhandled tag type '%s' for tag '%s'", g_type_name (gst_tag_type), gst_tag); |