-
-
Save rubenrua/dde3276a341494b75115 to your computer and use it in GitHub Desktop.
Simple script to reproduce a galicaster bug in some firewire devices.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gst | |
import gtk | |
import gobject | |
pipestr = ' dv1394src use-avc=false name=gc-firewire-src ! fakesink ' | |
def __on_state_changed(bus, message): | |
old, new, pending = message.parse_state_changed() | |
if (isinstance(message.src, gst.Pipeline) and | |
(old, new) == (gst.STATE_READY, gst.STATE_PAUSED) ): | |
print "GET_STATE_CHANGE" | |
#close_valve() | |
gobject.timeout_add(300, close_valve) | |
def close_valve(): | |
#valve1 = pipeline.get_by_name("valve") | |
#valve1.set_property('drop', True) | |
print "SET_STATE_PLAYING" | |
pipeline.set_state(gst.STATE_PLAYING) | |
return False | |
def __on_error(bus, msg): | |
print "ERROR" | |
error, debug = msg.parse_error() | |
error_info = "%s (%s)" % (error, debug) | |
print error_info | |
print "START" | |
pipeline = gst.parse_launch(pipestr) | |
bus = pipeline.get_bus() | |
bus.add_signal_watch() | |
bus.enable_sync_message_emission() | |
bus.connect('message::state-changed', __on_state_changed) | |
bus.connect('message::error', __on_error) | |
change = pipeline.set_state(gst.STATE_PAUSED) | |
print pipeline.get_state() | |
#msg = bus.timed_pop_filtered(gst.CLOCK_TIME_NONE, gst.MESSAGE_ERROR | gst.MESSAGE_EOS) | |
gtk.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment