From: <tp...@ke...> - 2006-03-25 21:57:46
|
CVS Root: /cvs/gstreamer Module: gst-plugins-bad Changes by: tpm Date: Sat Mar 25 2006 21:57:36 UTC Log message: * ext/taglib/gsttaglib.cc: We do not want to proxy the caps on the sink pad; our source pad should have application/x-id3 caps; also, don't use already-freed strings in debug messages; finally, adjust buffer offsets on buffers sent out. Modified files: . : ChangeLog ext/taglib : gsttaglib.cc Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ChangeLog.diff?r1=1.2035&r2=1.2036 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ext/taglib/gsttaglib.cc.diff?r1=1.4&r2=1.5 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-bad/ChangeLog,v retrieving revision 1.2035 retrieving revision 1.2036 diff -u -d -r1.2035 -r1.2036 --- ChangeLog 25 Mar 2006 13:02:55 -0000 1.2035 +++ ChangeLog 25 Mar 2006 21:57:24 -0000 1.2036 @@ -1,5 +1,13 @@ 2006-03-25 Tim-Philipp Müller <tim at centricular dot net> + * ext/taglib/gsttaglib.cc: + We do not want to proxy the caps on the sink pad; our + source pad should have application/x-id3 caps; also, + don't use already-freed strings in debug messages; + finally, adjust buffer offsets on buffers sent out. + +2006-03-25 Tim-Philipp Müller <tim at centricular dot net> * sys/v4l2/gstv4l2src.c: Older kernels don't seem to have this particular v4l2 format, so comment out until this gets fixed properly (and make Index: gsttaglib.cc RCS file: /cvs/gstreamer/gst-plugins-bad/ext/taglib/gsttaglib.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- gsttaglib.cc 13 Mar 2006 17:22:19 -0000 1.4 +++ gsttaglib.cc 25 Mar 2006 21:57:24 -0000 1.5 @@ -149,14 +149,11 @@ gst_tag_lib_mux_init (GstTagLibMux * taglib, GstTagLibMuxClass * taglibmux_class) { - GstElementClass *klass = GST_ELEMENT_CLASS (taglibmux_class); + GstCaps *srccaps; /* pad through which data comes in to the element */ taglib->sinkpad = - gst_pad_new_from_template (gst_element_class_get_pad_template (klass, - "sink"), "sink"); - gst_pad_set_setcaps_function (taglib->sinkpad, - GST_DEBUG_FUNCPTR (gst_pad_proxy_setcaps)); + gst_pad_new_from_static_template (&gst_tag_lib_mux_sink_template, "sink"); gst_pad_set_chain_function (taglib->sinkpad, GST_DEBUG_FUNCPTR (gst_tag_lib_mux_chain)); gst_pad_set_event_function (taglib->sinkpad, @@ -165,8 +162,10 @@ /* pad through which data goes out of the element */ taglib->srcpad = - "src"), "src"); + gst_pad_new_from_static_template (&gst_tag_lib_mux_src_template, "src"); + srccaps = gst_static_pad_template_get_caps (&gst_tag_lib_mux_src_template); + gst_pad_use_fixed_caps (taglib->srcpad); + gst_pad_set_caps (taglib->srcpad, srccaps); gst_element_add_pad (GST_ELEMENT (taglib), taglib->srcpad); taglib->render_tag = TRUE; @@ -309,10 +308,11 @@ tag_str = g_strdup_printf ("%d", volume_number); } + GST_DEBUG ("Setting album number to %s", tag_str); id3v2tag->addFrame (frame); frame->setText (tag_str); g_free (tag_str); - GST_DEBUG ("Setting album number to %s", tag_str); } } else if (strcmp (tag, GST_TAG_COPYRIGHT) == 0) { gchar *copyright; @@ -322,12 +322,13 @@ if (result != FALSE) { ID3v2::TextIdentificationFrame * frame; + GST_DEBUG ("Setting copyright to %s", copyright); frame = new ID3v2::TextIdentificationFrame ("TCOP", String::UTF8); frame->setText (copyright); g_free (copyright); - GST_DEBUG ("Setting copyright to %s", copyright); } else if (strcmp (tag, GST_TAG_MUSICBRAINZ_ARTISTID) == 0) { gchar *id_str; @@ -417,6 +418,8 @@ event = gst_event_new_tag (taglist); gst_pad_push_event (taglib->srcpad, event); + GST_BUFFER_OFFSET (buffer) = 0; return buffer; } @@ -429,7 +432,7 @@ if (taglib->render_tag) { GstFlowReturn ret; - GST_INFO ("Adding tags to stream"); + GST_INFO_OBJECT (taglib, "Adding tags to stream"); ret = gst_pad_push (taglib->srcpad, gst_tag_lib_mux_render_tag (taglib)); if (ret != GST_FLOW_OK) { gst_buffer_unref (buffer); @@ -438,6 +441,13 @@ taglib->render_tag = FALSE; } + if (GST_BUFFER_OFFSET (buffer) != GST_BUFFER_OFFSET_NONE) { + GST_LOG_OBJECT (taglib, "Adjusting buffer offset from %" G_GINT64_FORMAT + " to %" G_GINT64_FORMAT, GST_BUFFER_OFFSET (buffer), + GST_BUFFER_OFFSET (buffer) + taglib->tag_size); + GST_BUFFER_OFFSET (buffer) += taglib->tag_size; + } gst_buffer_set_caps (buffer, GST_PAD_CAPS (taglib->srcpad)); return gst_pad_push (taglib->srcpad, buffer); |