hc
2023-03-21 4b55d97acc464242bcd6a8ae77b8ff37c22dec58
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
 * algo_loader.h - The dynamic loads algorithm library
 *
 *  Copyright (c) 2021 Rockchip Electronics Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Author: Cody Xie <cody.xie@rock-chips.com>
 */
#ifndef ALGOS_AEIS_EIS_LOADER_H
#define ALGOS_AEIS_EIS_LOADER_H
 
#include <string>
 
#include "dvs_app.h"
#include "rk_aiq_mems_sensor.h"
 
namespace RkCam {
 
using dvsRegisterRemap   = int (*)(struct dvsEngine* engine, dvsFrameCallBackFEC callback);
using dvsPrepare         = int (*)(struct dvsEngine* engine);
using getMeshSize        = void (*)(int image_height, int image_width, int* mesh_size);
using getOriginalMeshXY  = void (*)(int image_width, int image_height, double clip_ratio_x, double clip_ratio_y, meshxyFEC* pmesh_fec);
using dvsPutImageFrame   = int (*)(struct dvsEngine* engine, struct imageData* pimage_data);
using dvsPutMesh         = int (*)(struct dvsEngine* engine, struct meshxyFEC* pmesh_fec);
using dvsPutImuFrame     = int (*)(struct dvsEngine* engine, mems_sensor_event_s* pimu_data,
                               int buff_number);
using dvsInitFromXmlFile = int (*)(struct dvsEngine* engine, const char* path);
using dvsInitParams      = int (*)(struct dvsEngine* engine, struct initialParams* init_params);
using dvsStart           = int (*)(struct dvsEngine* engine);
using dvsRequestStop     = int (*)(struct dvsEngine* engine);
using dvsDeinit          = int (*)(struct dvsEngine* engine);
 
struct DvsOps {
    dvsRegisterRemap RegisterRemap;
    dvsPrepare Prepare;
    getMeshSize GetMeshSize;
    getOriginalMeshXY GetOriginalMeshXY;
    dvsPutImageFrame PutImageFrame;
    dvsPutMesh PutMesh;
    dvsPutImuFrame PutImuFrame;
    dvsInitFromXmlFile InitFromXmlFile;
    dvsInitParams InitParams;
    dvsStart Start;
    dvsRequestStop RequestStop;
    dvsDeinit DeInit;
};
 
class DvsLibrary {
 public:
    DvsLibrary() = default;
    virtual ~DvsLibrary();
 
    bool Init();
    bool LoadSymbols();
 
    DvsOps* GetOps();
 
 private:
    void* handle_;
    DvsOps ops_;
};
 
};  // namespace RkCam
 
#endif  // ALGOS_AEIS_EIS_LOADER_H