mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[cscore] HttpCamera: Send width/height/fps stream settings (#7247)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user