cscore: Add config json to VideoSink (#1543)

Same format as VideoSource.

Refactor properties json handling into PropertyContainer.
This commit is contained in:
Peter Johnson
2019-01-11 20:33:05 -08:00
committed by GitHub
parent 1349dd4bd8
commit 05d6660a6b
15 changed files with 317 additions and 54 deletions

View File

@@ -24,6 +24,11 @@
#include "PropertyImpl.h"
#include "cscore_cpp.h"
namespace wpi {
class Logger;
class json;
} // namespace wpi
namespace cs {
class PropertyContainer {
@@ -50,6 +55,10 @@ class PropertyContainer {
std::vector<std::string> GetEnumPropertyChoices(int property,
CS_Status* status) const;
bool SetPropertiesJson(const wpi::json& config, wpi::Logger& logger,
wpi::StringRef logName, CS_Status* status);
wpi::json GetPropertiesJsonObject(CS_Status* status);
protected:
// Get a property; must be called with m_mutex held.
PropertyImpl* GetProperty(int property) {