gst-webrtcredux
gst-webrtcredux copied to clipboard
Receiver functionality (sometimes-SrcPad)
Hello
As mentioned in PR #4, I would like to use WebRtcRedux for a client implementation that receives video streams and pushes the rtp packets onto a Gst-Pipeline for further processing.
The WebRtcRedux element currently implements the "Sink"-pad. To accomodate the targeted flow, the GstPushSrc's sometimes-pad "src_%u" which exposes the incoming streams, would need to be implemented.
From my understanding, a GstPushSrc would be appropriate, as we are talking about a live-stream here.
Here is my attempt at doing so: https://github.com/tuxuser/gst-webrtcredux/commit/282b8e71542fddc337c28d7dc20ca394e9b1dff8 (having issues with lifetimes and code-design here (the burden of every new rust dev I guess :P))
Maybe to reproduce better, I implemented the desired output API by creating a vp8-client.
Its basically a clone of the h264-browser example:
- Takes the webcam/microphone stream from the browser and adds it to the PeerConnection
- Takes the SDP offer from CLI and generates its answer
- Answer is pasted back into the CLI and stream starts
Code is located here: https://github.com/tuxuser/gst-webrtcredux/tree/example/vp8_client/examples/vp8-client
Any help is ofc greatly appreciated :)
I think it's a good idea to add this functionality and you're on the right track, but there definitely needs to be some more work done on the code. From my cursory first look, the source pad template should split into audio and video to be consistent with the sink pad template, and the fill function needs to be implemented.
If you want you can take a look at my X11 capture plugin, it uses the same type of stuff with a complete implementation.