Commit graph

70 commits

Author SHA1 Message Date
Nirbheek Chauhan 5500c228f6 webrtc_sendrecv.py: Add bus message handling
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3742>
2023-01-25 16:53:17 +00:00
Nirbheek Chauhan 9b2404e76d webrtc_sendrecv.py: Add support for using H264 encoding
Currently only works when we are creating the offer or the offer only
contains H264.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3742>
2023-01-25 16:53:17 +00:00
Nirbheek Chauhan 6f99faa080 webrtc_sendrecv.py: Use sine wave for audio instead of red-noise
Makes it easier to notice when there's packet loss or other audio
distortion.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3742>
2023-01-25 16:53:17 +00:00
Sebastian Dröge 4e86c77270 examples: webrtc: rust: Update dependencies
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3758>
2023-01-20 11:36:57 +00:00
Sebastian Dröge f45136827b examples: webrtc: multiparty-sendrecv: rust: Remove unnecessary macro recursion limit annotation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3758>
2023-01-20 11:36:57 +00:00
Sebastian Dröge bf4a3c89cd examples: webrtc: sendrecv: rust: Implement OFFER_REQUEST handling
Allow requesting an offer from the peer if we're joining a call with a
peer, and allow the peer to request an offer from us if waiting for an
incoming call.

