本文整理汇总了Python中gi.repository.GstPbutils.is_missing_plugin_message方法的典型用法代码示例。如果您正苦于以下问题:Python GstPbutils.is_missing_plugin_message方法的具体用法?Python GstPbutils.is_missing_plugin_message怎么用?Python GstPbutils.is_missing_plugin_message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.GstPbutils
的用法示例。
在下文中一共展示了GstPbutils.is_missing_plugin_message方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _on_bus_element
# 需要导入模块: from gi.repository import GstPbutils [as 别名]
# 或者: from gi.repository.GstPbutils import is_missing_plugin_message [as 别名]
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: on_gst_element
# 需要导入模块: from gi.repository import GstPbutils [as 别名]
# 或者: from gi.repository.GstPbutils import is_missing_plugin_message [as 别名]
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: _on_element
# 需要导入模块: from gi.repository import GstPbutils [as 别名]
# 或者: from gi.repository.GstPbutils import is_missing_plugin_message [as 别名]
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)
示例4: handle_message
# 需要导入模块: from gi.repository import GstPbutils [as 别名]
# 或者: from gi.repository.GstPbutils import is_missing_plugin_message [as 别名]
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
示例5: on_message
# 需要导入模块: from gi.repository import GstPbutils [as 别名]
# 或者: from gi.repository.GstPbutils import is_missing_plugin_message [as 别名]
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
示例6: _on_bus_element
# 需要导入模块: from gi.repository import GstPbutils [as 别名]
# 或者: from gi.repository.GstPbutils import is_missing_plugin_message [as 别名]
def _on_bus_element(self, bus, message):
if GstPbutils.is_missing_plugin_message(message):
self._missingPluginMessages.append(message)
示例7: _on_bus_element
# 需要导入模块: from gi.repository import GstPbutils [as 别名]
# 或者: from gi.repository.GstPbutils import is_missing_plugin_message [as 别名]
def _on_bus_element(self, bus, message):
if GstPbutils.is_missing_plugin_message(message):
if self._codecs is not None:
self._codecs.append(message)