rhythmbox r6008 - in trunk: . metadata
- From: jmatthew svn gnome org
- To: svn-commits-list gnome org
- Subject: rhythmbox r6008 - in trunk: . metadata
- Date: Sun, 2 Nov 2008 07:37:55 +0000 (UTC)
Author: jmatthew
Date: Sun Nov 2 07:37:54 2008
New Revision: 6008
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=6008&view=rev
Log:
2008-11-02 Jonathan Matthew <jonathan d14n org>
* metadata/rb-metadata-gst.c: (qt_pad_added_cb),
(rb_add_qt_tagger), (rb_metadata_init):
Add m4a tag editing using qtmux. Edited files don't play in itunes or
various other places.
Modified:
trunk/ChangeLog
trunk/metadata/rb-metadata-gst.c
Modified: trunk/metadata/rb-metadata-gst.c
==============================================================================
--- trunk/metadata/rb-metadata-gst.c (original)
+++ trunk/metadata/rb-metadata-gst.c Sun Nov 2 07:37:54 2008
@@ -313,6 +313,47 @@
}
static void
+qt_pad_added_cb (GstElement *demux, GstPad *demuxpad, GstPad *muxpad)
+{
+ if (gst_pad_link (demuxpad, muxpad) != GST_PAD_LINK_OK)
+ rb_debug ("unable to link pad from qtdemux to qtmux");
+ else
+ rb_debug ("linked pad from qtdemux to qtmux");
+}
+
+
+static GstElement *
+rb_add_qt_tagger (RBMetaData *md, GstElement *element)
+{
+ GstElement *demux;
+ GstElement *mux;
+ GstPad *muxpad;
+
+ demux = gst_element_factory_make ("qtdemux", NULL);
+ mux = gst_element_factory_make ("qtmux", NULL);
+ if (demux == NULL || mux == NULL)
+ goto error;
+
+ gst_bin_add_many (GST_BIN (md->priv->pipeline), demux, mux, NULL);
+ if (!gst_element_link (element, demux))
+ goto error;
+
+ muxpad = gst_element_get_request_pad (mux, "audio_%d");
+ g_signal_connect (demux, "pad-added", G_CALLBACK (qt_pad_added_cb), muxpad);
+
+ gst_tag_setter_merge_tags (GST_TAG_SETTER (mux), md->priv->tags, GST_TAG_MERGE_REPLACE_ALL);
+
+ return mux;
+
+error:
+ if (demux != NULL)
+ g_object_unref (demux);
+ if (mux != NULL)
+ g_object_unref (mux);
+ return NULL;
+}
+
+static void
add_supported_type (RBMetaData *md,
const char *mime,
RBAddTaggerElem add_tagger_func,
@@ -370,6 +411,10 @@
tagger = (has_giosink && gst_element_factory_find ("flactag")) ? rb_add_flac_tagger : NULL;
add_supported_type (md, "audio/x-flac", tagger, "FLAC");
+ tagger = (has_giosink && gst_element_factory_find ("qtdemux") && gst_element_factory_find ("qtmux")) ? rb_add_qt_tagger : NULL;
+ add_supported_type (md, "audio/x-m4a", tagger, "M4A");
+ add_supported_type (md, "video/quicktime", tagger, "M4A"); /* hmm. */
+
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]