diff options
Diffstat (limited to 'src/libcamera/pipeline/vimc.cpp')
-rw-r--r-- | src/libcamera/pipeline/vimc.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp index 9e1cf11a..6ed069ed 100644 --- a/src/libcamera/pipeline/vimc.cpp +++ b/src/libcamera/pipeline/vimc.cpp @@ -9,17 +9,26 @@ #include <libcamera/stream.h> #include "device_enumerator.h" +#include "log.h" #include "media_device.h" #include "pipeline_handler.h" namespace libcamera { +LOG_DEFINE_CATEGORY(VIMC) + class PipeHandlerVimc : public PipelineHandler { public: PipeHandlerVimc(CameraManager *manager); ~PipeHandlerVimc(); + std::map<Stream *, StreamConfiguration> + streamConfiguration(Camera *camera, + std::vector<Stream *> &streams) override; + int configureStreams(Camera *camera, + std::map<Stream *, StreamConfiguration> &config) override; + bool match(DeviceEnumerator *enumerator); private: @@ -38,6 +47,32 @@ PipeHandlerVimc::~PipeHandlerVimc() media_->release(); } +std::map<Stream *, StreamConfiguration> +PipeHandlerVimc::streamConfiguration(Camera *camera, + std::vector<Stream *> &streams) +{ + std::map<Stream *, StreamConfiguration> configs; + + StreamConfiguration config{}; + + LOG(VIMC, Info) << "TODO: Return a good default format"; + + configs[&stream_] = config; + + return configs; +} + +int PipeHandlerVimc::configureStreams(Camera *camera, + std::map<Stream *, StreamConfiguration> &config) +{ + StreamConfiguration *cfg = &config[&stream_]; + + LOG(VIMC, Info) << "TODO: Configure the camera for resolution " + << cfg->width << "x" << cfg->height; + + return 0; +} + bool PipeHandlerVimc::match(DeviceEnumerator *enumerator) { DeviceMatch dm("vimc"); |