gst-plugins-rs/net/webrtc/src
François Laignel 542030fd82 webrtcsink: don't panic if input CAPS are not supported
If a user constrained the supported CAPS, for instance using `video-caps`:

```shell
gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! x264enc \
    ! webrtcsink video-caps=video/x-vp8
```

... a panic would occur which was internally caught without the user being
informed except for the following message which was written to stderr:

> thread 'tokio-runtime-worker' panicked at net/webrtc/src/webrtcsink/imp.rs:3533:22:
>   expected audio or video raw caps: video/x-h264, [...] <br>
> note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The pipeline kept running.

This commit converts the panic into an `Error` which bubbles up as an element
`StreamError::CodecNotFound` which can be handled by the application.
With the above `gst-launch`, this terminates the pipeline with:

> [...] ERROR  webrtcsink net/webrtc/src/webrtcsink/imp.rs:3771:gstrswebrtc::
>   webrtcsink:👿:BaseWebRTCSink::start_stream_discovery_if_needed::{{closure}}:<webrtcsink0>
> Error running discovery: Unsupported caps: video/x-h264, [...] <br>
> ERROR: from element /GstPipeline:pipeline0/GstWebRTCSink:webrtcsink0:
>   There is no codec present that can handle the stream's type. <br>
> Additional debug info: <br>
> net/webrtc/src/webrtcsink/imp.rs(3772): gstrswebrtc::webrtcsink:👿:BaseWebRTCSink::
> start_stream_discovery_if_needed::{{closure}} (): /GstPipeline:pipeline0/GstWebRTCSink:webrtcsink0:
> Failed to look up output caps: Unsupported caps: video/x-h264, [...] <br>
> Execution ended after 0:00:00.055716661 <br>
> Setting pipeline to NULL ...

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1540>
2024-04-14 23:09:09 +02:00
..
aws_kvs_signaller aws: use fixed BehaviorVersion 2024-03-26 17:44:16 +01:00
janusvr_signaller webrtc: janus: handle 'hangup' messages from Janus 2024-03-13 10:14:38 +00:00
livekit_signaller livekit_signaller: Added missing getter for excluded-producer-peer-ids 2024-03-04 10:08:11 -07:00
signaller Update for GLib prelude re-organization 2024-02-03 12:30:15 +02:00
webrtcsink webrtcsink: don't panic if input CAPS are not supported 2024-04-14 23:09:09 +02:00
webrtcsrc webrtc: add features for specific signallers 2024-04-12 19:10:42 +02:00
whip_signaller webrtc: update further to WebRTCSessionDescription sdp accessor changes 2024-03-11 13:39:19 +01:00
lib.rs webrtc: add features for specific signallers 2024-04-12 19:10:42 +02:00
utils.rs webrtc: add features for specific signallers 2024-04-12 19:10:42 +02:00