summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/meson.build
AgeCommit message (Expand)Author
2023-01-30ipa: raspberrypi: Add support for the Sony IMX708 sensorNick Hollinghurst
2023-01-30ipa: raspberrypi: First version of autofocus algorithm using PDAFNick Hollinghurst
2022-07-28ipa: raspberrypi: Use YamlParser to replace dependency on boostLaurent Pinchart
2022-03-23ipa: raspberrypi: Add camera helper for Sony IMX296 sensorNaushir Patuck
2021-11-02libcamera: ipa: raspberrypi: Add support for imx519 sensorArducam info
2021-07-12ipa: raspberrypi: Add an operator<< to struct DeviceStatusNaushir Patuck
2021-06-28libcamera: ipa: raspberrypi: Add support for ov9281 sensorDavid Plowman
2021-06-25libcamera/base: Validate internal headers as privateKieran Bingham
2021-06-15ipa: raspberrypi: Rename md_parser.cpp to md_parser_smia.cppNaushir Patuck
2021-03-09ipa: raspberrypi: Add support for imx290/imx327 sensorsDavid Plowman
2021-03-04ipa: raspberrypi: Remove MdParserRPiNaushir Patuck
2021-02-16ipa: raspberrypi: meson: Add dependency on generated headersPaul Elder
2021-02-11meson: Fix coding style when declaring arraysLaurent Pinchart
2020-06-25ipa: rpi: Add "focus" algorithmDavid Plowman
2020-05-13licenses: License all meson files under CC0-1.0Laurent Pinchart
2020-05-11libcamera: ipa: Raspberry Pi IPANaushir Patuck
:StreamKeyValueParser() { addOption("role", OptionString, "Role for the stream (viewfinder, video, still, raw)", ArgumentRequired); addOption("width", OptionInteger, "Width in pixels", ArgumentRequired); addOption("height", OptionInteger, "Height in pixels", ArgumentRequired); addOption("pixelformat", OptionString, "Pixel format name", ArgumentRequired); addOption("colorspace", OptionString, "Color space", ArgumentRequired); } KeyValueParser::Options StreamKeyValueParser::parse(const char *arguments) { KeyValueParser::Options options = KeyValueParser::parse(arguments); StreamRole role; if (options.valid() && options.isSet("role") && !parseRole(&role, options)) { std::cerr << "Unknown stream role " << options["role"].toString() << std::endl; options.invalidate(); } return options; } StreamRoles StreamKeyValueParser::roles(const OptionValue &values) { /* If no configuration values to examine default to viewfinder. */ if (values.empty()) return { StreamRole::Viewfinder }; const std::vector<OptionValue> &streamParameters = values.toArray(); StreamRoles roles; for (auto const &value : streamParameters) { StreamRole role; /* If role is invalid or not set default to viewfinder. */ if (!parseRole(&role, value.toKeyValues())) role = StreamRole::Viewfinder; roles.push_back(role); } return roles; } int StreamKeyValueParser::updateConfiguration(CameraConfiguration *config, const OptionValue &values) { if (!config) { std::cerr << "No configuration provided" << std::endl; return -EINVAL; } /* If no configuration values nothing to do. */ if (values.empty()) return 0; const std::vector<OptionValue> &streamParameters = values.toArray(); if (config->size() != streamParameters.size()) { std::cerr << "Number of streams in configuration " << config->size() << " does not match number of streams parsed " << streamParameters.size() << std::endl; return -EINVAL; } unsigned int i = 0; for (auto const &value : streamParameters) { KeyValueParser::Options opts = value.toKeyValues(); StreamConfiguration &cfg = config->at(i++); if (opts.isSet("width") && opts.isSet("height")) { cfg.size.width = opts["width"]; cfg.size.height = opts["height"]; } if (opts.isSet("pixelformat")) cfg.pixelFormat = PixelFormat::fromString(opts["pixelformat"].toString()); if (opts.isSet("colorspace")) cfg.colorSpace = ColorSpace::fromString(opts["colorspace"].toString()); } return 0; } bool StreamKeyValueParser::parseRole(StreamRole *role, const KeyValueParser::Options &options) { if (!options.isSet("role")) return false; std::string name = options["role"].toString(); if (name == "viewfinder") { *role = StreamRole::Viewfinder; return true; } else if (name == "video") { *role = StreamRole::VideoRecording; return true; } else if (name == "still") { *role = StreamRole::StillCapture; return true; } else if (name == "raw") { *role = StreamRole::Raw; return true; } return false; }