feat: add minimal HarmonyOS native napi skeleton
This commit is contained in:
1 parent
e328780ee5
commit
8b6e24fa61
11 files changed
+565
No files matched your search
@@ -0,0 +1,51 @@
|
||||
#ifndef MRP_PLATFORM_MRP_FACADE_H
|
||||
#define MRP_PLATFORM_MRP_FACADE_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "../input/InputEvent.h"
|
||||
|
||||
struct InitOptions {
|
||||
std::string workDir;
|
||||
int32_t width = 240;
|
||||
int32_t height = 320;
|
||||
bool debug = false;
|
||||
};
|
||||
|
||||
struct CommonResult {
|
||||
bool ok = false;
|
||||
int32_t errorCode = 0;
|
||||
std::string errorMessage;
|
||||
};
|
||||
|
||||
struct FrameResult {
|
||||
bool ok = false;
|
||||
bool hasNewFrame = false;
|
||||
int32_t width = 0;
|
||||
int32_t height = 0;
|
||||
std::string pixelFormat = "RGBA_8888";
|
||||
std::vector<uint8_t> buffer;
|
||||
int64_t frameId = 0;
|
||||
int32_t errorCode = 0;
|
||||
std::string errorMessage;
|
||||
};
|
||||
|
||||
class MrpFacade {
|
||||
public:
|
||||
CommonResult Init(const InitOptions &options);
|
||||
CommonResult LoadPackage(const std::string &packagePath);
|
||||
CommonResult Start();
|
||||
CommonResult Pause();
|
||||
CommonResult Resume();
|
||||
CommonResult SendInput(const MrpInputEvent &event);
|
||||
FrameResult PullFrame();
|
||||
CommonResult Release();
|
||||
|
||||
private:
|
||||
InitOptions options_;
|
||||
std::string packagePath_;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user