From 738e969a067469b303f8949499f4bf353d035052 Mon Sep 17 00:00:00 2001 From: Matthew Clark Date: Fri, 21 Sep 2018 21:13:44 +0100 Subject: [PATCH] Add check_plugins() to Python example, matching C and Rust versions --- webrtc/sendrecv/gst/webrtc-sendrecv.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/webrtc/sendrecv/gst/webrtc-sendrecv.py b/webrtc/sendrecv/gst/webrtc-sendrecv.py index 083788d47b..e5220c25ab 100644 --- a/webrtc/sendrecv/gst/webrtc-sendrecv.py +++ b/webrtc/sendrecv/gst/webrtc-sendrecv.py @@ -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"')