support --rtsp-library=retina (#37)

This isn't well-tested and doesn't yet support an initial connection
timeout. But in a quick test, it successfully returns video!

I'd like to do some more aggressive code restructuring for zero-copy
and to have only one writer thread per sample file directory (rather
than the syncer thread + one writer thread per RTSP stream). But I'll
likely wait until I drop support for ffmpeg entirely.
This commit is contained in:
Scott Lamb
2021-06-07 14:36:53 -07:00
parent 7699696bd9
commit 032bd76577
10 changed files with 582 additions and 200 deletions

View File

@@ -350,8 +350,8 @@ pub struct Camera {
pub short_name: String,
pub description: String,
pub onvif_host: String,
pub username: String,
pub password: String,
pub username: Option<String>,
pub password: Option<String>,
pub streams: [Option<i32>; 2],
}
@@ -500,8 +500,8 @@ pub struct CameraChange {
pub short_name: String,
pub description: String,
pub onvif_host: String,
pub username: String,
pub password: String,
pub username: Option<String>,
pub password: Option<String>,
/// `StreamType t` is represented by `streams[t.index()]`. A default StreamChange will
/// correspond to no stream in the database, provided there are no existing recordings for that
@@ -2361,8 +2361,8 @@ mod tests {
camera_id = row.id;
assert_eq!(uuid, row.uuid);
assert_eq!("test-camera", row.onvif_host);
assert_eq!("foo", row.username);
assert_eq!("bar", row.password);
assert_eq!(Some("foo"), row.username.as_deref());
assert_eq!(Some("bar"), row.password.as_deref());
//assert_eq!("/main", row.main_rtsp_url);
//assert_eq!("/sub", row.sub_rtsp_url);
//assert_eq!(42, row.retain_bytes);
@@ -2513,8 +2513,8 @@ mod tests {
short_name: "testcam".to_owned(),
description: "".to_owned(),
onvif_host: "test-camera".to_owned(),
username: "foo".to_owned(),
password: "bar".to_owned(),
username: Some("foo".to_owned()),
password: Some("bar".to_owned()),
streams: [
StreamChange {
sample_file_dir_id: Some(sample_file_dir_id),

View File

@@ -84,8 +84,8 @@ impl<C: Clocks + Clone> TestDb<C> {
short_name: "test camera".to_owned(),
description: "".to_owned(),
onvif_host: "test-camera".to_owned(),
username: "foo".to_owned(),
password: "bar".to_owned(),
username: Some("foo".to_owned()),
password: Some("bar".to_owned()),
streams: [
db::StreamChange {
sample_file_dir_id: Some(sample_file_dir_id),