GNOME Bugzilla – Bug 336898
Port musicbrainz/trm plugin to 0.10
Last modified: 2006-05-03 21:39:24 UTC
The MusicBrainz/TRM tag-generating plugin hasn't been ported to 0.10 yet. Instead of emitting a signal when the tag is ready and making it availabel through gobject properties, it would be better to send it downstream. That would mean apps like Sound-Juicer could just insert the element before the encoders, and the MB tags would automatically be inserted into the file.
Created attachment 62585 [details] [review] port trm element to 0.10 Ports the trm element to 0.10, including the signature-emission change described above. I'm not sure whether the tag GST_TAG_MUSICBRAINZ_TRMID is supposed to use the raw or ascii versions of the tag; I've used the ascii version in the patch, but it is trivial to change. "src ! decodebin ! audioconvert ! trm ! fakesink" correctly generates the tags for me, I haven't done furthur testing yet.
Nice work, thanks for porting this! Comitted to CVS with some clean-ups: 2006-05-03 Tim-Philipp Müller <tim at centricular dot net> Patch by: James "Doc" Livingston <doclivingston gmail com> * configure.ac: * ext/musicbrainz/Makefile.am: * ext/musicbrainz/gsttrm.c: (gst_trm_base_init), (gst_trm_class_init), (gst_trm_init), (gst_trm_setcaps), (gst_trm_chain), (gst_trm_emit_signature), (gst_trm_set_property), (gst_trm_get_property), (gst_trm_change_state), (plugin_init): * ext/musicbrainz/gsttrm.h: Port MusicBrainz TRM plugin (#336898). (took the liberty to rename everything to gst_trm_ in the process, since the element itself is called "trm" and the debug category is "trm" as well). Some comments for future stuff: - gst_pad_get_peer (pad) and gst_pad_get_parent (pad) return a reference, so gst_object_unref() must be called on the returned object after that. - in a chain function you should always pass the return value of gst_pad_push() back to the caller/upstream. - when you throw an error with GST_ELEMENT_ERROR, you should also return GST_FLOW_ERROR in the chain function.