Remove dead code

This commit is contained in:
Wanjohi
2024-01-01 15:10:20 +03:00
parent 22d2641d8b
commit e410eb2529
2 changed files with 5 additions and 13 deletions

View File

@@ -60,7 +60,7 @@ async fn main() -> anyhow::Result<()> {
tokio::select! { tokio::select! {
res = session.run() => res.context("session error")?, res = session.run() => res.context("session error")?,
res = media::GST::run(url, publisher) => res.context("media error")?, res = GST::run(publisher) => res.context("media error")?,
} }
Ok(()) Ok(())

View File

@@ -97,12 +97,10 @@ struct State {
fragment_offset_end: Option<u64>, fragment_offset_end: Option<u64>,
fragment_buffer_flags: gst::BufferFlags, fragment_buffer_flags: gst::BufferFlags,
url: Option<Url>,
bitrate: u64, bitrate: u64,
width: u64, width: u64,
height: u64, height: u64,
wave: String, // wave: String,
video_enc: Option<String>,
mp4_parser: Mp4Parser, mp4_parser: Mp4Parser,
// We hold on to publisher so we don't close then while media is still being published. // We hold on to publisher so we don't close then while media is still being published.
@@ -118,7 +116,7 @@ struct State {
pub struct GST {} pub struct GST {}
impl GST { impl GST {
pub async fn run(url: Url, mut broadcast: broadcast::Publisher) -> anyhow::Result<()> { pub async fn run(mut broadcast: broadcast::Publisher) -> anyhow::Result<()> {
gst::init()?; gst::init()?;
//FIXME: Get this value from commandline argument //FIXME: Get this value from commandline argument
@@ -136,14 +134,12 @@ impl GST {
fragment_offset: None, fragment_offset: None,
fragment_offset_end: None, fragment_offset_end: None,
fragment_buffer_flags: gst::BufferFlags::DELTA_UNIT, fragment_buffer_flags: gst::BufferFlags::DELTA_UNIT,
url: Some(url),
bitrate: 2_048_000, bitrate: 2_048_000,
width: 1280, width: 1280,
height: 720, height: 720,
wave: "sine".to_string(),
broadcast: broadcast.to_owned(), broadcast: broadcast.to_owned(),
mp4_parser: Mp4Parser::new(), mp4_parser: Mp4Parser::new(),
video_enc: None, // wave: "sine".to_string(),
catalog: None, catalog: None,
init: None, init: None,
@@ -152,7 +148,7 @@ impl GST {
current: None, current: None,
})); }));
let mut state_lock = state.lock().unwrap(); let state_lock = state.lock().unwrap();
let video_src = gst::ElementFactory::make("videotestsrc") let video_src = gst::ElementFactory::make("videotestsrc")
.property("is-live", true) .property("is-live", true)
@@ -226,10 +222,6 @@ impl GST {
appsink.upcast_ref(), appsink.upcast_ref(),
])?; ])?;
// let video_encoder = probe_encoder(video_enc);
// state_lock.video_enc = Some(video_encoder);
//drop the choke hold here //drop the choke hold here
drop(state_lock); drop(state_lock);