Skip to main content

gstrswebrtc/
lib.rs

1// SPDX-License-Identifier: MPL-2.0
2#![allow(clippy::non_send_fields_in_send_ty, unused_doc_comments)]
3
4/**
5 * plugin-rswebrtc:
6 * @title: Rust WebRTC elements
7 * @short_description: A collection of high level WebRTC elements wrapping webrtcbin
8 *
9 * {{ net/webrtc/README.md[2:233] }}
10 *
11 * Since: plugins-rs-0.9
12 */
13use gst::glib;
14use std::sync::LazyLock;
15use tokio::runtime;
16
17#[cfg(feature = "aws")]
18mod aws_kvs_signaller;
19#[cfg(feature = "janus")]
20mod janusvr_signaller;
21#[cfg(feature = "livekit")]
22mod livekit_signaller;
23pub mod signaller;
24pub mod utils;
25pub mod webrtcsink;
26pub mod webrtcsrc;
27#[cfg(feature = "whep")]
28mod whep_signaller;
29#[cfg(feature = "whip")]
30mod whip_signaller;
31
32fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
33    webrtcsink::register(plugin)?;
34    webrtcsrc::register(Some(plugin))?;
35
36    Ok(())
37}
38
39gst::plugin_define!(
40    rswebrtc,
41    env!("CARGO_PKG_DESCRIPTION"),
42    plugin_init,
43    concat!(env!("CARGO_PKG_VERSION"), "-", env!("COMMIT_ID")),
44    "MPL-2.0",
45    env!("CARGO_PKG_NAME"),
46    env!("CARGO_PKG_NAME"),
47    env!("CARGO_PKG_REPOSITORY"),
48    env!("BUILD_REL_DATE")
49);
50
51pub static RUNTIME: LazyLock<runtime::Runtime> = LazyLock::new(|| {
52    runtime::Builder::new_multi_thread()
53        .enable_all()
54        .worker_threads(1)
55        .build()
56        .unwrap()
57});