| 29 | # see |
| 30 | # http://www.sicem.biz/personal/lgs/docs/gobject-python/gobject-tutorial.html |
| 31 | class MyBin(gst.Bin): |
| 32 | _state_changed = False |
| 33 | |
| 34 | def __init__(self, name): |
| 35 | # we need to call GObject's init to be able to do self.do_* |
| 36 | gobject.GObject.__init__(self) |
| 37 | # since we can't chain up to our parent's __init__, we set the |
| 38 | # name manually |
| 39 | self.set_property('name', name) |
| 40 | |
| 41 | def do_change_state(self, state_change): |
| 42 | if state_change == gst.STATE_CHANGE_PAUSED_TO_PLAYING: |
| 43 | self._state_changed = True |
| 44 | # FIXME: it seems a vmethod increases the refcount without unreffing |
| 45 | # print self.__gstrefcount__ |
| 46 | # print self.__grefcount__ |
| 47 | |
| 48 | # chain up to parent |
| 49 | return gst.Bin.do_change_state(self, state_change) |
| 50 | |
| 51 | # we need to register the type for PyGTK < 2.8 |
| 52 | gobject.type_register(MyBin) |
no outgoing calls