From c702b9421a2669beee37e1da06477f83cc6325a1 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 2 Jan 2019 23:12:32 -0800 Subject: [PATCH] Add hooks for image processing to examples (#27) Fixes #23. --- .gitignore | 2 - deps/04-copy.sh | 3 - deps/examples/cpp-multiCameraServer/main.cpp | 224 ++++++++++++++++ .../src/main/java/Main.java | 245 ++++++++++++++++++ .../multiCameraServer.py | 11 +- 5 files changed, 476 insertions(+), 9 deletions(-) create mode 100644 deps/examples/cpp-multiCameraServer/main.cpp create mode 100644 deps/examples/java-multiCameraServer/src/main/java/Main.java diff --git a/.gitignore b/.gitignore index ebd4c5d..d44c826 100644 --- a/.gitignore +++ b/.gitignore @@ -16,5 +16,3 @@ deps/tools/setuidgids *.sw? *.debug stage2/01-sys-tweaks/extfiles -deps/examples/cpp-multiCameraServer/main.cpp -deps/examples/java-multiCameraServer/src diff --git a/deps/04-copy.sh b/deps/04-copy.sh index 6e76401..dec4d2a 100755 --- a/deps/04-copy.sh +++ b/deps/04-copy.sh @@ -7,9 +7,6 @@ mkdir -p ${DEST} # # examples # -mkdir -p examples/java-multiCameraServer/src/main/java -cp allwpilib/cameraserver/multiCameraServer/src/main/java/Main.java examples/java-multiCameraServer/src/main/java/ -cp allwpilib/cameraserver/multiCameraServer/src/main/native/cpp/main.cpp examples/cpp-multiCameraServer/ sh -c 'cd examples && zip -r - java-multiCameraServer' > ${DEST}/java-multiCameraServer.zip sh -c 'cd examples && zip -r - cpp-multiCameraServer' > ${DEST}/cpp-multiCameraServer.zip diff --git a/deps/examples/cpp-multiCameraServer/main.cpp b/deps/examples/cpp-multiCameraServer/main.cpp new file mode 100644 index 0000000..3bc73f8 --- /dev/null +++ b/deps/examples/cpp-multiCameraServer/main.cpp @@ -0,0 +1,224 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2018 FIRST. All Rights Reserved. */ +/* Open Source Software - may be modified and shared by FRC teams. The code */ +/* must be accompanied by the FIRST BSD license file in the root directory of */ +/* the project. */ +/*----------------------------------------------------------------------------*/ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "cameraserver/CameraServer.h" + +/* + JSON format: + { + "team": , + "ntmode": <"client" or "server", "client" if unspecified> + "cameras": [ + { + "name": + "path": + "pixel format": <"MJPEG", "YUYV", etc> // optional + "width":