From 5ca5a83e7579da17bfd5ffbb723febebfb0da87a Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 1 Mar 2022 19:58:16 +0530 Subject: [PATCH] webrtc_sendrecv.py: Ensure that gst-python overrides are installed Otherwise fetching of the offer will fail with a cryptic error: ``` Traceback (most recent call last): File "/../gstreamer/subprojects/gst-examples/webrtc/sendrecv/gst/webrtc_sendrecv.py", line 56, in on_offer_created offer = reply['offer'] TypeError: 'Structure' object is not subscriptable ``` Part-of: --- .../gst-examples/webrtc/sendrecv/gst/webrtc_sendrecv.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/subprojects/gst-examples/webrtc/sendrecv/gst/webrtc_sendrecv.py b/subprojects/gst-examples/webrtc/sendrecv/gst/webrtc_sendrecv.py index 7eff1d6ae6..9c3311818c 100644 --- a/subprojects/gst-examples/webrtc/sendrecv/gst/webrtc_sendrecv.py +++ b/subprojects/gst-examples/webrtc/sendrecv/gst/webrtc_sendrecv.py @@ -15,6 +15,13 @@ from gi.repository import GstWebRTC gi.require_version('GstSdp', '1.0') from gi.repository import GstSdp +# Ensure that gst-python is installed +try: + from gi.overrides import Gst as _ +except ImportError: + print('gstreamer-python binding overrides aren\'t available, please install them') + raise + PIPELINE_DESC = ''' webrtcbin name=sendrecv bundle-policy=max-bundle stun-server=stun://stun.l.google.com:19302 videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! vp8enc deadline=1 ! rtpvp8pay !