def init(): global has_validate try: from gi.repository import GstValidate GstValidate.init() has_validate = GES.validate_register_action_types() GstValidate.register_action_type( "stop", "pitivi", stop, None, "Pitivi override for the stop action", GstValidate.ActionTypeFlags.NONE) except ImportError: has_validate = False
def init(): global has_validate try: from gi.repository import GstValidate GstValidate.init() has_validate = GES.validate_register_action_types() GstValidate.register_action_type("stop", "pitivi", stop, None, "Pitivi override for the stop action", GstValidate.ActionTypeFlags.NONE) except ImportError: has_validate = False
def init(): global has_validate try: from gi.repository import GstValidate GstValidate.init() has_validate = GES.validate_register_action_types() GstValidate.register_action_type("stop", "pitivi", stop, None, "Pitivi override for the stop action", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type("seek", "pitivi", seek, None, "Pitivi override for the seek action", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type("pause", "pitivi", set_state, None, "Pitivi override for the pause action", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type("play", "pitivi", set_state, None, "Pitivi override for the pause action", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type("set-state", "pitivi", set_state, None, "Pitivi override for the set-state action", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type("edit-container", "pitivi", editContainer, None, "Start dragging a clip in the timeline", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type("split-clip", "pitivi", split_clip, None, "Split a clip", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type("add-layer", "pitivi", add_layer, None, "Add layer", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type("remove-clip", "pitivi", remove_clip, None, "Remove clip", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type("select-clips", "pitivi", select_clips, [Parametter("clip-name", "The name of the clip to select", True, None, "str")], "Select clips", GstValidate.ActionTypeFlags.NONE) for z in ["zoom-fit", "zoom-out", "zoom-in"]: GstValidate.register_action_type(z, "pitivi", zoom, None, z, GstValidate.ActionTypeFlags.NO_EXECUTION_NOT_FATAL) GstValidate.register_action_type('set-zoom-level', "pitivi", setZoomLevel, None, z, GstValidate.ActionTypeFlags.NO_EXECUTION_NOT_FATAL) Gst.info("Adding pitivi::wrong-window-creation") GstValidate.Issue.register(GstValidate.Issue.new( GLib.quark_from_string("pitivi::wrong-window-creation"), "A new window for the sink has wrongly been created", "All sink should display their images in an embedded " "widget and thus not create a new window", GstValidate.ReportLevel.CRITICAL)) return True except ImportError: has_validate = False return False
def register_action_types(observer): if not isinstance(observer, ActionObserver): raise TypeError GstValidate.register_action_type( Actions.CREATE_OFFER.value, "webrtc", observer._action, None, "Instruct a create-offer to commence", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type(Actions.CREATE_ANSWER.value, "webrtc", observer._action, None, "Create answer", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type( Actions.WAIT_FOR_NEGOTIATION_STATE.value, "webrtc", observer._action, None, "Wait for a specific negotiation state to be reached", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type(Actions.ADD_STREAM.value, "webrtc", observer._action, None, "Add a stream to the webrtcbin", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type( Actions.ADD_DATA_CHANNEL.value, "webrtc", observer._action, None, "Add a data channel to the webrtcbin", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type( Actions.SEND_DATA_CHANNEL_STRING.value, "webrtc", observer._action, None, "Send a message using a data channel", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type( Actions.WAIT_FOR_DATA_CHANNEL_STATE.value, "webrtc", observer._action, None, "Wait for data channel to reach state", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type(Actions.CLOSE_DATA_CHANNEL.value, "webrtc", observer._action, None, "Close a data channel", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type(Actions.WAIT_FOR_DATA_CHANNEL.value, "webrtc", observer._action, None, "Wait for a data channel to appear", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type( Actions.WAIT_FOR_DATA_CHANNEL_STRING.value, "webrtc", observer._action, None, "Wait for a data channel to receive a message", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type( Actions.WAIT_FOR_NEGOTIATION_NEEDED.value, "webrtc", observer._action, None, "Wait for a the on-negotiation-needed signal to fire", GstValidate.ActionTypeFlags.NONE) GstValidate.register_action_type(Actions.SET_WEBRTC_OPTIONS.value, "webrtc", observer._action, None, "Set some webrtc options", GstValidate.ActionTypeFlags.NONE)