-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src: stream: Add TCP endpoint support for RTP payloads.
- Loading branch information
1 parent
d35f7c7
commit 12bbaf5
Showing
6 changed files
with
92 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
use super::{ | ||
gst::pipeline_builder::Pipeline, gst::pipeline_runner::PipelineRunner, | ||
stream_backend::StreamBackend, | ||
}; | ||
|
||
#[derive(Debug)] | ||
#[allow(dead_code)] | ||
pub struct VideoStreamTcp { | ||
pipeline_runner: PipelineRunner, | ||
} | ||
|
||
impl VideoStreamTcp { | ||
pub fn new( | ||
video_and_stream_information: &crate::video_stream::types::VideoAndStreamInformation, | ||
) -> Result<Self, simple_error::SimpleError> { | ||
Ok(VideoStreamTcp { | ||
pipeline_runner: PipelineRunner::new(Pipeline::new(video_and_stream_information)?), | ||
}) | ||
} | ||
} | ||
|
||
impl Drop for VideoStreamTcp { | ||
fn drop(&mut self) { | ||
self.stop(); | ||
} | ||
} | ||
|
||
impl StreamBackend for VideoStreamTcp { | ||
fn start(&mut self) -> bool { | ||
self.pipeline_runner.start() | ||
} | ||
|
||
fn stop(&mut self) -> bool { | ||
self.pipeline_runner.stop() | ||
} | ||
|
||
fn restart(&mut self) { | ||
self.pipeline_runner.restart() | ||
} | ||
|
||
fn is_running(&self) -> bool { | ||
self.pipeline_runner.is_running() | ||
} | ||
|
||
fn pipeline(&self) -> String { | ||
self.pipeline_runner.pipeline() | ||
} | ||
|
||
fn allow_same_endpoints(&self) -> bool { | ||
false | ||
} | ||
} |