std::string print_entry(strvcfentry & region) { // III 5104 DEL00000002 N <DEL> . LowQual IMPRECISE;CIEND=-305,305;CIPOS=-305,305;SVTYPE=DEL;SVMETHOD=EMBL.DELLYv0.5.9;CHR2=III;END=15991;SVLEN=10887;CT=3to5;PE=2;MAPQ=60 GT:GL:GQ:FT:RC:DR:DV:RR:RV 1/1:-12,-0.602059,0:6:LowQual:816:0:2:0:0 std::ostringstream convert; // stream used for the conversion convert << region.start.chr; convert << "\t"; convert << region.start.pos; // insert the textual representation of 'Number' in the characters in the stream convert << "\t"; convert << trans_type(region.type); convert << "00"; convert << "Assym\tN\t<"; convert << trans_type(region.type); convert << ">\t.\tLowQual\tIMPRECISE;SVTYPE="; convert << trans_type(region.type); convert << ";SVMETHOD=PINDELv0.2.5a8;CHR2="; convert << region.stop.chr; convert << ";END="; convert << region.stop.pos; convert << ";SVLEN="; convert << region.stop.pos - region.start.pos; convert << ";PE="; convert << 1; convert << "\tGT:GL:GQ:FT:RC:DR:DV:RR:RV\t"; std::stringstream s; s << "1/1:0,0,0:0:PASS:0:0:"; s << 1; s << ":0:0"; //std::cout<<convert.str()<<std::endl; return convert.str(); }
strvcfentry create_entry(strregion region,double eval, int support, short type,int id) { strvcfentry tmp; // III 5104 DEL00000002 N <DEL> . LowQual IMPRECISE;CIEND=-305,305;CIPOS=-305,305;SVTYPE=DEL;SVMETHOD=EMBL.DELLYv0.5.9;CHR2=III;END=15991;SVLEN=10887;CT=3to5;PE=2;MAPQ=60 GT:GL:GQ:FT:RC:DR:DV:RR:RV 1/1:-12,-0.602059,0:6:LowQual:816:0:2:0:0 tmp.start = region.start; tmp.stop= region.stop; tmp.type=type; tmp.sup_lumpy=support; std::ostringstream convert; // stream used for the conversion convert << region.start.chr; convert << "\t"; convert << region.start.pos; // insert the textual representation of 'Number' in the characters in the stream convert << "\t"; convert << trans_type(type); convert << "00"; convert << id; convert << "LUM\tN\t<"; convert << trans_type(type) ; if(tmp.sup_lumpy<4){ convert << ">\t.\tLowQual\tIMPRECISE;SVTYPE="; }else{ convert << ">\t.\tPASS\tIMPRECISE;SVTYPE="; } convert << trans_type(type); convert << ";SVMETHOD=LUMPYv0.2.9;CHR2="; convert << region.stop.chr; convert << ";END="; convert << region.stop.pos; convert << ";EVAL="; convert << eval; if(tmp.type==3){ convert << ";SVLEN=0;PE="; }else{ convert << ";SVLEN="; convert << region.stop.pos-region.start.pos; convert << ";PE="; } convert <<support; convert <<"\tGT:GL:GQ:FT:RC:DR:DV:RR:RV\t"; tmp.header=convert.str(); std::stringstream s; s<<"1/1:0,0,0:0:PASS:0:0:"; s<<tmp.sup_lumpy; s<<":0:0"; tmp.calls["lumpy"]=s.str(); return tmp; }
static alloc_ret_t alloc_filter(dvb_priv_t *p_priv, dvb_section_t *p_sec) { RET_CODE pti_ret = ERR_FAILURE; h_pti_channel_t pti_handle = NULL; pti_alloc_param_t alloc_param = {0}; request_mode_t mode = DATA_SINGLE; MT_ASSERT(NULL != p_sec); p_sec->p_buffer = NULL; mode = p_priv->table_map[p_sec->table_map_index].request_mode; alloc_param.type = trans_type(p_sec->filter_mode); alloc_param.pid = p_sec->pid; if(p_sec->filter_code != NULL) { memcpy(alloc_param.code, p_sec->filter_code, MAX_FILTER_MASK_BYTES); } if(p_sec->filter_mask != NULL) { memcpy(alloc_param.mask, p_sec->filter_mask, MAX_FILTER_MASK_BYTES); } //p_sec->crc_enable = TRUE; alloc_param.crc_enable = p_sec->crc_enable; if(mode != DATA_MULTI) { alloc_param.buf_mode = PTI_BUF_MODE_LINEAR; } else { if(PTI_TYPE_TSPKT == alloc_param.type) { alloc_param.buf_mode = PTI_BUF_MODE_CIRCLE; } else { alloc_param.buf_mode = PTI_BUF_MODE_LINEAR_EXT; } alloc_param.p_ext_buf_list = (pti_ext_buf_t *)p_sec->p_ext_buf_list; } //OS_PRINTF("xxx alloc pti table_id 0x%x, t %d\n", p_sec->table_id, mtos_ticks_get()); pti_ret = pti_dev_channel_alloc(p_priv->p_pti_dev, &alloc_param, &pti_handle); p_sec->start_ticks = mtos_ticks_get(); if(SUCCESS == pti_ret) { MT_ASSERT(pti_handle != NULL); p_sec->pti_handle = pti_handle; return ALLOC_SUC; } else if(0)//(ERR_FAILURE == pti_ret) //what's the fail?? { return ALLOC_FAIL; } else { return ALLOC_FILTER_FULL; } }
static alloc_ret_t alloc_filter(dvb_priv_t *p_priv, dvb_section_t *p_sec) { RET_CODE pti_ret = ERR_FAILURE; dmx_chanid_t dmx_handle = 0xffff; u16 buf_id = 0; u8 *p_buffer = NULL; //pti_alloc_param_t alloc_param = {0}; dmx_slot_setting_t slot = {0}; dmx_filter_setting_t filter = {0}; request_mode_t mode = DATA_SINGLE; BOOL ret_boo = FALSE; u32 buf_size = 0; #ifndef WIN32 chip_ic_t chip_ic_id = hal_get_chip_ic_id(); #else chip_ic_t chip_ic_id = IC_MAGIC; #endif MT_ASSERT(NULL != p_sec); MT_ASSERT(p_sec->dmx_handle == 0xffff); p_sec->p_buffer = NULL; mode = p_priv->table_map[p_sec->table_map_index].request_mode; slot.type = trans_type(p_sec->filter_mode); slot.pid = p_sec->pid; slot.in = p_priv->current_ts_in; if(chip_ic_id == IC_CONCERTO) { slot.muldisp = DMX_SLOT_MUL_SEC_DIS_DISABLE;//for bug 63129 } //alloc_param.type = p_sec->filter_mode; //alloc_param.pid = p_sec->pid; if(p_sec->filter_code != NULL) { memcpy(filter.value, p_sec->filter_code, MAX_FILTER_MASK_BYTES); } if(p_sec->filter_mask != NULL) { memcpy(filter.mask, p_sec->filter_mask, MAX_FILTER_MASK_BYTES); } //p_sec->crc_enable = TRUE; filter.en_crc = p_sec->crc_enable; //hack for warriors bug 22712,37060, all use soft filter. if(p_sec->use_soft_filter == TRUE)// && mode == DATA_SINGLE) { slot.soft_filter_flag = TRUE; } if(DMX_CH_TYPE_TSPKT == slot.type) filter.ts_packet_mode = DMX_ONE_MODE; ret_boo = pop_simple_queue(p_priv->q_handle, p_priv->free_buffer_queue, &buf_id); if(!ret_boo) { return ALLOC_FILTER_FULL; } //MT_ASSERT(ret_boo == TRUE); //OS_PRINTF("xxx alloc pti table_id 0x%x, t %d\n", p_sec->table_id, mtos_ticks_get()); //pti_ret = pti_dev_channel_alloc(p_priv->p_pti_dev, &alloc_param, &pti_handle); pti_ret = dmx_si_chan_open(p_priv->p_dmx_dev, &slot, &dmx_handle); if(SUCCESS == pti_ret) { MT_ASSERT(dmx_handle != 0xffff); //ret_boo = pop_simple_queue(p_priv->q_handle, p_priv->free_buffer_queue, &buf_id); //MT_ASSERT(ret_boo == TRUE); if(mode != DATA_MULTI) { filter.continuous = FALSE; p_buffer = p_priv->p_data_buffer + buf_id * DATA_BUFFER_SIZE; buf_size = DATA_BUFFER_SIZE; if(DMX_CH_TYPE_TSPKT == slot.type) { buf_size = 192; OS_PRINTF("SET buf size 188 in ts packet mode \n"); } } else { filter.continuous = TRUE; p_buffer = p_sec->p_ext_buf_list->p_buf; buf_size = p_sec->p_ext_buf_list->size; } p_buffer = (u8 *)(((u32)p_buffer + 7) & (~7)); //align 4 pti_ret = dmx_si_chan_set_buffer(p_priv->p_dmx_dev, dmx_handle, p_buffer, buf_size); MT_ASSERT(SUCCESS == pti_ret); pti_ret = dmx_si_chan_set_filter(p_priv->p_dmx_dev, dmx_handle, &filter); MT_ASSERT(SUCCESS == pti_ret); pti_ret = dmx_chan_start(p_priv->p_dmx_dev, dmx_handle); MT_ASSERT(SUCCESS == pti_ret); p_sec->start_ticks = mtos_ticks_get(); push_simple_queue(p_priv->q_handle, p_priv->using_buffer_queue, buf_id); p_sec->dmx_handle = dmx_handle; p_sec->buf_id = buf_id; return ALLOC_SUC; } else if(0)//(ERR_FAILURE == pti_ret) //what's the fail?? { return ALLOC_FAIL; } else { push_simple_queue(p_priv->q_handle, p_priv->free_buffer_queue, buf_id); return ALLOC_FILTER_FULL; } }
const char* sip_trans::type_str() const { return trans_type(type); }