[gst-devel] GnlOperation help

Mike MacHenry dskippy at ccs.neu.edu
Tue Feb 12 19:14:45 CET 2008


It turns out the failing to seek was my mp3. I tried with one that I
made with gstreamer itself and it work. It must be some odd caps
issue. I had a little more luck with the operation as well. I copied
some code right from the Instrument.py of Jokosher. This is what I'm
using now...

        def add_fade (self, start, duration, start_volume, end_volume):
                volumeFadeBin = gst.element_factory_make("bin")
                volumeFadeElement = gst.element_factory_make("volume")
                volumeFadeStartConvert =
gst.element_factory_make("audioconvert")
                volumeFadeEndConvert = gst.element_factory_make("audioconvert")
                volumeFadeOperation = gst.element_factory_make("gnloperation")
                volumeFadeController =
gst.Controller(volumeFadeElement, "volume")
                volumeFadeBin.add(volumeFadeElement)
                volumeFadeBin.add(volumeFadeStartConvert)
                volumeFadeBin.add(volumeFadeEndConvert)
                volumeFadeBinSink = gst.GhostPad("sink",
volumeFadeStartConvert.get_pad("sink"))
                volumeFadeBin.add_pad(volumeFadeBinSink)
                volumeFadeBinSrc = gst.GhostPad("src",
volumeFadeEndConvert.get_pad("src"))
                volumeFadeBin.add_pad(volumeFadeBinSrc)
                volumeFadeOperation.set_property("start", start * gst.SECOND)
                volumeFadeOperation.set_property("duration", duration
* gst.SECOND)
                volumeFadeOperation.set_property("priority", 1)
                volumeFadeController.set_interpolation_mode("volume",
gst.INTERPOLATE_LINEAR)
                volumeFadeOperation.add(volumeFadeBin)
                self.gnlcomposition.add(volumeFadeOperation)
                volumeFadeStartConvert.link(volumeFadeElement)
                volumeFadeElement.link(volumeFadeEndConvert)
                volumeFadeController.set("volume", start * gst.SECOND,
start_volume)
                volumeFadeController.set("volume", (start+duration) *
gst.SECOND, end_volume)
                return (volumeFadeController, volumeFadeOperation)

This worked in my simple test so I think this is correct. The one
problem I am having with this I'm going to have to debug and reduce a
little more before I come for help. I have an infinite gnlcomposition
that I keep adding to and tossing in these operations cause it errors
when they tried to get cleanup up. More on this later. thanks for the
help.

-mike

On Feb 11, 2008 1:56 PM, Brandon Lewis <brandon_lewis at berkeley.edu> wrote:
> forgot to mention that i'm using the ubuntu feisty build of gstreamer,
> 0.10.14, gnonlin 0.10.9-1
>
> --brandon
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>




More information about the gstreamer-devel mailing list