#pragma once #include #include #include #include "hw/i_decoder.h" #include "hw/i_encoder.h" #include "hw/i_image_processor.h" #include "hw/i_infer_backend.h" #include "utils/result.h" namespace rk3588 { class AtlasInferBackend : public IInferBackend { public: ModelHandle LoadModel(const std::string& /*model_path*/, std::string& err) override { err = "atlas infer backend not supported"; return kInvalidModelHandle; } void UnloadModel(ModelHandle /*handle*/) override {} bool GetModelInfo(ModelHandle /*handle*/, ModelInfo& /*info*/) const override { return false; } InferResult Infer(ModelHandle /*handle*/, const InferInput& /*input*/) override { InferResult res; res.success = false; res.error = "atlas infer backend not supported"; return res; } AiScheduler::BorrowedInferResult InferBorrowed(ModelHandle /*handle*/, const InferInput& /*input*/) override { AiScheduler::BorrowedInferResult res; res.success = false; res.error = "atlas infer backend not supported"; return res; } }; class AtlasImageProcessor : public IImageProcessor { public: Status Resize(const Frame& /*src*/, Frame& /*dst*/) override { return FailStatus("atlas image processor not supported"); } Status CvtColor(const Frame& /*src*/, Frame& /*dst*/, PixelFormat /*dst_format*/) override { return FailStatus("atlas image processor not supported"); } Status Normalize(const Frame& /*src*/, std::vector& /*out*/, const std::vector& /*mean*/, const std::vector& /*std*/) override { return FailStatus("atlas image processor not supported"); } }; class AtlasDecoder : public IDecoder { public: Status Open(const SimpleJson& /*config*/) override { return FailStatus("atlas decoder not supported"); } Status Send(const DecodePacket& /*packet*/) override { return FailStatus("atlas decoder not supported"); } Result> Receive() override { return MakeError>("atlas decoder not supported"); } void Close() override {} }; class AtlasEncoder : public IEncoder { public: Status Open(const SimpleJson& /*config*/) override { return FailStatus("atlas encoder not supported"); } Status Send(const std::shared_ptr& /*frame*/) override { return FailStatus("atlas encoder not supported"); } Result Receive() override { return MakeError("atlas encoder not supported"); } std::vector ExtraData() const override { return {}; } void Close() override {} }; } // namespace rk3588