mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Fix mac builds. (#88)
Warnings for unused functions, and the same skips as Windows.
This commit is contained in:
committed by
Peter Johnson
parent
55111ac35f
commit
7ef56de3f2
@@ -177,6 +177,7 @@ static inline bool CheckStatus(JNIEnv *env, CS_Status status) {
|
||||
return status == CS_OK;
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
static jobject MakeJObject(JNIEnv *env, const cs::UsbCameraInfo &info) {
|
||||
static jmethodID constructor = env->GetMethodID(
|
||||
usbCameraInfoCls, "<init>", "(ILjava/lang/String;Ljava/lang/String;)V");
|
||||
@@ -185,6 +186,7 @@ static jobject MakeJObject(JNIEnv *env, const cs::UsbCameraInfo &info) {
|
||||
return env->NewObject(usbCameraInfoCls, constructor,
|
||||
static_cast<jint>(info.dev), path.obj(), name.obj());
|
||||
}
|
||||
#endif
|
||||
|
||||
static jobject MakeJObject(JNIEnv *env, const cs::VideoMode &videoMode) {
|
||||
static jmethodID constructor =
|
||||
@@ -386,7 +388,7 @@ JNIEXPORT jobjectArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_getEnumProper
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createUsbCameraDev
|
||||
(JNIEnv *env, jclass, jstring name, jint dev)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#ifndef __linux__
|
||||
unsupportedEx.Throw(env, "USB is not supported yet");
|
||||
return 0;
|
||||
#else
|
||||
@@ -409,7 +411,7 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createUsbCameraDev
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createUsbCameraPath
|
||||
(JNIEnv *env, jclass, jstring name, jstring path)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#ifndef __linux__
|
||||
unsupportedEx.Throw(env, "USB is not supported yet");
|
||||
return 0;
|
||||
#else
|
||||
@@ -870,7 +872,7 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setCameraExposureManu
|
||||
JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getUsbCameraPath
|
||||
(JNIEnv *env, jclass, jint source)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#ifndef __linux__
|
||||
unsupportedEx.Throw(env, "USB is not supported yet");
|
||||
return 0;
|
||||
#else
|
||||
@@ -1379,7 +1381,7 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_removeListener
|
||||
JNIEXPORT jobjectArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_enumerateUsbCameras
|
||||
(JNIEnv *env, jclass)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#ifndef __linux__
|
||||
unsupportedEx.Throw(env, "USB is not supported yet");
|
||||
return 0;
|
||||
#else
|
||||
|
||||
@@ -51,7 +51,7 @@ void HttpCameraImpl::Start() {
|
||||
m_settingsThread = std::thread(&HttpCameraImpl::SettingsThreadMain, this);
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
#ifdef __linux__
|
||||
static inline void DoFdSet(int fd, fd_set* set, int* nfds) {
|
||||
if (fd >= 0) {
|
||||
FD_SET(fd, set);
|
||||
@@ -234,7 +234,7 @@ bool HttpCameraImpl::DeviceStreamFrame(wpi::raw_istream& is,
|
||||
wpi::Now());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// We know how big it is! Just get a frame of the right size and read
|
||||
// the data directly into it.
|
||||
auto image = AllocImage(VideoMode::PixelFormat::kMJPEG, 0, 0, contentLength);
|
||||
|
||||
@@ -26,7 +26,7 @@ class Image {
|
||||
|
||||
public:
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifndef __linux__
|
||||
explicit Image(std::size_t capacity) {
|
||||
m_data.reserve(capacity);
|
||||
}
|
||||
|
||||
@@ -42,14 +42,14 @@
|
||||
|
||||
using namespace cs;
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
static constexpr char const* kPropWbAuto = "white_balance_temperature_auto";
|
||||
static constexpr char const* kPropWbValue = "white_balance_temperature";
|
||||
static constexpr char const* kPropExAuto = "exposure_auto";
|
||||
static constexpr char const* kPropExValue = "exposure_absolute";
|
||||
static constexpr char const* kPropBrValue = "brightness";
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
// Conversions v4l2_fract time per frame from/to frames per second (fps)
|
||||
static inline int FractToFPS(const struct v4l2_fract& timeperframe) {
|
||||
return (1.0 * timeperframe.denominator) / timeperframe.numerator;
|
||||
|
||||
Reference in New Issue
Block a user