mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-15 23:01:02 +00:00
webrtc: conditional compile for features with 1_22 dependency
Few features being used in webrtcsink like the signal `request-aux-sender` are introduced to webrtcbin in gstreamer release 1.22. Rename the feature gst1_22 to v1_22 for uniformity. Add v1_22 to default features. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
This commit is contained in:
parent
58c22120c2
commit
9fcd63222d
2 changed files with 14 additions and 4 deletions
|
@ -69,9 +69,10 @@ path = "src/lib.rs"
|
||||||
gst-plugin-version-helper = { path = "../../version-helper", version = "0.8" }
|
gst-plugin-version-helper = { path = "../../version-helper", version = "0.8" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
default = ["v1_22"]
|
||||||
static = []
|
static = []
|
||||||
capi = []
|
capi = []
|
||||||
gst1_22 = ["gst/v1_22", "gst-app/v1_22", "gst-video/v1_22", "gst-webrtc/v1_22", "gst-sdp/v1_22", "gst-rtp/v1_22"]
|
v1_22 = ["gst/v1_22", "gst-app/v1_22", "gst-video/v1_22", "gst-webrtc/v1_22", "gst-sdp/v1_22", "gst-rtp/v1_22"]
|
||||||
doc = []
|
doc = []
|
||||||
|
|
||||||
[package.metadata.capi]
|
[package.metadata.capi]
|
||||||
|
|
|
@ -51,8 +51,11 @@ const DEFAULT_MIN_BITRATE: u32 = 1000;
|
||||||
* my local network, possibly related to chrome's pretty low UDP
|
* my local network, possibly related to chrome's pretty low UDP
|
||||||
* buffer sizes */
|
* buffer sizes */
|
||||||
const DEFAULT_MAX_BITRATE: u32 = 8192000;
|
const DEFAULT_MAX_BITRATE: u32 = 8192000;
|
||||||
const DEFAULT_CONGESTION_CONTROL: WebRTCSinkCongestionControl =
|
const DEFAULT_CONGESTION_CONTROL: WebRTCSinkCongestionControl = if cfg!(feature = "v1_22") {
|
||||||
WebRTCSinkCongestionControl::GoogleCongestionControl;
|
WebRTCSinkCongestionControl::GoogleCongestionControl
|
||||||
|
} else {
|
||||||
|
WebRTCSinkCongestionControl::Disabled
|
||||||
|
};
|
||||||
const DEFAULT_DO_FEC: bool = true;
|
const DEFAULT_DO_FEC: bool = true;
|
||||||
const DEFAULT_DO_RETRANSMISSION: bool = true;
|
const DEFAULT_DO_RETRANSMISSION: bool = true;
|
||||||
const DEFAULT_ENABLE_DATA_CHANNEL_NAVIGATION: bool = false;
|
const DEFAULT_ENABLE_DATA_CHANNEL_NAVIGATION: bool = false;
|
||||||
|
@ -60,6 +63,7 @@ const DEFAULT_ICE_TRANSPORT_POLICY: WebRTCICETransportPolicy = WebRTCICETranspor
|
||||||
const DEFAULT_START_BITRATE: u32 = 2048000;
|
const DEFAULT_START_BITRATE: u32 = 2048000;
|
||||||
/* Start adding some FEC when the bitrate > 2Mbps as we found experimentally
|
/* Start adding some FEC when the bitrate > 2Mbps as we found experimentally
|
||||||
* that it is not worth it below that threshold */
|
* that it is not worth it below that threshold */
|
||||||
|
#[cfg(feature = "v1_22")]
|
||||||
const DO_FEC_THRESHOLD: u32 = 2000000;
|
const DO_FEC_THRESHOLD: u32 = 2000000;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
|
@ -235,6 +239,7 @@ struct Session {
|
||||||
|
|
||||||
pipeline: gst::Pipeline,
|
pipeline: gst::Pipeline,
|
||||||
webrtcbin: gst::Element,
|
webrtcbin: gst::Element,
|
||||||
|
#[cfg(feature = "v1_22")]
|
||||||
rtprtxsend: Option<gst::Element>,
|
rtprtxsend: Option<gst::Element>,
|
||||||
webrtc_pads: HashMap<u32, WebRTCPad>,
|
webrtc_pads: HashMap<u32, WebRTCPad>,
|
||||||
peer_id: String,
|
peer_id: String,
|
||||||
|
@ -506,7 +511,7 @@ impl Default for Settings {
|
||||||
stun_server: DEFAULT_STUN_SERVER.map(String::from),
|
stun_server: DEFAULT_STUN_SERVER.map(String::from),
|
||||||
turn_servers: gst::Array::new(Vec::new() as Vec<glib::SendValue>),
|
turn_servers: gst::Array::new(Vec::new() as Vec<glib::SendValue>),
|
||||||
cc_info: CCInfo {
|
cc_info: CCInfo {
|
||||||
heuristic: WebRTCSinkCongestionControl::GoogleCongestionControl,
|
heuristic: DEFAULT_CONGESTION_CONTROL,
|
||||||
min_bitrate: DEFAULT_MIN_BITRATE,
|
min_bitrate: DEFAULT_MIN_BITRATE,
|
||||||
max_bitrate: DEFAULT_MAX_BITRATE,
|
max_bitrate: DEFAULT_MAX_BITRATE,
|
||||||
start_bitrate: DEFAULT_START_BITRATE,
|
start_bitrate: DEFAULT_START_BITRATE,
|
||||||
|
@ -1148,6 +1153,7 @@ impl Session {
|
||||||
webrtcbin,
|
webrtcbin,
|
||||||
peer_id,
|
peer_id,
|
||||||
cc_info,
|
cc_info,
|
||||||
|
#[cfg(feature = "v1_22")]
|
||||||
rtprtxsend: None,
|
rtprtxsend: None,
|
||||||
congestion_controller,
|
congestion_controller,
|
||||||
rtpgccbwe,
|
rtpgccbwe,
|
||||||
|
@ -2219,6 +2225,7 @@ impl BaseWebRTCSink {
|
||||||
}
|
}
|
||||||
|
|
||||||
let rtpgccbwe = match settings.cc_info.heuristic {
|
let rtpgccbwe = match settings.cc_info.heuristic {
|
||||||
|
#[cfg(feature = "v1_22")]
|
||||||
WebRTCSinkCongestionControl::GoogleCongestionControl => {
|
WebRTCSinkCongestionControl::GoogleCongestionControl => {
|
||||||
let rtpgccbwe = match gst::ElementFactory::make("rtpgccbwe").build() {
|
let rtpgccbwe = match gst::ElementFactory::make("rtpgccbwe").build() {
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
|
@ -2730,6 +2737,7 @@ impl BaseWebRTCSink {
|
||||||
webrtcbin.emit_by_name::<()>("get-stats", &[&None::<gst::Pad>, &promise]);
|
webrtcbin.emit_by_name::<()>("get-stats", &[&None::<gst::Pad>, &promise]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "v1_22")]
|
||||||
fn set_rtptrxsend(
|
fn set_rtptrxsend(
|
||||||
&self,
|
&self,
|
||||||
element: &super::BaseWebRTCSink,
|
element: &super::BaseWebRTCSink,
|
||||||
|
@ -2743,6 +2751,7 @@ impl BaseWebRTCSink {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "v1_22")]
|
||||||
fn set_bitrate(&self, element: &super::BaseWebRTCSink, session_id: &str, bitrate: u32) {
|
fn set_bitrate(&self, element: &super::BaseWebRTCSink, session_id: &str, bitrate: u32) {
|
||||||
let settings = element.imp().settings.lock().unwrap();
|
let settings = element.imp().settings.lock().unwrap();
|
||||||
let mut state = element.imp().state.lock().unwrap();
|
let mut state = element.imp().state.lock().unwrap();
|
||||||
|
|
Loading…
Reference in a new issue