54 lines
2.2 KiB
C++
54 lines
2.2 KiB
C++
#pragma once
|
|
|
|
#include <vizionsdk/VizionSDK.h>
|
|
#include "StreamingEngine.h"
|
|
#include <memory>
|
|
#include <string>
|
|
#include <mutex>
|
|
|
|
class CameraController {
|
|
public:
|
|
explicit CameraController(std::shared_ptr<VxCamera> camera);
|
|
|
|
// Process JSON command and return JSON response
|
|
std::string processCommand(const std::string& jsonCommand);
|
|
|
|
// Get streaming engine for external control
|
|
std::shared_ptr<StreamingEngine> getStreamingEngine() { return streamingEngine_; }
|
|
|
|
private:
|
|
// Command handlers
|
|
std::string handleSetFormat(const std::string& width, const std::string& height,
|
|
const std::string& framerate, const std::string& format);
|
|
std::string handleGetFormats();
|
|
std::string handleSetExposure(const std::string& mode, const std::string& value);
|
|
std::string handleSetWhiteBalance(const std::string& mode, const std::string& temperature);
|
|
std::string handleSetBrightness(const std::string& value);
|
|
std::string handleSetContrast(const std::string& value);
|
|
std::string handleSetSaturation(const std::string& value);
|
|
std::string handleSetSharpness(const std::string& value);
|
|
std::string handleSetGamma(const std::string& value);
|
|
std::string handleSetGain(const std::string& value);
|
|
std::string handleGetStatus();
|
|
std::string handleStartStream();
|
|
std::string handleStopStream();
|
|
std::string handleSetPipeline(const std::string& pipeline);
|
|
std::string handleSetEHDRMode(const std::string& value);
|
|
std::string handleSetEHDRExposureMin(const std::string& value);
|
|
std::string handleSetEHDRExposureMax(const std::string& value);
|
|
std::string handleSetEHDRRatioMin(const std::string& value);
|
|
std::string handleSetEHDRRatioMax(const std::string& value);
|
|
std::string handleGetEHDRStatus();
|
|
|
|
// Helper functions
|
|
VX_IMAGE_FORMAT stringToFormat(const std::string& format);
|
|
std::string formatToString(VX_IMAGE_FORMAT format);
|
|
std::string createErrorResponse(const std::string& error);
|
|
std::string createSuccessResponse(const std::string& message = "");
|
|
|
|
std::shared_ptr<VxCamera> camera_;
|
|
std::shared_ptr<StreamingEngine> streamingEngine_;
|
|
std::mutex mutex_;
|
|
std::string gstPipeline_;
|
|
};
|