Monitor: Some reformatting of previously touched lines

This commit is contained in:
Peter Keresztes Schmidt 2021-02-11 20:02:08 +01:00
parent c0151caa64
commit 3d759e1fe0
1 changed files with 173 additions and 162 deletions

View File

@ -647,12 +647,11 @@ void Monitor::LoadCamera() {
if (camera)
return;
if ( type == LOCAL ) {
switch (type) {
case LOCAL: {
int extras = (deinterlacing >> 24) & 0xff;
camera = ZM::make_unique<LocalCamera>(
this,
camera = ZM::make_unique<LocalCamera>(this,
device,
channel,
format,
@ -671,10 +670,11 @@ void Monitor::LoadCamera() {
record_audio,
extras
);
} else if ( type == REMOTE ) {
break;
}
case REMOTE: {
if (protocol == "http") {
camera = ZM::make_unique<RemoteCameraHttp>(
this,
camera = ZM::make_unique<RemoteCameraHttp>(this,
method,
host,
port,
@ -692,8 +692,7 @@ void Monitor::LoadCamera() {
}
#if HAVE_LIBAVFORMAT
else if (protocol == "rtsp") {
camera = ZM::make_unique<RemoteCameraRtsp>(
this,
camera = ZM::make_unique<RemoteCameraRtsp>(this,
method,
host, // Host
port, // Port
@ -714,9 +713,10 @@ void Monitor::LoadCamera() {
else {
Error("Unexpected remote camera protocol '%s'", protocol.c_str());
}
} else if ( type == FILE ) {
camera = ZM::make_unique<FileCamera>(
this,
break;
}
case FILE: {
camera = ZM::make_unique<FileCamera>(this,
path.c_str(),
camera_width,
camera_height,
@ -728,10 +728,11 @@ void Monitor::LoadCamera() {
purpose == CAPTURE,
record_audio
);
} else if ( type == FFMPEG ) {
break;
}
#if HAVE_LIBAVFORMAT
camera = ZM::make_unique<FfmpegCamera>(
this,
case FFMPEG: {
camera = ZM::make_unique<FfmpegCamera>(this,
path,
method,
options,
@ -747,10 +748,11 @@ void Monitor::LoadCamera() {
decoder_hwaccel_name,
decoder_hwaccel_device
);
break;
}
#endif // HAVE_LIBAVFORMAT
} else if ( type == NVSOCKET ) {
camera = ZM::make_unique<RemoteCameraNVSocket>(
this,
case NVSOCKET: {
camera = ZM::make_unique<RemoteCameraNVSocket>(this,
host.c_str(),
port.c_str(),
path.c_str(),
@ -764,10 +766,11 @@ void Monitor::LoadCamera() {
purpose == CAPTURE,
record_audio
);
} else if ( type == LIBVLC ) {
break;
}
case LIBVLC: {
#if HAVE_LIBVLC
camera = ZM::make_unique<LibvlcCamera>(
this,
camera = ZM::make_unique<LibvlcCamera>(this,
path.c_str(),
method,
options,
@ -784,10 +787,11 @@ void Monitor::LoadCamera() {
#else // HAVE_LIBVLC
Error("You must have vlc libraries installed to use vlc cameras for monitor %d", id);
#endif // HAVE_LIBVLC
} else if ( type == CURL ) {
break;
}
case CURL: {
#if HAVE_LIBCURL
camera = ZM::make_unique<cURLCamera>(
this,
camera = ZM::make_unique<cURLCamera>(this,
path.c_str(),
user.c_str(),
pass.c_str(),
@ -804,10 +808,11 @@ void Monitor::LoadCamera() {
#else // HAVE_LIBCURL
Error("You must have libcurl installed to use ffmpeg cameras for monitor %d", id);
#endif // HAVE_LIBCURL
} else if ( type == VNC ) {
break;
}
case VNC: {
#if HAVE_LIBVNC
camera = ZM::make_unique<VncCamera>(
this,
camera = ZM::make_unique<VncCamera>(this,
host.c_str(),
port.c_str(),
user.c_str(),
@ -825,7 +830,13 @@ void Monitor::LoadCamera() {
#else // HAVE_LIBVNC
Fatal("You must have libvnc installed to use VNC cameras for monitor id %d", id);
#endif // HAVE_LIBVNC
} // end if type
break;
}
default: {
Fatal("Tried to load unsupported camera type %d for monitor %u", int(type), id);
break;
}
}
}
std::shared_ptr<Monitor> Monitor::Load(unsigned int p_id, bool load_zones, Purpose purpose) {