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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1821>
This commit is contained in:
Nirbheek Chauhan 2022-03-01 19:58:16 +05:30 committed by GStreamer Marge Bot
parent e9a02a7380
commit 5ca5a83e75

View file

@ -15,6 +15,13 @@ from gi.repository import GstWebRTC
gi.require_version('GstSdp', '1.0') gi.require_version('GstSdp', '1.0')
from gi.repository import GstSdp 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 = ''' PIPELINE_DESC = '''
webrtcbin name=sendrecv bundle-policy=max-bundle stun-server=stun://stun.l.google.com:19302 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 ! videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! vp8enc deadline=1 ! rtpvp8pay !