| | |
| | | * Created on: 2025年7月21日 |
| | | * Author: 86189 |
| | | */ |
| | | #include <stdio.h> |
| | | #include <cstdlib> |
| | | #include <cstring> |
| | | #include "config.h" |
| | |
| | | #include "moduleexport.h" |
| | | #include "crc.h" |
| | | |
| | | s32 Scene::str_delim(const s8* str, u8 logic_channel[]) |
| | | s32 Scene::str_delim(const s8* str, u16 logic_channel[]) |
| | | { |
| | | s8 pstr[32]; |
| | | s8 * ptr; |
| | |
| | | |
| | | ptr = strtok(NULL, "-"); |
| | | end = atoi(ptr); |
| | | while (start<=end) |
| | | if(start==end) return 0; |
| | | while (start <= end) |
| | | { |
| | | logic_channel[i++] = start++; |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | s32 Scene::convert_to_bin(s8* bin) |
| | | s32 Scene::convert_to_bin(u8* bin) |
| | | { |
| | | s32 i ,j; |
| | | struct FlowChartHead* flowchart = (struct FlowChartHead*)bin; |
| | | u32 size = sizeof(struct FlowChartHead); |
| | | s32 ninports,noutports; |
| | | u8 rxBufID[64],txBufID[64]; |
| | | u16 rxBufID[64],txBufID[64]; |
| | | |
| | | u16 dsp_input_num[2] ={0,0}; |
| | | u16 dsp_output_num[2] ={0,0}; |
| | | |
| | | s32 crc = 0xFFFFFFFF; |
| | | |
| | | if (!bin) return 0; |
| | | |
| | | struct Module *m = (struct Module *)(bin + size); |
| | | printf("proc list size %d\n", proc_list.size()); |
| | | |
| | | for (i=0; i< proc_list.size(); i++) { |
| | | struct Module *m = (struct Module *)(bin + size); |
| | | struct proc_field * p = &proc_list[i]; |
| | | Module *m = (struct Module *)(bin + size); |
| | | proc_field * p = &proc_list[i]; |
| | | |
| | | ninports = str_delim(p->inportstr, rxBufID) ; |
| | | noutports = str_delim(p->outportstr , txBufID) ; |
| | |
| | | if(p->proc_type == PROC_DUCKER || p->proc_type == PROC_CONTINUNOUS_SPL) { |
| | | //insert a mixer. |
| | | struct Module *mixer = (struct Module *)(bin + size); |
| | | u8 channelID[64]; |
| | | u16 channelID[64]; |
| | | |
| | | mixer->mDsp = 0; |
| | | mixer->mID = p->proc_id + 320; |
| | |
| | | } |
| | | } |
| | | |
| | | m->mDsp = p->dsp_index; |
| | | m->mDsp = hw_adapter->get_system_is_dual_dsp()?p->dsp_index:0; |
| | | m->mID = p->proc_id; |
| | | m->mType = p->proc_type; |
| | | m->mTag = p->tag; |
| | |
| | | } |
| | | |
| | | flowchart->module_num = proc_list.size(); |
| | | flowchart->crcLsb = 0; |
| | | flowchart->crcMsb = 0; |
| | | flowchart->compress = 0; |
| | | flowchart->version = 1; |
| | | flowchart->crc = 0; |
| | | |
| | | crc = CRC::crc32((const u8*)bin, size); |
| | | |
| | | flowchart->crcLsb = crc & 0xffff; |
| | | flowchart->crcMsb = crc >> 16; |
| | | flowchart->crc = crc; |
| | | return size; |
| | | } |
| | | |