This implements all 4 variants the protocol allows for.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3758>
2023-01-20 11:36:57 +00:00
Sebastian Dröge 638465908e examples: webrtc: sendrecv: rust: Allow providing our ID via the commandline
Otherwise it continues to use a random ID as before.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3758>
2023-01-20 11:36:57 +00:00
Sebastian Dröge 541c637910 examples: webrtc: sendrecv: rust: Implement TWCC support in both directions
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3758>
2023-01-20 11:36:57 +00:00
Sebastian Dröge 6541dccaea examples: webrtc: rust: Set keyframe-max-dist=2000 and picture-id-mode=15-bit for VP8 and perfect-timestamps=true for audio
This makes it in sync with the C sendrecv and generally behaves better.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3758>
2023-01-20 11:36:57 +00:00
Sebastian Dröge 083b9f2a6e examples: webrtc: sendrecv: rust: Use the correct payload types if the remote is the offerer
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3758>
2023-01-20 11:36:57 +00:00
Sebastian Dröge ac1d10f80c gst-examples: Update Rust dependencies
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3750>
2023-01-19 10:40:32 +02:00
Sebastian Dröge 085e6c036a android: Update minimum SDK version to Android 21
Otherwise we can't bump the minimum version of the cerbero build without
it breaking linking of the applications.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3717>
2023-01-12 20:11:14 +00:00
Olivier Crête b7c0e8bc84 webrtc examples: Force regular non-MULTIOPUS
Using MULTIOPUS breaks with most browsers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3675>
2023-01-04 12:02:25 +00:00
Olivier Crête c7bc6bc064 webrtc-unidirectional: Avoid critical
Don't unref the parameter passed to a signal, it's always owned by
the caller. Fixes a GLib critical.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3675>
2023-01-04 12:02:25 +00:00
Sebastian Dröge c739fcbe41 examples: webrtc: Add handling of the LATENCY messages to the Rust examples
Without this the configured latency on the pipeline will be wrong.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3609>
2022-12-20 13:10:27 +02:00
Sebastian Dröge 284d22437e examples: webrtc: Update dependencies
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3609>
2022-12-20 13:06:43 +02:00
Sebastian Dröge ec6290d63f examples: webrtc: Remove the bus watch at the end
Otherwise a file descriptor will be leaked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3609>
2022-12-20 13:03:44 +02:00
Sebastian Dröge 1f4f338d85 examples: webrtc: Add handling of the LATENCY messages to the C examples
Without this the configured latency on the pipeline will be wrong.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3609>
2022-12-20 13:03:15 +02:00
Sebastian Dröge d10981f7b9 examples: webrtc: Add bus handling to the Android and C sendrecv examples
Without a bus, messages will just pile up and errors are not handled at
all. Also without handling the LATENCY messages the latency configured
on the pipeline will be wrong.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3609>
2022-12-20 13:02:08 +02:00
Seungmin Kim 0db1ff532d Change GstSdp.sdp_message_parse_buffer to GstSdp.SDPMessage.new_from_text in examples
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3477>
2022-12-16 10:40:41 +00:00
Nirbheek Chauhan 7fd8e4001c webrtc/signalling: Give a helpful error when starting a double-session
If the peer is already in a session and tries to start a new one, give
them a helpful error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2460>
2022-12-12 15:08:23 +00:00
byran77 1e5abde7b1 gst-examples: webrtc: signalling: simple-server Fix condition when calling a busy peer
When a session request is coming in, ERROR occurs when the callee is busy.
But peer_status is the status of the caller, which is of course None when
calling someone, while self.peers[callee_id][2] is that of the callee.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2460>
2022-12-12 15:08:23 +00:00
Guillaume Desmottes cbab7ffefb examples: webrtc: fix unidirectional pipeline
'autoaudiosrc' does not have a 'is-live' property.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3550>
2022-12-09 13:49:44 +01:00
Guillaume Desmottes ebfbdf9076 examples: webrtc: fix plugins check
`videoconvert` and `videoscale` are now part of the `videoconvertscale`
plugin, see d11f13f476

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3529>
2022-12-05 17:04:57 +00:00
Jan Schmidt 8177588250 examples/sendrecv: Remove extra unref of webrtcbin
The code now constructs webrtcbin with a floating ref and then
gives it to the pipeline. The extra unref is one too many.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3436>
2022-11-19 19:51:54 +11:00
Jan Schmidt f2ae481a69 examples/webrtc: Configure payload types
MR 2398 broke the webrtc sendrecv example
by not configuring the payload types, so both audio and video streams
get sent on payload 96.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3434>
2022-11-19 13:12:58 +11:00
Nicolas Dufresne 4fb9f2a2b4 meson: Fix path for webrtc validate tests
This fixes a crash when trying to run gst-validate-launcher from inside
the meson devenv. The error was:

  ModuleNotFoundError: No module named 'observer'

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3273>
2022-10-26 18:16:25 +00:00
Patrick Griffis 2a59e8af97 webrtc: Fix double free in webrtc-recvonly-h264 demo
The "message" signal does not transfer ownership of the GBytes passed
to it so calling g_bytes_unref() on it is incorrect.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3257>
2022-10-24 22:16:44 +00:00
Sebastian Dröge 7193a601b3 examples: webrtc: Update to gstreamer-rs 0.19 release
Also update the macOS workaround for gstreamer-gl requiring a
`NSRunLoop` / `NSApp` on the main thread, and update from strucopt to
clap 4.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3255>
2022-10-24 11:50:09 +00:00
Patrick Griffis d0e2b31470 webrtc: Fix critical in webrtc-recvonly-h264 example
This signal only takes 2 properties yet a third was passed.
This would cause a critical in GLib.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3252>
2022-10-23 22:51:28 +00:00
Sam Van Den Berge 094b251901 examples: webrtc: mp-sendrecv: add bus handler
Without this bus handler, messages posted to the bus will keep a ref to
their source elements, preventing them from being disposed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3219>
2022-10-19 00:51:44 +00:00
Sam Van Den Berge 93ed51cbb2 examples: webrtc: mp-sendrecv: set element states to NULL after removing them from pipeline
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3219>
2022-10-19 00:51:44 +00:00
Sam Van Den Berge 17c111d2b9 examples: webrtc: mp-sendrecv: remove wrong gst_object_unrefs
In !2958 some gst_object_unrefs were added. However these two don't
belong there because ownership is transfered due to the gst_bin_add_many
call a bit above.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3219>
2022-10-19 00:51:44 +00:00
Sebastian Dröge 64c376b5b2 webrtc: Add/fix various annotations
And mark string parameters as const.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>
2022-10-18 08:56:58 +00:00
Matthew Waters d586c2cc28 examples/webrtc: don't use factory_make_full() for enums
They are not currently translated into their respective enum values and
will produce an error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3210>
2022-10-18 01:30:37 +00:00
Sam Van Den Berge 07d8e53aac examples/webrtc/signalling: Fix compatibility with Python 3.10
Fix asyncio throwing a deprecation warning when using
asyncio.get_event_loop().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3196>
2022-10-17 11:46:51 +02:00
Nirbheek Chauhan 6a3319c8f2 examples: Support multiple video streams in JS webrtc sendrecv
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3079>
2022-09-27 19:48:56 +00:00
Stéphane Cerveau 0c96e838e8 docs: update to mono repo locations
Some links/repos in the documentation were still pointing to old
repositories, change to mono repository

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2982>
2022-09-06 14:20:49 +02:00
Sebastian Dröge ad6ba10ae3 examples: webrtc: mp-sendrecv: Add missing semicolon
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2961>
2022-08-31 10:57:39 +03:00
Alireza Miryazdi eab9383812 examples/webrtc: add some missing unrefs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2958>
2022-08-31 05:07:52 +04:30
yatinmaan 2c1e61ea16 webrtc: Split WebRTCICE into base classes and implementation.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2398>
2022-07-26 13:51:11 +00:00
Matthew Waters b06a97c429 examples/webrtc/signalling: Fix compatibility with Python 3.10
- ssl module requires an explicit TLS_SERVER role
- asyncio throws a deprecation warning when using
  asyncio.get_event_loop().  Remove custom event loop handling entirely
