def on_sync_message(self, bus, message, window_id): # print 'On sync message called: ' + message.get_structure().get_name() if not message.get_structure() is None: if message.get_structure().get_name() == 'prepare-window-handle': # print 'Setting window xid' image_sink = message.src image_sink.set_property('force-aspect-ratio', True) image_sink.set_window_handle(self.window_id) if message.get_structure().get_name() == 'missing-plugin': print 'Gstreamer missing plugin: ' + gstpb.missing_plugin_message_get_description(message)
def on_message(self, bus, message): mtype = message.type # print(mtype) if mtype == Gst.MessageType.ERROR: print("we got an error, life is shit") err, debug = message.parse_error() print(err) print(debug) Gst.debug_bin_to_dot_file (self.pipeline, \ Gst.DebugGraphDetails.ALL, 'transmageddon-debug-graph') #self.emit('got-error', err.message) elif mtype == Gst.MessageType.ELEMENT: if GstPbutils.is_missing_plugin_message(message): print("missing something") if self.missingplugin == False: #don't think this is correct if more than one plugin installed self.missingplugin = message GstPbutils.missing_plugin_message_get_description(message) GstPbutils.missing_plugin_message_get_installer_detail( message) self.uridecoder.set_state(Gst.State.NULL) self.emit('missing-plugin') elif mtype == Gst.MessageType.ASYNC_DONE: self.emit('ready-for-querying') elif mtype == Gst.MessageType.EOS: self.usedstreamids = [] #removing multipass cache file when done if (self.streamdata['multipass'] != 0) and (self.streamdata['passcounter'] != self.streamdata['multipass']): if os.access(self.cachefile, os.F_OK): os.remove(self.cachefile) os.remove(self.cachefile + '.mbtree') # print(self.streamdata['passcounter']) self.emit('got-eos') self.pipeline.set_state(Gst.State.NULL) elif mtype == Gst.MessageType.APPLICATION: self.pipeline.set_state(Gst.State.NULL) self.pipeline.remove(self.uridecoder) return True
def on_message(self, bus, message): mtype = message.type # print(mtype) if mtype == Gst.MessageType.ERROR: print("we got an error, life is shit") err, debug = message.parse_error() print(err) print(debug) Gst.debug_bin_to_dot_file(self.pipeline, Gst.DebugGraphDetails.ALL, "transmageddon-debug-graph") # self.emit('got-error', err.message) elif mtype == Gst.MessageType.ELEMENT: if GstPbutils.is_missing_plugin_message(message): print("missing something") if self.missingplugin == False: # don't think this is correct if more than one plugin installed self.missingplugin = message GstPbutils.missing_plugin_message_get_description(message) GstPbutils.missing_plugin_message_get_installer_detail(message) self.uridecoder.set_state(Gst.State.NULL) self.emit("missing-plugin") elif mtype == Gst.MessageType.ASYNC_DONE: self.emit("ready-for-querying") elif mtype == Gst.MessageType.EOS: self.usedstreamids = [] # removing multipass cache file when done if (self.streamdata["multipass"] != 0) and (self.streamdata["passcounter"] != self.streamdata["multipass"]): if os.access(self.cachefile, os.F_OK): os.remove(self.cachefile) os.remove(self.cachefile + ".mbtree") # print(self.streamdata['passcounter']) self.emit("got-eos") self.pipeline.set_state(Gst.State.NULL) elif mtype == Gst.MessageType.APPLICATION: self.pipeline.set_state(Gst.State.NULL) self.pipeline.remove(self.uridecoder) return True
def _show_codec_confirmation_dialog(self, install_helper_name, missing_plugin_messages): dialog = MissingCodecsDialog(self._parent_window, install_helper_name) def on_dialog_response(dialog, response_type): if response_type == Gtk.ResponseType.ACCEPT: self._start_plugin_installation(missing_plugin_messages, False) dialog.destroy() descriptions = [] for message in missing_plugin_messages: description = GstPbutils.missing_plugin_message_get_description(message) descriptions.append(description) dialog.set_codec_names(descriptions) dialog.connect('response', on_dialog_response) dialog.present()
def __handle_plugin_missing_message(message, engine): desc = GstPbutils.missing_plugin_message_get_description(message) installer_details = GstPbutils.missing_plugin_message_get_installer_detail(message) LOGGER.warning("A plugin for %s is missing, stopping playback", desc) user_message = _( "A GStreamer 1.x plugin for %s is missing. " "Without this software installed, Exaile will not be able to play the current file. " "Please install the required software on your computer. See %s for details." ) % (desc, MISSING_PLUGIN_URL) # TODO make URL clickable by utilizing xlgui.widgets.dialogs.MessageBar engine.stop() __notify_user_on_error(user_message, engine) if GstPbutils.install_plugins_supported(): if __run_installer_helper(installer_details): return LOGGER.warning("Installation of GStreamer plugins not supported on this platform.")
def __handle_plugin_missing_message(message, engine): desc = GstPbutils.missing_plugin_message_get_description(message) installer_details = GstPbutils.missing_plugin_message_get_installer_detail(message) LOGGER.warn("A plugin for %s is missing, stopping playback", desc) user_message = _( "A GStreamer 1.x plugin for %s is missing. " "Without this software installed, Exaile will not be able to play the current file. " "Please install the required software on your computer. See %s for details." ) % (desc, MISSING_PLUGIN_URL) # TODO make URL clickable by utilizing xlgui.widgets.dialogs.MessageBar engine.stop() __notify_user_on_error(user_message, engine) if GstPbutils.install_plugins_supported(): if __run_installer_helper(installer_details): return LOGGER.warn("Installation of GStreamer plugins not supported on this platform.")