mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
webrtc_sendrecv.py: Link pads instead of elements
This was not a problem here because even if we end up accidentally linking to the wrong pad, things will work out eventually as long as one pad-added is emitted for each pad that is added. But it will be a huge problem if someone copies this code and changes something that requires different handling for different sorts of pads. The resultant code will be racy. Let's not do this, it's a bad example. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2008>
This commit is contained in:
parent
1403e74196
commit
4ae903d383
1 changed files with 1 additions and 1 deletions
|
@ -188,7 +188,7 @@ class WebRTCClient:
|
||||||
decodebin.connect('pad-added', self.on_incoming_decodebin_stream)
|
decodebin.connect('pad-added', self.on_incoming_decodebin_stream)
|
||||||
self.pipe.add(decodebin)
|
self.pipe.add(decodebin)
|
||||||
decodebin.sync_state_with_parent()
|
decodebin.sync_state_with_parent()
|
||||||
self.webrtc.link(decodebin)
|
pad.link(decodebin.get_static_pad('sink'))
|
||||||
|
|
||||||
def start_pipeline(self, create_offer=True, opus_pt=96, vp8_pt=97):
|
def start_pipeline(self, create_offer=True, opus_pt=96, vp8_pt=97):
|
||||||
print_status(f'Creating pipeline, create_offer: {create_offer}')
|
print_status(f'Creating pipeline, create_offer: {create_offer}')
|
||||||
|
|
Loading…
Reference in a new issue