This commit is contained in:
Nickiel12 2024-08-17 20:10:37 +00:00
parent cf4cf3feb9
commit 6ab27127bf
3 changed files with 23 additions and 8 deletions

6
Cargo.lock generated
View file

@ -2449,9 +2449,15 @@ dependencies = [
"toml", "toml",
"tracing", "tracing",
"tracing-subscriber", "tracing-subscriber",
"vcs-common",
"webrtc", "webrtc",
] ]
[[package]]
name = "vcs-common"
version = "0.1.0"
source = "git+https://git.nickiel.net/VCC/vcs-common.git?branch=main#898d5181e08ed7cbfef745bf9036eae71a08be52"
[[package]] [[package]]
name = "version-compare" name = "version-compare"
version = "0.2.0" version = "0.2.0"

View file

@ -22,3 +22,5 @@ toml = "0.8.19"
tracing = "0.1.40" tracing = "0.1.40"
tracing-subscriber = "0.3.18" tracing-subscriber = "0.3.18"
webrtc = "0.11.0" webrtc = "0.11.0"
vcs-common = { git = "https://git.nickiel.net/VCC/vcs-common.git", branch = "main" }

View file

@ -2,12 +2,8 @@ use std::sync::{atomic::AtomicBool, Arc};
use anyhow::Error; use anyhow::Error;
use gstreamer::{prelude::*, Element, ElementFactory, Pipeline, State}; use gstreamer::{prelude::*, Element, ElementFactory, Pipeline, State};
use gstrswebrtc::{signaller::Signallable, webrtcsink};
mod config; mod config;
mod signaller;
use signaller::{SignallerEvent, SENDER_CHANNEL};
fn main() -> Result<(), Error> { fn main() -> Result<(), Error> {
// TRACING SETUP // TRACING SETUP
@ -18,10 +14,6 @@ fn main() -> Result<(), Error> {
let config = config::load_config(); let config = config::load_config();
let (sender, receiver) = std::sync::mpsc::channel::<SignallerEvent>();
*SENDER_CHANNEL.lock().unwrap() = Some(sender.clone());
// EXIT HANDLER // EXIT HANDLER
let to_quit = Arc::new(AtomicBool::new(false)); let to_quit = Arc::new(AtomicBool::new(false));
let to_quit_2 = to_quit.clone(); let to_quit_2 = to_quit.clone();
@ -32,6 +24,7 @@ fn main() -> Result<(), Error> {
// GSTREAMER SETUP // GSTREAMER SETUP
gstreamer::init()?; gstreamer::init()?;
<<<<<<< HEAD
gstrswebrtc::plugin_register_static()?; gstrswebrtc::plugin_register_static()?;
gstrsrtp::plugin_register_static()?; gstrsrtp::plugin_register_static()?;
@ -82,6 +75,20 @@ fn main() -> Result<(), Error> {
gstreamer::ClockTime::NONE, gstreamer::ClockTime::NONE,
&[gstreamer::MessageType::Eos] &[gstreamer::MessageType::Eos]
); );
=======
loop {
if to_quit.load(std::sync::atomic::Ordering::SeqCst) {
println!("Recieved Ctrl+C, stopping");
break;
}
std::thread::sleep(std::time::Duration::from_millis(200));
}
>>>>>>> 29a8ccf (added vcs-common)
println!("Success!"); println!("Success!");