From 0e9d2fbb99008e829e6dfc84748bd963ff753013 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 8 Jan 2019 01:38:57 -0800 Subject: [PATCH] Set connection strategy to keep open Apply to both default camera server and examples. --- deps/examples/cpp-multiCameraServer/main.cpp | 1 + deps/examples/java-multiCameraServer/src/main/java/Main.java | 1 + deps/examples/python-multiCameraServer/multiCameraServer.py | 1 + deps/tools/multiCameraServer.cpp | 1 + 4 files changed, 4 insertions(+) diff --git a/deps/examples/cpp-multiCameraServer/main.cpp b/deps/examples/cpp-multiCameraServer/main.cpp index eaab1c2..7a6e1b5 100644 --- a/deps/examples/cpp-multiCameraServer/main.cpp +++ b/deps/examples/cpp-multiCameraServer/main.cpp @@ -162,6 +162,7 @@ cs::UsbCamera StartCamera(const CameraConfig& config) { config.name, config.path); camera.SetConfigJson(config.config); + camera.SetConnectionStrategy(cs::VideoSource::kConnectionKeepOpen); return camera; } diff --git a/deps/examples/java-multiCameraServer/src/main/java/Main.java b/deps/examples/java-multiCameraServer/src/main/java/Main.java index 8c63792..b63aa72 100644 --- a/deps/examples/java-multiCameraServer/src/main/java/Main.java +++ b/deps/examples/java-multiCameraServer/src/main/java/Main.java @@ -173,6 +173,7 @@ public final class Main { Gson gson = new GsonBuilder().create(); camera.setConfigJson(gson.toJson(config.config)); + camera.setConnectionStrategy(VideoSource.ConnectionStrategy.kKeepOpen); return camera; } diff --git a/deps/examples/python-multiCameraServer/multiCameraServer.py b/deps/examples/python-multiCameraServer/multiCameraServer.py index ced5a09..17b1059 100755 --- a/deps/examples/python-multiCameraServer/multiCameraServer.py +++ b/deps/examples/python-multiCameraServer/multiCameraServer.py @@ -127,6 +127,7 @@ def startCamera(config): .startAutomaticCapture(name=config.name, path=config.path) camera.setConfigJson(json.dumps(config.config)) + camera.setConnectionStrategy(VideoSource.ConnectionStrategy.kKeepOpen) return camera diff --git a/deps/tools/multiCameraServer.cpp b/deps/tools/multiCameraServer.cpp index dbfc7b6..8ed541e 100644 --- a/deps/tools/multiCameraServer.cpp +++ b/deps/tools/multiCameraServer.cpp @@ -163,6 +163,7 @@ void StartCamera(const CameraConfig& config) { config.name, config.path); camera.SetConfigJson(config.config); + camera.SetConnectionStrategy(cs::VideoSource::kConnectionKeepOpen); } } // namespace