#include "cc_config.h" #include "cc_type.h" #include "cc_def.h" #include "cc_private.h" /*config*/ #define MAX_NUM_USER_MSGQ (CC_NUM_PIC_USER_Q+8) //user message°¡ Àֱ⠶§¹®¿¡ 8À» ´õ Ãß°¡ÇÔ /* variables */ static struct { tDCCDDI_MSGQ p_user_msgq_id; tDCCDDI_SEM p_sync_mtx_id; tDCCDDI_SEM p_sync_sem_id; int num_msgq; struct { UINT32 duration; //ms ´ÜÀ§ UINT32 start_ms; UINT32 prev_ms; UINT32 opt; } timer_list[MAX_NUM_TIMER]; BOOL buser_msg_on; BOOL brst_ready; } p_main_attr; #define ATTR(i) p_main_attr.i static BOOL b_cc_main_inited=FALSE; #if 0 __Local_Func__() {} #endif static void p_proc_user_data(tDCC_PicUDRaw *praw_pud) { tDCC_CMD send_msg; if(!ATTR(p_user_msgq_id) || !ATTR(buser_msg_on)) return; send_msg.cmd=eCMD_USER_DATA; send_msg.opt=0; send_msg.param1=(UINT32)praw_pud; send_msg.param2=0; CCPRINT("send_ud", "sending user data, pic_type: %d, pts : %ud, size: %d\n", praw_pud->pic_type, praw_pud->data, praw_pud->size); if(DCCExec_IsCurDLY()) { //pud °Ë»öÇØ¼­ DLC¸¦ ã¾Æ¾ß ÇÔ. UINT8 *buf=praw_pud->data; int i; BOOL bdlc_send=FALSE; for(i=0; i<(buf[5]&0x1f); i++) { if(7+i*3+2>=praw_pud->size) { break; } if((buf[7+i*3]&0x3)==0x3) { if(buf[7+i*3+2]==0x8E) { //DLC DCCExec_ProcessMsg(eCMD_DLC, 0, 0, 0); //delay cancelÀ» ³¯¸². bdlc_send=TRUE; } else if(buf[7+i*3+2]==0x8F) { //RST DCCExec_ProcessMsg(eCMD_DLC, 0, 0, 0); //delay cancelÀ» ³¯¸². bdlc_send=TRUE; } } else if((buf[7+i*3]&0x3)==0x2) { if(buf[7+i*3+1]==0x8E || buf[7+i*3+2]==0x8E) { //DLC DCCExec_ProcessMsg(eCMD_DLC, 0, 0, 0); //delay cancelÀ» ³¯¸². bdlc_send=TRUE; } else if(buf[7+i*3+1]==0x8F || buf[7+i*3+2]==0x8F) { //RST DCCExec_ProcessMsg(eCMD_DLC, 0, 0, 0); //delay cancelÀ» ³¯¸². bdlc_send=TRUE; } } } if(!bdlc_send && ATTR(num_msgq)>=CC_NUM_PIC_USER_Q*2/3) { DCCExec_ProcessMsg(eCMD_DLC, 0, 0, 0); //delay cancelÀ» ³¯¸². } } DCCDDI_SendMessage(ATTR(p_user_msgq_id), &send_msg, sizeof(send_msg)); ATTR(num_msgq)++; } #if 0 __Task__() {} #endif static void p_cc_task(UINT32 arg) { int ret; int rcv_len; int i; tDCC_PicUDRaw *pic_ud_raw=NULL, *pic_ud_buf=NULL; //pic_ud_buf´Â reorderingÀ» À§ÇØ ÇÊ¿äÇÔ. tDCC_PicUD pic_ud; tDCC_CMD user_msg; while(1) { //±ú¾î³¯ ½Ã°¢ °è»ê int min_ms=0x7fffffff; // int min_id=MAX_NUM_TIMER; //±ú¾î³¯ ½Ã°£ °è»ê for(i=0; i=0 && ATTR(num_msgq)pic_type, pic_ud_raw->data, pic_ud_raw->size); #else CCPRINT("parse_ud", "user data coming, pic_type(%d) !!\n", pic_ud_raw->pic_type); #endif #if 1 // reordering ÇÊ¿äÇÑ °æ¿ì //adjust in cc ddi if(pic_ud_raw->pic_type==eDCC_PIC_CT_I || pic_ud_raw->pic_type==eDCC_PIC_CT_P) { if(pic_ud_buf) { //Ȥ½Ã backupÀ» ÇØ ³õÀº °ÍÀÌ ÀÖÀ¸¸é ½ÇÇàÇÔ. DCCFront_ParsePicUD(pic_ud_buf, &pic_ud); pic_ud_buf=NULL; } //backup pic_ud_buf=pic_ud_raw; } else { DCCFront_ParsePicUD(pic_ud_raw, &pic_ud); } #else // reordering ¾È ÇÏ´Â °æ¿ì DCCFront_ParsePicUD(pic_ud_raw, &pic_ud); pic_ud_raw->isUsing = 0; #endif break; case eCMD_SET_TIMER : if(user_msg.param1 ATTR(timer_list)[i].duration) { DCCExec_ProcessMsg(eCMD_TIMER, 0, i, CC_MS_PASS(ATTR(timer_list)[i].start_ms)); ATTR(timer_list)[i].prev_ms=DCCDDI_GetCurMs(); if(ATTR(timer_list)[i].opt & eDCC_OPT_TIMER_ONESHOT) { ATTR(timer_list)[i].duration=TIMER_NOUSE; } } } } DHL_OS_SelfDeleteTask(); } #if 0 __APIs__() {} #endif void DCCMain_Init() { int i; if(!b_cc_main_inited) { for(i=0; i