Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
also don't call show_codecs from load_codecs, let callers decide if they want it
  • Loading branch information
totaam committed Nov 22, 2021
1 parent 09bd445 commit ac417e5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
3 changes: 2 additions & 1 deletion xpra/client/gtk_base/bug_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ def setup_window(self):
ibox.pack_start(al)
#generic toggles:
from xpra.gtk_common.keymap import get_gtk_keymap
from xpra.codecs.loader import codec_versions, load_codecs
from xpra.codecs.loader import codec_versions, load_codecs, show_codecs
load_codecs()
show_codecs()
try:
from xpra.sound.wrapper import query_sound
def get_sound_info():
Expand Down
14 changes: 4 additions & 10 deletions xpra/codecs/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,37 +185,31 @@ def load_codec(name):


def load_codecs(encoders=True, decoders=True, csc=True, video=True):
show = []
log("loading codecs")

def load(*names):
for name in names:
load_codec(name)

if encoders:
show += list(ENCODER_CODECS)
load(*ENCODER_CODECS)
if video:
show += list(ENCODER_VIDEO_CODECS)
load(*ENCODER_VIDEO_CODECS)
if csc and video:
show += list(CSC_CODECS)
load(*CSC_CODECS)
if decoders:
show += list(DECODER_CODECS)
load(*DECODER_CODECS)
if video:
show += list(DECODER_VIDEO_CODECS)
load(*DECODER_VIDEO_CODECS)
log("done loading codecs")
show_codecs()

def show_codecs():
def show_codecs(show=None):
#print("codec_status=%s" % codecs)
for name in sorted(ALL_CODECS):
for name in sorted(show or ALL_CODECS):
log("* %s : %s %s" % (name.ljust(20), str(name in codecs).ljust(10), codecs.get(name, "")))
log("codecs versions:")
for name, version in codec_versions.items():
for name in (show or codec_versions.keys()):
version = codec_versions.get(name, "")
log("* %s : %s" % (name.ljust(20), version))


Expand Down
3 changes: 2 additions & 1 deletion xpra/codecs/video_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def getVideoHelper():


def main():
from xpra.codecs.loader import log as loader_log, load_codecs
from xpra.codecs.loader import log as loader_log, load_codecs, show_codecs
from xpra.util import print_nested_dict
from xpra.log import enable_color
from xpra.platform import program_context
Expand All @@ -445,6 +445,7 @@ def main():
loader_log.enable_debug()
log.enable_debug()
load_codecs()
show_codecs()
vh = getVideoHelper()
vh.set_modules(ALL_VIDEO_ENCODER_OPTIONS, ALL_CSC_MODULE_OPTIONS, ALL_VIDEO_DECODER_OPTIONS)
vh.init()
Expand Down
3 changes: 2 additions & 1 deletion xpra/gtk_common/start_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,9 @@ def load_codecs(self):
vh.set_modules(video_decoders=self.session_options.video_decoders,
csc_modules=self.session_options.csc_modules or NO_GFX_CSC_OPTIONS)
vh.init()
from xpra.codecs.loader import load_codecs #pylint: disable=import-outside-toplevel
from xpra.codecs.loader import load_codecs, show_codecs #pylint: disable=import-outside-toplevel
load_codecs()
show_codecs()
log("load_codecs() done")


Expand Down

0 comments on commit ac417e5

Please sign in to comment.