- No need to keep the websocket server in a member variable, can use
  a future to signal exit case along with the async with context manager
  of websockets.serve()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2698>
2022-07-04 03:17:15 +00:00
Stéphane Cerveau a5cd1adc97 gst-examples: continue if webrtc deps are not satisfied
The WebRTC examples are disabled if one dependency is
not satisfied, especially libsoup.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2261>
2022-05-14 09:49:33 +00:00
Sebastian Dröge d2ecce5862 webrtc: Update dependencies of the Rust examples
And also clean up code a bit while updating to new APIs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2016>
2022-03-24 12:05:29 +02:00
Nirbheek Chauhan 4ae903d383 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>
2022-03-23 21:04:39 +00:00
Nirbheek Chauhan 0007fa38e0 webrtc-sendrecv: Fix create-answer caps negotiation
We need to parse the payload type map provided by the offer SDP and
set those values on the payloader, otherwise webrtcbin will create
a recvonly answer SDP and we won't send anything to the browser.

Fixed it for both C and Python sendrecv examples.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1864>
2022-03-18 08:16:46 +00:00
Nirbheek Chauhan 3c0d582b7c webrtc_sendrecv.py: Add picture-id-mode to rtpvp8pay
This doesn't just make TWCC stats perform better, it also fixes
stuttery video playback in Chrome.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1864>
2022-03-18 08:16:46 +00:00
Nirbheek Chauhan e0378f9913 webrtc_sendrecv.py: Print an error on unknown JSON message
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1864>
2022-03-18 08:16:46 +00:00
Nirbheek Chauhan 90da0e1d1e webrtc_sendrecv.py: Add missing copyright headers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1864>
2022-03-18 08:16:46 +00:00
Nirbheek Chauhan 583408c312 webrtc_sendrecv.py: Implement all negotiation modes
Earlier, the example only supported one negotiation mode:
* Browser client is running, gstreamer starts a call and sends offer

Now these three modes are also supported:
* Browser client is running, gstreamer starts a call and sends an
  offer request
* gstreamer connects and waits for browser client to start a call and
  send an offer
* gstreamer connects and waits for browser client to start a call and
  send an offer request

The following features are still missing:
* Data channel support
* TWCC support + stats logging

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1864>
2022-03-18 08:16:46 +00:00