webrtc_sendrecv.py: Fix event loop usage for messages
authorNirbheek Chauhan <nirbheek@centricular.com>
Tue, 1 Mar 2022 18:33:29 +0000 (00:03 +0530)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 18 Mar 2022 08:16:45 +0000 (08:16 +0000)
commit2294356d9b100e4aa048e9272aa90bea46feff5d
tree37d7ab0252edd11f09e0c9ccc9e53123ac5ca7b0
parentee4ca699a0b8d953a1cca8e845e39a52a16adab1
webrtc_sendrecv.py: Fix event loop usage for messages

Instead of creating a new loop, we should just be fetching the running
loop, then doing a blocking network call inside the callback, schedule
it on the event loop. This is what the C example does too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1864>
subprojects/gst-examples/webrtc/sendrecv/gst/webrtc_sendrecv.py