コード例 #1
0
ファイル: player_bin.py プロジェクト: gitter-badger/lollypop
 def __on_bus_element(self, bus, message):
     """
         Set elements for missings plugins
         @param bus as Gst.Bus
         @param message as Gst.Message
     """
     if GstPbutils.is_missing_plugin_message(message):
         self.__codecs.append(message)
コード例 #2
0
ファイル: pithos.py プロジェクト: Greenginer/pithos
 def on_gst_element(self, bus, message):
     if GstPbutils.is_missing_plugin_message(message):
         if GstPbutils.install_plugins_supported():
             details = GstPbutils.missing_plugin_message_get_installer_detail(message)
             GstPbutils.install_plugins_async([details,], None, self.on_gst_plugin_installed, None)
         else:
             self.error_dialog(_("Missing codec"), None,
                     submsg=_("GStreamer is missing a plugin and it could not be automatically installed. Either manually install it or try another quality setting."))
コード例 #3
0
ファイル: pithos.py プロジェクト: just-digital/pithos
 def on_gst_element(self, bus, message):
     if GstPbutils.is_missing_plugin_message(message):
         if GstPbutils.install_plugins_supported():
             details = GstPbutils.missing_plugin_message_get_installer_detail(message)
             GstPbutils.install_plugins_async([details,], None, self.on_gst_plugin_installed, None)
         else:
             self.error_dialog(_("Missing codec"), None,
                     submsg=_("GStreamer is missing a plugin and it could not be automatically installed. Either manually install it or try another quality setting."))
コード例 #4
0
ファイル: player_bin.py プロジェクト: Nikhil-z/lollypop
 def _on_bus_element(self, bus, message):
     """
         Set elements for missings plugins
         @param bus as Gst.Bus
         @param message as Gst.Message
     """
     if GstPbutils.is_missing_plugin_message(message):
         self._codecs.append(message)
コード例 #5
0
ファイル: gstplayer.py プロジェクト: glennimoss/pithos
 def _on_element(self, bus, message):
     if GstPbutils.is_missing_plugin_message(message):
         if GstPbutils.install_plugins_supported():
             details = (
                 GstPbutils.missing_plugin_message_get_installer_detail(
                     message))
             GstPbutils.install_plugins_async(
                 [details], None, self._plugin_installation_complete, None)
         else:
             self.emit("error", "Missing codec",
                       "GStreamer is missing a plugin and it could not be "
                       "automatically installed. Either manually install "
                       "it or try another quality setting.",
                       False)
コード例 #6
0
    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
コード例 #7
0
def handle_message(message, engine):
    """
        Handles `message` by checking whether it is a "missing plugin" message.
        If it is, takes all required steps to make sure that
            * playback is paused
            * the user is notified of the issue
            * the user gets a hint on which software to install

        @param message: a Gst.Message of type Gst.MessageType.Element
        @param engine: an instance of xl.player.gst.engine.ExaileGstEngine

        @return: True if the message was a "missing plugin" message and was
                    being handled. This does not mean that the plugin installed
                    successfully.
                 False if the message should be handled by some other code
                    because it is not related to a missing plugin.
    """
    if not GstPbutils.is_missing_plugin_message(message):
        return False

    __handle_plugin_missing_message(message, engine)
    return True
コード例 #8
0
ファイル: missing_plugin.py プロジェクト: exaile/exaile
def handle_message(message, engine):
    """
        Handles `message` by checking whether it is a "missing plugin" message.
        If it is, takes all required steps to make sure that
            * playback is paused
            * the user is notified of the issue
            * the user gets a hint on which software to install

        @param message: a Gst.Message of type Gst.MessageType.Element
        @param engine: an instance of xl.player.gst.engine.ExaileGstEngine

        @return: True if the message was a "missing plugin" message and was
                    being handled. This does not mean that the plugin installed
                    successfully.
                 False if the message should be handled by some other code
                    because it is not related to a missing plugin.
    """
    if not GstPbutils.is_missing_plugin_message(message):
        return False

    __handle_plugin_missing_message(message, engine)
    return True
コード例 #9
0
    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
コード例 #10
0
 def _on_bus_element(self, bus, message):
     if GstPbutils.is_missing_plugin_message(message):
         self._missingPluginMessages.append(message)
コード例 #11
0
ファイル: player.py プロジェクト: saifulbkhan/gnome-music
 def _on_bus_element(self, bus, message):
     if GstPbutils.is_missing_plugin_message(message):
         self._missingPluginMessages.append(message)
コード例 #12
0
ファイル: player_bin.py プロジェクト: serkanalgur/lollypop
 def _on_bus_element(self, bus, message):
     if GstPbutils.is_missing_plugin_message(message):
         if self._codecs is not None:
             self._codecs.append(message)