*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*/
/**
* <refsect2>
* <title>Example pipelines</title>
* |[
- * gst-launch -v filesrc location=foo.ogg ! decodebin ! audioconvert ! lame ! apev2mux ! filesink location=foo.mp3
+ * gst-launch-1.0 -v filesrc location=foo.ogg ! decodebin ! audioconvert ! lame ! apev2mux ! filesink location=foo.mp3
* ]| A pipeline that transcodes a file from Ogg/Vorbis to mp3 format with an
* APEv2 that contains the same as the the Ogg/Vorbis file. Make sure the
* Ogg/Vorbis file actually has comments to preserve.
* |[
- * gst-launch -m filesrc location=foo.mp3 ! apedemux ! fakesink silent=TRUE 2> /dev/null | grep taglist
+ * gst-launch-1.0 -m filesrc location=foo.mp3 ! apedemux ! fakesink silent=TRUE 2> /dev/null | grep taglist
* ]| Verify that tags have been written.
* </refsect2>
*/
G_DEFINE_TYPE (GstApev2Mux, gst_apev2_mux, GST_TYPE_TAG_MUX);
-static GstBuffer *gst_apev2_mux_render_tag (GstTagMux * mux,
+static GstBuffer *gst_apev2_mux_render_start_tag (GstTagMux * mux,
const GstTagList * taglist);
static GstBuffer *gst_apev2_mux_render_end_tag (GstTagMux * mux,
const GstTagList * taglist);
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
GST_TAG_MUX_CLASS (klass)->render_start_tag =
- GST_DEBUG_FUNCPTR (gst_apev2_mux_render_tag);
+ GST_DEBUG_FUNCPTR (gst_apev2_mux_render_start_tag);
GST_TAG_MUX_CLASS (klass)->render_end_tag =
GST_DEBUG_FUNCPTR (gst_apev2_mux_render_end_tag);
- gst_element_class_add_pad_template (element_class,
- gst_static_pad_template_get (&sink_template));
- gst_element_class_add_pad_template (element_class,
- gst_static_pad_template_get (&src_template));
+ gst_element_class_add_static_pad_template (element_class, &sink_template);
+ gst_element_class_add_static_pad_template (element_class, &src_template);
- gst_element_class_set_details_simple (element_class,
+ gst_element_class_set_static_metadata (element_class,
"TagLib-based APEv2 Muxer", "Formatter/Metadata",
"Adds an APEv2 header to the beginning of files using taglib",
"Sebastian Dröge <slomo@circular-chaos.org>");
/* nothing to do */
}
+static gboolean
+gst_apev2_mux_have_wavpack (GstApev2Mux * apev2mux)
+{
+ const GstStructure *s;
+ gboolean ret;
+ GstCaps *caps;
+ GstPad *sink;
+
+ sink = gst_element_get_static_pad (GST_ELEMENT_CAST (apev2mux), "sink");
+ caps = gst_pad_get_current_caps (sink);
+ gst_object_unref (sink);
+
+ if (caps == NULL)
+ return FALSE;
+
+ s = gst_caps_get_structure (caps, 0);
+ ret = gst_structure_has_name (s, "audio/x-wavpack");
+ gst_caps_unref (caps);
+
+ GST_LOG_OBJECT (apev2mux, "got wavpack input: %s", ret ? "yes" : "no");
+ return ret;
+}
+
static void
add_one_tag (const GstTagList * list, const gchar * tag, gpointer user_data)
{
}
static GstBuffer *
+gst_apev2_mux_render_start_tag (GstTagMux * mux, const GstTagList * taglist)
+{
+ if (gst_apev2_mux_have_wavpack (GST_APEV2_MUX (mux)))
+ return NULL;
+
+ return gst_apev2_mux_render_tag (mux, taglist);
+}
+
+static GstBuffer *
gst_apev2_mux_render_end_tag (GstTagMux * mux, const GstTagList * taglist)
{
+ if (gst_apev2_mux_have_wavpack (GST_APEV2_MUX (mux)))
+ return gst_apev2_mux_render_tag (mux, taglist);
+
return NULL;
}