mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
Add check_plugins() to Python example, matching C and Rust versions
This commit is contained in:
parent
fd1d53b04a
commit
738e969a06
1 changed files with 12 additions and 0 deletions
|
@ -148,8 +148,20 @@ class WebRTCClient:
|
|||
return 0
|
||||
|
||||
|
||||
def check_plugins():
|
||||
needed = ["opus", "vpx", "nice", "webrtc", "dtls", "srtp", "rtp",
|
||||
"rtpmanager", "videotestsrc", "audiotestsrc"]
|
||||
missing = list(filter(lambda p: Gst.Registry.get().find_plugin(p) is None, needed))
|
||||
if len(missing):
|
||||
print('Missing gstreamer plugins:', missing)
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
if __name__=='__main__':
|
||||
Gst.init(None)
|
||||
if not check_plugins():
|
||||
sys.exit(1)
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('peerid', help='String ID of the peer to connect to')
|
||||
parser.add_argument('--server', help='Signalling server to connect to, eg "wss://127.0.0.1:8443"')
|
||||
|
|
Loading…
Reference in a new issue