remove incorrect workarounds for undetected cameras

This commit is contained in:
David Ventura
2024-05-02 13:23:52 +02:00
parent 45b8b159d1
commit 2ec4d603c6
4 changed files with 5 additions and 30 deletions
-10
View File
@@ -1,10 +0,0 @@
# This is a simple name mapping for cameras, in the form
#
# CAMERA_ID=descriptive name
#
# Blank lines and lines starting with "#" are ignored.
#
# Any updates to this file require restarting the HTTP server.
# This file is meant to be updated manually, it is NOT updated dynamically.
FTYC811847AGFDZ=Office camera
+2 -4
View File
@@ -17,10 +17,9 @@ yargs(hideBin(process.argv))
(yargs) => { (yargs) => {
return yargs return yargs
.option("ansi", { default: false }) .option("ansi", { default: false })
.option("slow_startup", { default: false })
.option("audio", { describe: "Also stream audio from camera", default: true }) .option("audio", { describe: "Also stream audio from camera", default: true })
.option("color", { describe: "Use color in logs", default: undefined }) .option("color", { describe: "Use color in logs", default: undefined })
.boolean(["ansi", "audio", "slow_startup", "color"]) .boolean(["ansi", "audio", "color"])
.option("log_level", { describe: "Set log level", default: "info" }) .option("log_level", { describe: "Set log level", default: "info" })
.option("discovery_ip", { describe: "Camera discovery IP address", default: "192.168.1.255" }) .option("discovery_ip", { describe: "Camera discovery IP address", default: "192.168.1.255" })
.option("attempt_to_fix_packet_loss", { default: false }) .option("attempt_to_fix_packet_loss", { default: false })
@@ -43,9 +42,8 @@ yargs(hideBin(process.argv))
(yargs) => { (yargs) => {
return yargs return yargs
.option("ansi", { default: false }) .option("ansi", { default: false })
.option("slow_startup", { default: false })
.option("color", { describe: "Use color in logs", default: undefined }) .option("color", { describe: "Use color in logs", default: undefined })
.boolean(["ansi", "slow_startup", "color"]) .boolean(["ansi", "color"])
.option("log_level", { describe: "Set log level", default: "info" }) .option("log_level", { describe: "Set log level", default: "info" })
.option("discovery_ip", { describe: "Camera discovery IP address", default: "192.168.1.255" }) .option("discovery_ip", { describe: "Camera discovery IP address", default: "192.168.1.255" })
.option("attempt_to_fix_packet_loss", { default: false }) .option("attempt_to_fix_packet_loss", { default: false })
-1
View File
@@ -1,6 +1,5 @@
export type opt = { export type opt = {
ansi: boolean; ansi: boolean;
discovery_ip: string; discovery_ip: string;
slow_startup: boolean;
attempt_to_fix_packet_loss: boolean; attempt_to_fix_packet_loss: boolean;
}; };
-12
View File
@@ -60,23 +60,11 @@ export const makeSession = (
sock.on("message", (msg, rinfo) => handleIncoming(session, handlers, msg, rinfo)); sock.on("message", (msg, rinfo) => handleIncoming(session, handlers, msg, rinfo));
sock.on("listening", () => { sock.on("listening", () => {
const startup = () => {
const buf = makeP2pRdy(dev); const buf = makeP2pRdy(dev);
session.send(buf); session.send(buf);
// The YsxLite sends a P2PAlive message immediately after P2PRdy
const alive_buf = create_P2pAlive();
session.send(alive_buf);
session.started = true; session.started = true;
};
if (options.slow_startup) {
logger.info("Delaying session startup");
setTimeout(startup, 6500);
} else {
startup();
}
}); });
const SEND_PORT = 32108;
sock.bind(); sock.bind();
const sessTimer = setInterval(() => { const sessTimer = setInterval(() => {
const delta = Date.now() - session.lastReceivedPacket; const delta = Date.now() - session.lastReceivedPacket;