Logo Search packages:      
Sourcecode: scenic version File versions  Download package

def scenic::gui::Gui::_disable_unsupported_codecs (   self ) [private]
Checks if codecs for which not Gstreamer elements are found, and disabled them.
Called only once at startup.

Definition at line 414 of file gui.py.

                                         :
        """
        Checks if codecs for which not Gstreamer elements are found, and disabled them.
        Called only once at startup.
        """
        # all human-readable names, not computer-readble
        #TODO: i18nize
        working_video_codecs = []
        broken_video_codecs = []
        working_audio_codecs = []
        broken_audio_codecs = []
        readable_working_audio_codecs = []
        readable_working_video_codecs = []

        # video codecs:
        for readable, codec in VIDEO_CODECS.iteritems():
            if gstreamer.is_codec_supported(codec):
                working_video_codecs.append(codec)
                readable_working_video_codecs.append(readable)
            else:
                broken_video_codecs.append(readable)
        
        # audio codecs:
        for readable, codec in AUDIO_CODECS.iteritems():
            if gstreamer.is_codec_supported(codec):
                working_audio_codecs.append(codec)
                readable_working_audio_codecs.append(readable)
            else:
                broken_audio_codecs.append(readable)

        # set combo boxes choices:
        _set_combobox_choices(self.audio_codec_widget, readable_working_audio_codecs)
        _set_combobox_choices(self.video_codec_widget, readable_working_video_codecs)
        
        #if len(broken_audio_codecs) != 0 or len(broken_video_codecs) != 0:
        #    msg = _("Some codecs are not supported on your system. They are currently disabled.") 
        #    details = _("You should consider installing the Gstreamer elements to benefit from those codecs.")
        #    details += "\n"
        #    if len(broken_video_codecs) != 0:
        #        details += _("Disabled video codecs:")
        #        details += "\n"
        #        for codec in broken_video_codecs:
        #            details += " * %s\n" % (codec)
        #    if len(broken_audio_codecs) != 0:
        #        details += _("Disabled audio codecs:")
        #        details += "\n"
        #        for codec in broken_audio_codecs:
        #            details += " * %s\n" % (codec)
        #    self.show_error_dialog(msg, details)
        # important:
        self.app.set_supported_codecs(working_audio_codecs, working_video_codecs)


Generated by  Doxygen 1.6.0   Back to index