#include "hw/hw_factory.h" #include #include "hw/atlas_defaults.h" #include "hw/jetson_defaults.h" #include "hw/rk3588_defaults.h" namespace rk3588 { namespace { std::string NormalizePlatform(const SimpleJson& config) { std::string platform = config.ValueOr("platform", ""); if (platform.empty()) { platform = config.ValueOr("hw_platform", ""); } if (platform.empty()) { return "rk3588"; } std::string normalized; normalized.reserve(platform.size()); for (char c : platform) { if (!std::isspace(static_cast(c))) { normalized.push_back(static_cast(std::tolower(static_cast(c)))); } } return normalized.empty() ? "rk3588" : normalized; } } // namespace std::shared_ptr HwFactory::CreateInferBackend(const SimpleJson& config) { const std::string platform = NormalizePlatform(config); if (platform == "atlas") { return std::make_shared(); } if (platform == "jetson") { return std::make_shared(); } return std::make_shared(); } std::shared_ptr HwFactory::CreateImageProcessor(const SimpleJson& config) { const std::string platform = NormalizePlatform(config); if (platform == "atlas") { return std::make_shared(); } if (platform == "jetson") { return std::make_shared(); } return std::make_shared(config); } std::shared_ptr HwFactory::CreateDecoder(const SimpleJson& config) { const std::string platform = NormalizePlatform(config); if (platform == "atlas") { return std::make_shared(); } if (platform == "jetson") { return std::make_shared(); } return std::make_shared(); } std::shared_ptr HwFactory::CreateEncoder(const SimpleJson& config) { const std::string platform = NormalizePlatform(config); if (platform == "atlas") { return std::make_shared(); } if (platform == "jetson") { return std::make_shared(); } return std::make_shared(); } } // namespace rk3588