chenlh
2025-08-21 7534dda3b69026df6dc40b3d907b825a0078617b
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
77
78
79
80
81
82
83
84
/*
 * scene.h
 *
 *  Created on: 2025Äê7ÔÂ21ÈÕ
 *      Author: 86189
 */
 
#ifndef SCENE_H_
#define SCENE_H_
 
#include <vector>
#include <cstring>
#include <cstdio>
#include "hw_adapter.h"
#include "IModule.h"
#include "frames.h"
 
 
class proc_field{
public:
    s32 proc_id; // Ä£¿éID
    s32 proc_type; //Ä£¿éÀàÐÍ
    s8 inportstr[8];  //Ä£¿éÊäÈëÂß¼­¶Ë¿Ú ID
    s8 outportstr[8];  //Ä£¿éÊä³öÂß¼­¶Ë¿Ú ID
 
    s8 dsp_index;  //Ä£¿éËùÊôDSP,<0ÎÞЧ
    u8 fixed;  //Ä£¿éÊÇ·ñ¿É¸ü»»£¬0-¿É¸ü»»£¬1-²»¿É¸ü»»
    u8 pad =0;
    u8  physic_type ;//1:input,2-output.
 
    u32  tag; //Ä£¿étag±êÇ©ÓÐÓÃÐÅÏ¢
    void * parameters; //Ä£¿é²ÎÊý
 
    proc_field(s32 id, s32 type , const s8* inport_str,const s8* outport_str, s8 dsp_index, s8 is_fixed
            , void* param, u16 tag =0, u8 phy_type = 0){
        this->proc_id = id ;
        this->proc_type = type ;
        strncpy(inportstr, inport_str, 8);
        strncpy(outportstr, outport_str, 8);
        this->dsp_index = dsp_index;
        this->fixed = is_fixed ;
        this->parameters = param;
        this->tag = tag;
        this->physic_type = phy_type;
    }
};
 
class Scene
{
private:
protected:
    std::vector<proc_field> proc_list;
    std::vector<u16> mModuleIndex;
#define __MADD(p1,p2,p3,p4,p5,p6,p7,p8,p9) proc_list.push_back(proc_field(p1,p2,p3,p4,p5,p6,p7,p8,p9))
    hw_adapter_t* hw_adapter = NULL;
 
public:
    virtual ~Scene() {
        proc_list.clear();
        delete hw_adapter;
    }
 
    Scene(hw_adapter_t* adapter) {
        hw_adapter = adapter;
    }
    hw_adapter_t* get_base_hw_adapter() {
        return hw_adapter;
    }
    //½âÎöinportstrºÍoutportstr,
    //×Ö·û´®×ª»»³ÉÂß¼­¶Ë¿ÚºÅ,·µ»ØÊäÈëÊä³ö¶Ë¿ÚÊýÁ¿.
    s32 str_delim(const s8* str, u16 logic_channel[]) ;
 
    virtual uvoid* get_module_param_ptr(uvoid *param, s32 fixed) =0;
    //¸ù¾ÝÄ£¿éÀàÐ͸üÐÂÄ£¿éÐÅÏ¢.
    virtual s32 update_module() =0;
    //³É¹¦·µ»Ø0£¬Ê§°Ü·µ»Ø-1(ÄÚÈÝ´íÎó¡¢´óС²»Æ¥ÅäµÈ).
    virtual s32 set_parameters_content(uvoid* param, s32 size) =0;
 
    virtual u32 get_module_id(u32 mid, s32 mtype ,u32 pid) =0;
 
    s32 convert_to_bin(u8* bin);
};
 
#endif