From de6d2e7f407ac0070ba844f81eeb99857b94a1ec Mon Sep 17 00:00:00 2001 From: Taruntej Kanakamalla Date: Wed, 16 Aug 2023 12:18:04 +0530 Subject: [PATCH] net/webrtc: rename whipwebrtcsink as whipclientsink add a deprecation warning in whipsink to indicate it should be used only for RTP content add documentation in whipsink code regarding usage and deprecation Part-of: --- docs/plugins/gst_plugins_cache.json | 6 +++--- net/webrtc/src/webrtcsink/imp.rs | 2 +- net/webrtc/src/webrtcsink/mod.rs | 2 +- net/webrtchttp/src/whipsink/imp.rs | 5 ++++- net/webrtchttp/src/whipsink/mod.rs | 17 +++++++++++++++++ 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/docs/plugins/gst_plugins_cache.json b/docs/plugins/gst_plugins_cache.json index a05532aa..920ab09c 100644 --- a/docs/plugins/gst_plugins_cache.json +++ b/docs/plugins/gst_plugins_cache.json @@ -6391,9 +6391,9 @@ } } }, - "whipwebrtcsink": { + "whipclientsink": { "author": "Taruntej Kanakamalla ", - "description": "WebRTC sink with WHIP signaller", + "description": "WebRTC sink with WHIP client signaller", "hierarchy": [ "GstWhipWebRTCSink", "GstBaseWebRTCSink", @@ -8977,7 +8977,7 @@ }, "whipsink": { "author": "Taruntej Kanakamalla ", - "description": "A bin to stream media using the WebRTC HTTP Ingestion Protocol (WHIP)", + "description": "A bin to stream RTP media using the WebRTC HTTP Ingestion Protocol (WHIP)", "hierarchy": [ "GstWhipSink", "GstBin", diff --git a/net/webrtc/src/webrtcsink/imp.rs b/net/webrtc/src/webrtcsink/imp.rs index 52cdfa13..ddb56590 100644 --- a/net/webrtc/src/webrtcsink/imp.rs +++ b/net/webrtc/src/webrtcsink/imp.rs @@ -3887,7 +3887,7 @@ impl ElementImpl for WhipWebRTCSink { gst::subclass::ElementMetadata::new( "WhipWebRTCSink", "Sink/Network/WebRTC", - "WebRTC sink with WHIP signaller", + "WebRTC sink with WHIP client signaller", "Taruntej Kanakamalla ", ) }); diff --git a/net/webrtc/src/webrtcsink/mod.rs b/net/webrtc/src/webrtcsink/mod.rs index 66f3fb81..9f5c9f19 100644 --- a/net/webrtc/src/webrtcsink/mod.rs +++ b/net/webrtc/src/webrtcsink/mod.rs @@ -136,7 +136,7 @@ pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { )?; gst::Element::register( Some(plugin), - "whipwebrtcsink", + "whipclientsink", gst::Rank::None, WhipWebRTCSink::static_type(), )?; diff --git a/net/webrtchttp/src/whipsink/imp.rs b/net/webrtchttp/src/whipsink/imp.rs index 34f7914d..bfae01a0 100644 --- a/net/webrtchttp/src/whipsink/imp.rs +++ b/net/webrtchttp/src/whipsink/imp.rs @@ -104,7 +104,7 @@ impl ElementImpl for WhipSink { gst::subclass::ElementMetadata::new( "WHIP Sink Bin", "Sink/Network/WebRTC", - "A bin to stream media using the WebRTC HTTP Ingestion Protocol (WHIP)", + "A bin to stream RTP media using the WebRTC HTTP Ingestion Protocol (WHIP)", "Taruntej Kanakamalla ", ) }); @@ -343,6 +343,9 @@ impl ObjectImpl for WhipSink { obj.set_suppressed_flags(gst::ElementFlags::SINK | gst::ElementFlags::SOURCE); obj.set_element_flags(gst::ElementFlags::SINK); + gst::warning!(CAT, imp: self, "whipsink will be deprecated in the future, \ + it is recommended that whipclientsink be used instead"); + // The spec requires all m= lines to be bundled (section 4.2) self.webrtcbin .set_property("bundle-policy", gst_webrtc::WebRTCBundlePolicy::MaxBundle); diff --git a/net/webrtchttp/src/whipsink/mod.rs b/net/webrtchttp/src/whipsink/mod.rs index e307caf7..3e02e034 100644 --- a/net/webrtchttp/src/whipsink/mod.rs +++ b/net/webrtchttp/src/whipsink/mod.rs @@ -7,6 +7,23 @@ // // SPDX-License-Identifier: MPL-2.0 +/** + * SECTION:element-whipsink + * + * `whipsink` is an element that acts a WHIP Client to ingest RTP content to a media server + * + * ``` bash + * gst-launch-1.0 videotestsrc ! videoconvert ! openh264enc ! rtph264pay ! \ + * 'application/x-rtp,media=video,encoding-name=H264,payload=97,clock-rate=90000' ! \ + * whip.sink_0 audiotestsrc ! audioconvert ! opusenc ! rtpopuspay ! \ + * 'application/x-rtp,media=audio,encoding-name=OPUS,payload=96,clock-rate=48000,encoding-params=(string)2' ! \ + * whip.sink_1 whipsink name=whip auth-token=$WHIP_TOKEN whip-endpoint=$WHIP_ENDPOINT + * ``` + * + * Note: whipsink will be deprecated in the future. It is replaced by whipclientsink, + * which provides more features such as managing encoding and performing bandwidth adaptation + * + */ use gst::glib; use gst::prelude::*;