[cscore] HttpCamera: Send width/height/fps stream settings (#7247)

This commit is contained in:
Peter Johnson
2024-10-22 08:33:23 -06:00
committed by GitHub
parent e8d2d1c39a
commit f553dee6cb
2 changed files with 11 additions and 3 deletions

View File

@@ -9,6 +9,7 @@
#include <utility>
#include <vector>
#include <fmt/format.h>
#include <wpi/MemAlloc.h>
#include <wpi/StringExtras.h>
#include <wpi/timestamp.h>
@@ -518,6 +519,14 @@ bool HttpCameraImpl::SetVideoMode(const VideoMode& mode, CS_Status* status) {
}
std::scoped_lock lock(m_mutex);
m_mode = mode;
m_streamSettings.clear();
if (mode.width != 0 && mode.height != 0) {
m_streamSettings["resolution"] =
fmt::format("{}x{}", mode.width, mode.height);
}
if (mode.fps != 0) {
m_streamSettings["fps"] = fmt::format("{}", mode.fps);
}
m_streamSettingsUpdated = true;
return true;
}