python - porting PyGST app to GStreamer1.0 + PyGI -


i have python audio player based on gstreamer , dbus http://sourceforge.net/p/autoradiobc/code/210/tree/trunk/autoradio/autoplayer/player_gstreamer1.py. works pygst , want port gstreamer 1. following how https://wiki.ubuntu.com/novacut/gstreamer1.0 it's going work but:

file "/home/pat1/svn/autoradio/autoradio/autoplayer/player.py", line 826, in position except(gst.queryerror): file "/usr/lib64/python2.7/site-packages/gi/module.py", line 316, in __getattr__ return getattr(self._introspection_module, name) file "/usr/lib64/python2.7/site-packages/gi/module.py", line 135, in __getattr__ self.__name__, name)) attributeerror: 'gi.repository.gst' object has no attribute 'queryerror' 

it's in part of code:

try:   pos_int = self.player.query_position(gst.format.time, none)[0] except(gst.queryerror):   logging.warning( "gst.queryerror in query_position" )   return none 

bypassing problem after :

if ret == gst.state.change_failure: attributeerror: type object 'gststate' has no attribute 'change_failure' 

in part of code:

ret = self.player.set_state(gst.state.ready) if ret == gst.state.change_failure:   logging.error( "unable set pipeline ready state.") 

bypassing problem too, get:

file "/home/pat1/svn/autoradio/autoradio/autoplayer/player.py", line 659, in on_message_state_changed (gst.element_state_get_name(old_state), file "/usr/lib64/python2.7/site-packages/gi/module.py", line 316, in __getattr__ return getattr(self._introspection_module, name) file "/usr/lib64/python2.7/site-packages/gi/module.py", line 135, in __getattr__ self.__name__, name)) attributeerror: 'gi.repository.gst' object has no attribute 'element_state_get_name' 

in part of code:

    logging.debug("pipeline state changed %s %s. pendig: %s"%                  (gst.element_state_get_name(old_state),                   gst.element_state_get_name (new_state),                   gst.element_state_get_name (pending_state))) 

commenting out element_state_get_name player going work ....

how can migrate gstreamer 1 full code without bypass broken code ?

i cannot find solution first problem queryerror

but :

if ret == gst.state.change_failure: 

become:

if ret == gst.statechangereturn.failure: 

and:

gst.element_state_get_name(old_state) 

become:

gst.element.state_get_name(old_state) 

and:

      self.player.set_new_stream_time(0l) 

become:

      self.player.set_start_time(0l) 

and:

     event = gst.event_new_seek(1.0, gst.format.time,              gst.seekflags.flush|gst.seekflags.accurate,              gst.seek_type_set, tnano, gst.seek_type_none, 0) 

become:

     event = gst.event.new_seek(1.0, gst.format.time,              gst.seekflags.flush|gst.seekflags.accurate,              gst.seektype.set, tnano, gst.seektype.none, 0) 

and:

    pos_int = self.player.query_duration(gst.format.time, none)[0] 

become:

    pos_int = self.player.query_duration(gst.format.time)[1] 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -