Skip to content

Commit

Permalink
Add initial version of NDI sink
Browse files Browse the repository at this point in the history
The sink can accept audio or video directly, or if both should be
provided at once it is necesary to use the ndisinkcombiner before the
ndisink to merge both audio and video into the same stream.

Fixes #10
  • Loading branch information
sdroege committed Feb 25, 2021
1 parent c6e5e69 commit b3c3981
Show file tree
Hide file tree
Showing 5 changed files with 1,155 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ once_cell = "1.0"
gst-plugin-version-helper = "0.2"

[features]
default = ["interlaced-fields", "reference-timestamps"]
default = ["interlaced-fields", "reference-timestamps", "sink"]
interlaced-fields = ["gst/v1_16", "gst-video/v1_16"]
reference-timestamps = ["gst/v1_14"]
sink = ["gst/v1_18", "gst-base/v1_18"]

[lib]
name = "gstndi"
Expand Down
14 changes: 13 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ use glib::prelude::*;
mod device_provider;
pub mod ndi;
mod ndiaudiosrc;
#[cfg(feature = "sink")]
mod ndisink;
#[cfg(feature = "sink")]
mod ndisinkcombiner;
#[cfg(feature = "sink")]
pub mod ndisinkmeta;
pub mod ndisys;
mod ndivideosrc;
pub mod receiver;
Expand Down Expand Up @@ -35,9 +41,15 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
return Err(glib::glib_bool_error!("Cannot initialize NDI"));
}

device_provider::register(plugin)?;

ndivideosrc::register(plugin)?;
ndiaudiosrc::register(plugin)?;
device_provider::register(plugin)?;
#[cfg(feature = "sink")]
{
ndisinkcombiner::register(plugin)?;
ndisink::register(plugin)?;
}
Ok(())
}

Expand Down
Loading

0 comments on commit b3c3981

Please sign in to comment.