This patch introduces the configuration file for Virtual Pipeline Handler. The config file is written in yaml, and the format is documented in `README.md`. The config file will define the camera with IDs, supported formats and image sources, etc. In the default config file, only Test Patterns are used. Developers can use real images loading if desired. Signed-off-by: Konami Shu <konamiz@google.com> Co-developed-by: Harvey Yang <chenghaoyang@chromium.org> Signed-off-by: Harvey Yang <chenghaoyang@chromium.org> Co-developed-by: Yunke Cao <yunkec@chromium.org> Signed-off-by: Yunke Cao <yunkec@chromium.org> Co-developed-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Tomasz Figa <tfiga@chromium.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
40 lines
1.0 KiB
C++
40 lines
1.0 KiB
C++
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
/*
|
|
* Copyright (C) 2024, Google Inc.
|
|
*
|
|
* Virtual cameras helper to parse config file
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
#include <libcamera/base/file.h>
|
|
|
|
#include "libcamera/internal/pipeline_handler.h"
|
|
#include "libcamera/internal/yaml_parser.h"
|
|
|
|
#include "virtual.h"
|
|
|
|
namespace libcamera {
|
|
|
|
class ConfigParser
|
|
{
|
|
public:
|
|
std::vector<std::unique_ptr<VirtualCameraData>>
|
|
parseConfigFile(File &file, PipelineHandler *pipe);
|
|
|
|
private:
|
|
std::unique_ptr<VirtualCameraData>
|
|
parseCameraConfigData(const YamlObject &cameraConfigData, PipelineHandler *pipe);
|
|
|
|
int parseSupportedFormats(const YamlObject &cameraConfigData,
|
|
std::vector<VirtualCameraData::Resolution> *resolutions);
|
|
int parseFrameGenerator(const YamlObject &cameraConfigData, VirtualCameraData *data);
|
|
int parseLocation(const YamlObject &cameraConfigData, VirtualCameraData *data);
|
|
int parseModel(const YamlObject &cameraConfigData, VirtualCameraData *data);
|
|
};
|
|
|
|
} /* namespace libcamera */
|