Merge branch 'motion'
Conflicts: crates/core/src/bc_protocol.rs crates/core/src/bc_protocol/stream.rs src/rtsp/mod.rs
This commit is contained in:
11 files changed
+196
-29
No files matched your search
+2
-2
@@ -57,7 +57,7 @@ enum StreamFormat {
|
||||
}
|
||||
|
||||
impl StreamOutput for GstOutputs {
|
||||
fn write(&mut self, media: BcMedia) -> StreamOutputError {
|
||||
fn stream_recv(&mut self, media: BcMedia) -> StreamOutputError {
|
||||
match media {
|
||||
BcMedia::Iframe(payload) => {
|
||||
let video_type = match payload.video_type {
|
||||
@@ -88,7 +88,7 @@ impl StreamOutput for GstOutputs {
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
Ok(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-10
@@ -121,7 +121,7 @@ fn camera_loop(
|
||||
camera_config: &CameraConfig,
|
||||
end_points: Vec<(Stream, Arc<Mutex<GstOutputs>>)>,
|
||||
manage: bool,
|
||||
) -> Result<()> {
|
||||
) -> Result<(), anyhow::Error> {
|
||||
let min_backoff = Duration::from_secs(1);
|
||||
let max_backoff = Duration::from_secs(15);
|
||||
let mut current_backoff = min_backoff;
|
||||
@@ -143,16 +143,10 @@ fn camera_loop(
|
||||
);
|
||||
return Err(cam_err.err);
|
||||
} else {
|
||||
error!(
|
||||
"Error streaming from camera {}, will retry in {}s: {:?}",
|
||||
camera_config.name,
|
||||
current_backoff.as_secs(),
|
||||
cam_err.err
|
||||
)
|
||||
// Should not occur because we don't set the callback up
|
||||
// in such a way that it requests graceful shutdown
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
std::thread::sleep(current_backoff);
|
||||
current_backoff = std::cmp::min(max_backoff, current_backoff * 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user