Compare commits
No commits in common. "f69f7c7eb1ee2dd8257e010dbec079cd0cf4ad84" and "5bb5ff98bba412d4e459c2daf81739a11b15b0f8" have entirely different histories.
f69f7c7eb1
...
5bb5ff98bb
9 changed files with 17 additions and 3837 deletions
3637
Cargo.lock
generated
3637
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
24
Cargo.toml
24
Cargo.toml
|
@ -1,21 +1,3 @@
|
||||||
[package]
|
[workspace]
|
||||||
name = "vcs-camera-satellite"
|
members = ["helloworld"]
|
||||||
version = "0.1.0"
|
resolver = "2"
|
||||||
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"
|
|
||||||
|
|
62
flake.lock
62
flake.lock
|
@ -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
|
|
||||||
}
|
|
11
flake.nix
11
flake.nix
|
@ -34,15 +34,8 @@ Some utility commands:
|
||||||
};
|
};
|
||||||
rustSettings = with pkgs; {
|
rustSettings = with pkgs; {
|
||||||
src = ./.;
|
src = ./.;
|
||||||
nativeBuildInputs = [ pkg-config ];
|
#nativeBuildInputs = [ pkg-config ];
|
||||||
buildInputs = [
|
#buildInputs = [ openssl ];
|
||||||
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
|
|
||||||
];
|
|
||||||
cargoHash = nixpkgs.lib.fakeHash;
|
cargoHash = nixpkgs.lib.fakeHash;
|
||||||
};
|
};
|
||||||
meta = with nixpkgs.lib; {
|
meta = with nixpkgs.lib; {
|
||||||
|
|
8
helloworld/Cargo.toml
Normal file
8
helloworld/Cargo.toml
Normal 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
3
helloworld/src/main.rs
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
fn main() {
|
||||||
|
println!("Hello, world!");
|
||||||
|
}
|
41
src/main.rs
41
src/main.rs
|
@ -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(())
|
|
||||||
}
|
|
|
@ -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 {}
|
|
|
@ -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()
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue