[cscore] Remove Axis camera (#8642)

Was a thin wrapper around HttpCamera and haven't been used by teams for
years.
This commit is contained in:
Peter Johnson
2026-02-27 21:05:52 -08:00
committed by GitHub
parent 880ffe94f2
commit ba81d4b790
8 changed files with 13 additions and 196 deletions

View File

@@ -550,50 +550,13 @@ void HttpCameraImpl::NumSinksEnabledChanged() {
m_sinkEnabledCond.notify_one();
}
bool AxisCameraImpl::CacheProperties(CS_Status* status) const {
CreateProperty("brightness", "ImageSource.I0.Sensor.Brightness", true,
CS_PROP_INTEGER, 0, 100, 1, 50, 50);
CreateEnumProperty("white_balance", "ImageSource.I0.Sensor.WhiteBalance",
true, 0, 0,
{"auto", "hold", "fixed_outdoor1", "fixed_outdoor2",
"fixed_indoor", "fixed_fluor1", "fixed_fluor2"});
CreateProperty("color_level", "ImageSource.I0.Sensor.ColorLevel", true,
CS_PROP_INTEGER, 0, 100, 1, 50, 50);
CreateEnumProperty("exposure", "ImageSource.I0.Sensor.Exposure", true, 0, 0,
{"auto", "hold", "flickerfree50", "flickerfree60"});
CreateProperty("exposure_priority", "ImageSource.I0.Sensor.ExposurePriority",
true, CS_PROP_INTEGER, 0, 100, 1, 50, 50);
// TODO: get video modes from device
std::scoped_lock lock(m_mutex);
m_videoModes.clear();
m_videoModes.emplace_back(VideoMode::kMJPEG, 640, 480, 30);
m_videoModes.emplace_back(VideoMode::kMJPEG, 480, 360, 30);
m_videoModes.emplace_back(VideoMode::kMJPEG, 320, 240, 30);
m_videoModes.emplace_back(VideoMode::kMJPEG, 240, 180, 30);
m_videoModes.emplace_back(VideoMode::kMJPEG, 176, 144, 30);
m_videoModes.emplace_back(VideoMode::kMJPEG, 160, 120, 30);
m_properties_cached = true;
return true;
}
namespace wpi::cs {
CS_Source CreateHttpCamera(std::string_view name, std::string_view url,
CS_HttpCameraKind kind, CS_Status* status) {
auto& inst = Instance::GetInstance();
std::shared_ptr<HttpCameraImpl> source;
switch (kind) {
case CS_HTTP_AXIS:
source = std::make_shared<AxisCameraImpl>(name, inst.logger,
inst.notifier, inst.telemetry);
break;
default:
source = std::make_shared<HttpCameraImpl>(name, kind, inst.logger,
inst.notifier, inst.telemetry);
break;
}
auto source = std::make_shared<HttpCameraImpl>(name, kind, inst.logger,
inst.notifier, inst.telemetry);
std::string urlStr{url};
if (!source->SetUrls(std::span{&urlStr, 1}, status)) {
return 0;

View File

@@ -143,18 +143,4 @@ class HttpCameraImpl : public SourceImpl {
wpi::util::condition_variable m_monitorCond;
};
class AxisCameraImpl : public HttpCameraImpl {
public:
AxisCameraImpl(std::string_view name, wpi::util::Logger& logger,
Notifier& notifier, Telemetry& telemetry)
: HttpCameraImpl{name, CS_HTTP_AXIS, logger, notifier, telemetry} {}
#if 0
void SetProperty(int property, int value, CS_Status* status) override;
void SetStringProperty(int property, std::string_view value,
CS_Status* status) override;
#endif
protected:
bool CacheProperties(CS_Status* status) const override;
};
} // namespace wpi::cs

View File

@@ -87,7 +87,3 @@ std::vector<VideoSink> VideoSink::EnumerateSinks() {
}
return sinks;
}
std::string AxisCamera::HostToUrl(std::string_view host) {
return fmt::format("http://{}/mjpg/video.mjpg", host);
}