Compare commits

..

No commits in common. "f69f7c7eb1ee2dd8257e010dbec079cd0cf4ad84" and "5bb5ff98bba412d4e459c2daf81739a11b15b0f8" have entirely different histories.

9 changed files with 17 additions and 3837 deletions

3637
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,21 +1,3 @@
[package]
name = "vcs-camera-satellite"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = "1.0.86"
config = "0.14.0"
gst-plugin-webrtc = "0.13.0"
gstreamer = { version = "0.23.0", features = ["v1_22"] }
gstreamer-sdp = { version = "0.23.0", features = ["v1_22"] }
gstreamer-webrtc = { version = "0.23.0", features = ["v1_22"] }
log = "0.4.22"
serde = { version = "1.0.204", features = ["derive"] }
serde_json = "1.0.122"
tokio = "1.39.2"
tokio-tungstenite = "0.23.1"
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
[workspace]
members = ["helloworld"]
resolver = "2"

View file

@ -1,62 +0,0 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1722421184,
"narHash": "sha256-/DJBI6trCeVnasdjUo9pbnodCLZcFqnVZiLUfqLH4jA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9f918d616c5321ad374ae6cb5ea89c9e04bf3e58",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1718428119,
"narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1722651535,
"narHash": "sha256-2uRmNwxe3CO5h7PfvqXrRe8OplXaEdwhqOUtaF13rpU=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "56d83ca6f3c557647476f3720426a7615c22b860",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View file

@ -34,15 +34,8 @@ Some utility commands:
};
rustSettings = with pkgs; {
src = ./.;
nativeBuildInputs = [ pkg-config ];
buildInputs = [
openssl
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-bad # contains gstreamer-webrtc-1.0
gst_all_1.gst-plugins-rs
];
#nativeBuildInputs = [ pkg-config ];
#buildInputs = [ openssl ];
cargoHash = nixpkgs.lib.fakeHash;
};
meta = with nixpkgs.lib; {

8
helloworld/Cargo.toml Normal file
View file

@ -0,0 +1,8 @@
[package]
name = "helloworld"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

3
helloworld/src/main.rs Normal file
View file

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

View file

@ -1,41 +0,0 @@
mod signaller;
// from outside the plugin repository, one would need to add plugin package as follows:
// [dependencies]
// gstrswebrtc = { package = "gst-plugin-webrtc", git = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/" }
use gstrswebrtc;
use anyhow::Error;
use gstreamer::prelude::*;
use gstrswebrtc::signaller as signaller_interface;
use gstrswebrtc::webrtcsink;
fn main() -> Result<(), Error> {
gstreamer::init()?;
let custom_signaller = signaller::MyCustomSignaller::new();
let webrtcsink = webrtcsink::BaseWebRTCSink::with_signaller(
signaller_interface::Signallable::from(custom_signaller),
);
let pipeline = gstreamer::Pipeline::new();
let video_src = gstreamer::ElementFactory::make("videotestsrc").build().unwrap();
pipeline
.add_many([&video_src, webrtcsink.upcast_ref()])
.unwrap();
video_src
.link(webrtcsink.upcast_ref::<gstreamer::Element>())
.unwrap();
let bus = pipeline.bus().unwrap();
pipeline.set_state(gstreamer::State::Playing).unwrap();
let _msg = bus.timed_pop_filtered(gstreamer::ClockTime::NONE, &[gstreamer::MessageType::Eos]);
pipeline.set_state(gstreamer::State::Null).unwrap();
Ok(())
}

View file

@ -1,48 +0,0 @@
use gstreamer::glib;
use gstreamer::subclass::prelude::*;
use gstreamer_webrtc::WebRTCSessionDescription;
use gstrswebrtc::signaller::{Signallable, SignallableImpl};
#[derive(Default)]
pub struct Signaller {}
impl Signaller {}
impl SignallableImpl for Signaller {
fn start(&self) {
unimplemented!()
}
fn stop(&self) {
unimplemented!()
}
fn send_sdp(&self, _session_id: &str, _sdp: &WebRTCSessionDescription) {
unimplemented!()
}
fn add_ice(
&self,
_session_id: &str,
_candidate: &str,
_sdp_m_line_index: u32,
_sdp_mid: Option<String>,
) {
unimplemented!()
}
fn end_session(&self, _session_id: &str) {
unimplemented!()
}
}
#[glib::object_subclass]
impl ObjectSubclass for Signaller {
const NAME: &'static str = "MyCustomWebRTCSinkSignaller";
type Type = super::MyCustomSignaller;
type ParentType = glib::Object;
type Interfaces = (Signallable,);
}
impl ObjectImpl for Signaller {}

View file

@ -1,20 +0,0 @@
use gstreamer::glib;
use gstrswebrtc::signaller::Signallable;
mod imp;
glib::wrapper! {
pub struct MyCustomSignaller(ObjectSubclass<imp::Signaller>) @implements Signallable;
}
impl MyCustomSignaller {
pub fn new() -> Self {
glib::Object::new()
}
}
impl Default for MyCustomSignaller {
fn default() -> Self {
MyCustomSignaller::new()
}
}