mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
CameraServer: enable usb cameras on non-Linux platforms (#1411)
This commit is contained in:
@@ -55,7 +55,6 @@ static wpi::StringRef MakeSourceValue(CS_Source source,
|
||||
CS_Status status = 0;
|
||||
buf.clear();
|
||||
switch (cs::GetSourceKind(source, &status)) {
|
||||
#ifdef __linux__
|
||||
case cs::VideoSource::kUsb: {
|
||||
wpi::StringRef prefix{"usb:"};
|
||||
buf.append(prefix.begin(), prefix.end());
|
||||
@@ -63,7 +62,6 @@ static wpi::StringRef MakeSourceValue(CS_Source source,
|
||||
buf.append(path.begin(), path.end());
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
case cs::VideoSource::kHttp: {
|
||||
wpi::StringRef prefix{"ip:"};
|
||||
buf.append(prefix.begin(), prefix.end());
|
||||
@@ -455,7 +453,6 @@ CameraServer::CameraServer() : m_impl(new Impl) {}
|
||||
|
||||
CameraServer::~CameraServer() {}
|
||||
|
||||
#ifdef __linux__
|
||||
cs::UsbCamera CameraServer::StartAutomaticCapture() {
|
||||
cs::UsbCamera camera = StartAutomaticCapture(m_impl->m_defaultUsbDevice++);
|
||||
auto csShared = GetCameraServerShared();
|
||||
@@ -488,7 +485,6 @@ cs::UsbCamera CameraServer::StartAutomaticCapture(const wpi::Twine& name,
|
||||
csShared->ReportUsbCamera(camera.GetHandle());
|
||||
return camera;
|
||||
}
|
||||
#endif
|
||||
|
||||
cs::AxisCamera CameraServer::AddAxisCamera(const wpi::Twine& host) {
|
||||
return AddAxisCamera("Axis Camera", host);
|
||||
|
||||
Reference in New Issue
Block a user