import sys
import gi
gi.require_version('Gst', '1.0')
from gi.repository import GObject, GLib, Gst
GObject.threads_init()
GLib.threads_init()
Gst.init(None)

print 'init done'
sys.stdin.readline()


b = Gst.Bin( 'audio-out-bin' )

e1 = Gst.ElementFactory.make( 'alsasink', None )

print 'e1',e1
sys.stdin.readline()

b.add( e1 )
print 'e1 added to b',e1,b
sys.stdin.readline()

b = None
print 'b',b
sys.stdin.readline()

e1 = None
print 'e1',e1
sys.stdin.readline()
