#!/usr/bin/env python

import gst
import gobject
gobject.threads_init()

rgvolume = gst.element_factory_make("rgvolume")
rglimiter = gst.element_factory_make("rglimiter")

print "created elements"

rgfilter = gst.Bin()
rgfilter.add(rgvolume, rglimiter)
rgvolume.link(rglimiter)
rgfilter.add_pad(gst.GhostPad("sink", rgvolume.get_static_pad("sink")))
rgfilter.add_pad(gst.GhostPad("src", rglimiter.get_static_pad("src")))

print "created inner bin"

filterbin = gst.Bin()
ac1 = gst.element_factory_make("audioconvert")
ac2 = gst.element_factory_make("audioconvert")
filterbin.add(ac1, rgfilter, ac2)

print "created outer bin"

gst.element_link_many(ac1, rgfilter, ac2)

print "linked"

