Skip to content

Commit

Permalink
#3964 warn if the overrides are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Mar 27, 2024
1 parent 50023ac commit 38ff693
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions xpra/codecs/gstreamer/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,20 @@ def numdenom(fraction):
return Gst.value_serialize(value)


_overrides_verified = False


def verify_gst_overrides() -> None:
global _overrides_verified
if _overrides_verified:
return
from importlib.util import find_spec
if not find_spec("gi.overrides.Gst"):
log.warn("Warning: `python3-gstreamer` is not installed")
log.warn(" this will prevent the python bindings from working properly")
_overrides_verified = True


def get_encoder_info(element="vp8enc") -> dict:
"""
Get the element's input information,
Expand All @@ -227,6 +241,7 @@ def get_encoder_info(element="vp8enc") -> dict:
return {}
if factory.get_num_pad_templates() == 0:
return {}
verify_gst_overrides()
pads = factory.get_static_pad_templates()
info = {}
GLib = gi_import("GLib")
Expand Down

0 comments on commit 38ff693

Please sign in to comment.