[Goodies-commits] r7563 - xfburn/trunk/xfburn

David Mohr squisher at xfce.org
Sun Jun 14 07:44:05 CEST 2009


Author: squisher
Date: 2009-06-14 05:44:05 +0000 (Sun, 14 Jun 2009)
New Revision: 7563

Modified:
   xfburn/trunk/xfburn/xfburn-transcoder-gst.c
Log:
Adding resampling to gstreamer pipeline

Modified: xfburn/trunk/xfburn/xfburn-transcoder-gst.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-transcoder-gst.c	2009-06-14 03:59:45 UTC (rev 7562)
+++ xfburn/trunk/xfburn/xfburn-transcoder-gst.c	2009-06-14 05:44:05 UTC (rev 7563)
@@ -112,7 +112,7 @@
 
 typedef struct {
   GstElement *pipeline;
-  GstElement *source, *decoder, *conv, *sink;
+  GstElement *source, *decoder, *resample, *conv, *sink;
 
   XfburnTranscoderGstState state;
   GCond *gst_cond;
@@ -258,7 +258,7 @@
 {
   XfburnTranscoderGstPrivate *priv= XFBURN_TRANSCODER_GST_GET_PRIVATE (trans);
 
-  GstElement *pipeline, *source, *decoder, *conv, *sink;
+  GstElement *pipeline, *source, *decoder, *resample, *conv, *sink;
 #if DEBUG_GST > 0 && DEBUG > 0
   GstElement *id;
 #endif
@@ -271,6 +271,7 @@
 
   priv->source  = source   = gst_element_factory_make ("filesrc",       "file-source");
   priv->decoder = decoder  = gst_element_factory_make ("decodebin",     "decoder");
+  priv->resample= resample = gst_element_factory_make ("audioresample", "resampler");
   priv->conv    = conv     = gst_element_factory_make ("audioconvert",  "converter");
 #if DEBUG_GST > 0 && DEBUG > 0
                   id       = gst_element_factory_make ("identity",      "debugging-identity");
@@ -279,7 +280,7 @@
   //priv->sink    = sink     = gst_element_factory_make ("fakesink",        "audio-output");
   //DBG ("\npipeline = %p\nsource = %p\ndecoder = %p\nconv = %p\nsink = %p", pipeline, source, decoder, conv, sink);
 
-  if (!pipeline || !source || !decoder || !conv || !sink) {
+  if (!pipeline || !source || !decoder || !resample || !conv || !sink) {
     g_warning ("A pipeline element could not be created");
     g_set_error (&(priv->error), XFBURN_ERROR, XFBURN_ERROR_GST_CREATION,
 		    "%s",
@@ -304,12 +305,13 @@
   gst_object_unref (bus);
 
   gst_bin_add_many (GST_BIN (pipeline),
-                    source, decoder, conv, sink, NULL);
+                    source, decoder, resample, conv, sink, NULL);
 #if DEBUG_GST > 0 && DEBUG > 0
   gst_bin_add (GST_BIN (pipeline), id);
 #endif
 
   gst_element_link (source, decoder);
+  gst_element_link (resample, conv);
 
   /* setup caps for raw pcm data */
   caps = gst_caps_new_simple ("audio/x-raw-int",
@@ -657,7 +659,7 @@
   GstCaps *caps;
   GstStructure *str;
   GstPad *audiopad;
-  GstElement *audio = (GstElement *) priv->conv;
+  GstElement *audio = (GstElement *) priv->resample;
 
   // only link once
   audiopad = gst_element_get_static_pad (audio, "sink");




More information about the Goodies-commits mailing list