Commit Graph

103 Commits

Author SHA1 Message Date
Thad House
6e4ee8da2b [cscore] Limit jnicvstatic exports to only C and JNI symbols (#2565)
Reduces risk even more about accidentally interfering with OpenCV.
2020-07-03 21:53:56 -07:00
Thad House
b1353e4d6e [cscore] Fix jnicvstatic classifier (#2561)
The archive needed to be zip, additionally the library needed to statically link to cscore. All better now
2020-06-30 22:50:02 -07:00
Thad House
9f4de91554 [cscore] Add new jnicvstatic artifact type (#2560)
With the new extraction method, we would need to provide an opencv. However, all of our tools that use opencv use an alternate version of OpenCV, so that would interfere.

This adds an artifact where opencv is statically linked into cscore, but wpiutil is a shared dependency. This solves some shared state hacks, and the extraction works so much better, so its worth making this change to allow that
2020-06-30 20:39:52 -07:00
Tyler Veness
22c0e2813a [build] Upgrade CI to clang-format 10.0 (#1961)
MacOS no longer ships 6.0, and Arch Linux's mesa GPU drivers are no longer compatible with LLVM 6.0.
2020-06-27 20:39:00 -07:00
Peter Johnson
4d275e4767 [cscore] Fix USB camera test failure (#2556)
Introduced by camera filtering in #2532.
2020-06-27 16:14:18 -07:00
Peter Johnson
11fb0a4cb7 [cscore] EnumerateUsbCameras(): Only list capture devices (#2532)
Previously this would list ALL /dev/video* devices.  In recent versions of
Linux this leads to listing duplicate devices, as many USB cameras provide
both a video device and a metadata device, and only the video device can
actually be used for streaming.
2020-06-13 20:51:46 -07:00
Peter Johnson
67554ef3b0 [build] Add .inl files to styleguide (NFC) (#2506)
No functional changes.
2020-05-05 18:17:50 -07:00
CircuitCraft42
0f313fb9ab cmake: Improved portability of OpenCV Java binding search (#2348)
The CMake option OPENCV_JAVA_INSTALL_DIR can be set to the location
to search for the jar file. Note that the file name cannot be
changed, as, after checking several Linux package repositories,
that seems to be constant across all of them.

Fixes #2346.
2020-02-10 17:30:54 -08:00
Peter Johnson
108ddfa1b4 Fix Pi Camera auto exposure property name (#2258) 2020-01-11 15:04:29 -08:00
Peter Johnson
790dc552ca Add quirks support for Pi camera (#2241)
- Valid video modes (native modes plus some low-res modes)
- Exposure setting
2020-01-07 20:21:28 -08:00
Peter Johnson
b78f115fcf Work around VS2019 16.4.0 bugs (#2171)
Work around frontend bug in scoped_lock and code generation bug in reverse_iterator in gtest.

See https://github.com/google/googletest/pull/2635
2019-12-14 10:48:19 -08:00
Banks T
b8c1024261 Fix PS3Eye VID and PID (#2146) 2019-11-30 12:35:47 -08:00
Peter Johnson
b058dcf64e Catch exceptions generated by OpenCV in cscore JNI (#2118) 2019-11-22 08:12:17 -08:00
Banks T
2a76c996eb Use VID/PID detection for PS3Eye (#1977) 2019-10-24 20:28:21 -07:00
Peter Johnson
c59f9cea5f CameraServer: Add VID/PID support for Linux USB devices (#1960) 2019-10-20 14:12:00 -07:00
Thad House
0e3b0f3da7 Remove deprecated free() calls (#1925)
Replaced with the standard close()
2019-10-08 21:30:33 -07:00
Banks T
56d782b16c Add secondary camera name for PS3Eye (#1920) 2019-10-06 22:18:49 -07:00
Banks T
2271570860 Fix PS3Eye exposure setting (#1911) 2019-09-30 15:09:39 -07:00
Thad House
bc59db5e6f Rename DEBUG macro to DEBUG0 (#1871)
This avoids conflicts with the platform DEBUG macro on some platforms.
2019-09-06 20:45:52 -05:00
Thad House
76930250c0 Remove objective-cpp support (#1816)
Was only there for mac usb cam support, but we likely won't get to it this summer anyway,
and its causing a breakage in the backing libraries with cross builds
2019-08-09 16:28:53 -07:00
Tyler Veness
98d0706de8 Fix cscore build with OpenCV 4 (#1803)
The main change in OpenCV 4 was removing its C APIs from OpenCV 1. If
the user has OpenCV 4, they have no way of obtaining the correct
arguments for cscore functions that require the C API. Therefore, we can
fix the build by just not compiling in functions reliant on the C API if
OpenCV 4 is being used.

OpenCV 3 builds should continue to work with this change.
2019-08-03 16:10:39 -07:00
Austin Shalit
df12fc2a86 Java cleanups (#1776)
* Remove extra ';'s
* Remove unnecessary conversions to String
* Use StandardCharsets object
* Replace infinite while with check for interrupted thread
* Remove redundant local vars
* Remove redundant throws clause
* Remove redundant primitive wrapping
* Fix malformed Nested class test
* Remove unnecessary unboxing
* Remove unnecessary explicit type argument
* Replace lambdas with method references
* Replace statement lambdas with expression lambdas
* Replace null check with method call
* Replace number comparison with method call
* Fix broken javadoc comments
* Replace Arrays.asList with singletonLists
* Remove excessive lambda usage
* Remove redundant string operation
* Remove redundant type casts
* Remove unnecessary returns
* Remove redundant suppressions
* Fix unresolved file reference
* static analysis fixes
2019-07-31 22:19:48 -07:00
Tyler Veness
62be0392b6 Replace std::lock_guard and std::lock with std::scoped_lock (#1758)
std::scoped_lock was introduced in C++17 and is strictly better than
std::lock_guard as it supports locking any number of mutexes safely.
It's also easier to use than std::lock for locking multiple mutexes at
once.
2019-07-08 22:58:39 -07:00
Tyler Veness
841ef5d739 Remove template types from lock RAII wrapper usages (#1756)
C++17 has template type autodeduction. These wrappers include
std::lock_guard and std::unique_lock.
2019-07-07 19:17:14 -07:00
Peter Johnson
8757bc471b Remove pre-C++17 shims (#1752)
Now that all compilers support C++17, remove some old C++14/C++17 shims.
2019-07-07 15:44:43 -07:00
Austin Shalit
f7cfdd7cee Replace crlf line endings with lf (#1731) 2019-06-28 20:55:14 -07:00
Thad House
3dfb01d45b Update to new Native Utils (#1696)
Also update to azure 2019 windows image
2019-06-28 14:09:10 -07:00
Peter Johnson
372ca4f456 cmake: Enable googletest unit tests (#1720)
Also don't inherit compile warnings from wpiutil

There's not a good way to disable inherited compiler flags.
2019-06-23 12:44:28 -07:00
Peter Johnson
1d0c05d4f8 Styleguide fixes for #1718 (#1719) 2019-06-14 18:51:49 -07:00
Peter Johnson
f07569df19 Fix newer GCC/clang compiler warnings (#1718) 2019-06-14 18:32:27 -07:00
Thad House
221e66f46d Allow disabling static init of JNI libraries (#1672) 2019-06-10 22:29:32 -07:00
Thad House
bb48ae391e cmake: Move example programs into folders (#1654)
This looks cleaner in VS.
2019-06-10 20:04:34 -07:00
Thad House
221011494d Update for C++17 and fix MSVC warnings (#1694)
* Update MSVC arguments
* Fix json allocator
* Fix simulation diamond
* Bump gtest
* Remove empty varargs in unit tests
* Replace test case with test suite
* Remove deprecation warning in optional
* Remove need for NOMIXMAX to be defined in wpilib headers
2019-05-31 15:43:32 -05:00
Thad House
fb1239a2ad Add raw sources and sinks to cscore (#1670)
In some cases, we don't want the cv requirement to get an image, for instance interop with other versions of opencv

This enables getting a raw image, and handling conversions from the user side.
2019-05-30 21:12:05 -05:00
Thad House
90957aeea4 Move libuv to its own subfolder in build (#1661)
Allows using system libuv

* Fix Gradle Build and include dirs

* Update cmake find to support vcpkg libuv
2019-05-30 15:59:26 -07:00
Tyler Veness
f432f65bef Update copyright year in license to 2019 (#1524)
Also update clang-format to 6.0.
2019-05-17 17:35:09 -07:00
Thad House
7cd6e2e7fa UsbCamera: Solve race in windows initialization (#1638)
Create message pump during UsbCameraImpl creation.
2019-05-05 16:29:47 -07:00
Peter Johnson
2de3bf7f58 Update LLVM from stable upstream (#1653)
Replace CheckedMalloc with upstream safe_malloc.
2019-04-27 20:33:08 -07:00
Thad House
3b06313243 Fix Gray to BGR conversion in CameraServer (#1665) 2019-04-27 20:17:17 -07:00
Thad House
6cd1c73efe Fix GUID comparison creating weird symbol (#1659) 2019-04-27 20:16:52 -07:00
Thad House
12ab035aad Fix receive side of LabVIEW USB streams (#1621)
LabView only accepts %20 instead of + for parameters, only sends '\n' at the boundaries,
and includes the -- when sending the initial boundary.  This solves those parts.

This is not fully enough to fix shuffleboard and others, as the NT format for paths is not the correct path.
2019-03-03 11:20:43 -08:00
Thad House
a9371a7586 Fix missing exposure property on windows USB cameras (#1571) 2019-02-06 22:49:55 -08:00
Peter Johnson
6992f5421f cscore: Avoid crash if invalid (null) source set in MjpegServer (#1585)
Fixes robotpy/robotpy-cscore#60
2019-02-03 00:22:07 -08:00
Thad House
910b9f3af7 Add support for camera descriptions on windows (#1572)
For now, has to force enumerate all cameras to find the matching one
2019-02-01 23:04:12 -08:00
Thad House
09d90b02fb Remove prints and unecessary items from windows GetNetworkInterfaces (#1573) 2019-02-01 23:02:12 -08:00
Peter Johnson
88a09dd13a cscore: Handle USB camera integer menus (#1561)
The Pi Camera is one of these.  Previously, integers were just being
cast to a string instead of formatted as a string.
2019-01-24 22:46:29 -08:00
Peter Johnson
05d6660a6b cscore: Add config json to VideoSink (#1543)
Same format as VideoSource.

Refactor properties json handling into PropertyContainer.
2019-01-11 20:33:05 -08:00
Peter Johnson
1349dd4bd8 Make MjpegServer functions public (#1545) 2019-01-11 17:53:44 -08:00
Thad House
308bdbe298 cscore: Windows UsbCamera: Use custom windows message for initial connection (#1534)
WM_CREATE is being called at a time where the message pump cannot be called back into.
2019-01-09 22:52:24 -08:00
Peter Johnson
f889b45d59 cscore: MjpegServer: Fix FPS limiting (#1536)
This uses a 1-second window average to try to hit the desired FPS.
2019-01-09 22:50:34 -08:00