void *dmb_consumer_thread(void *arg) { #if !defined(RTV_TDMB_MULTI_SUB_CHANNEL_ENABLE) MTV_TS_PKT_INFO *tsp; #else TDMB_CIF_TS_INFO *tsp; int i; #endif printf("[dmb_consumer_thread] Entered\n"); for(;;) { /* Wait for the data event. */ mrevent_wait(&ts_read_event); /* Clear the data event. */ mrevent_reset(&ts_read_event); if(dmb_thread_run == 0) { break; } #if !defined(RTV_TDMB_MULTI_SUB_CHANNEL_ENABLE) while((tsp=(MTV_TS_PKT_INFO *)queue_get(&tsp_queue_cb)) != NULL) { #ifdef _TS_FILE_DUMP_ENABLE switch( tv_mode ) /* 0: 1seg, 1: T_DMB, 2: FM */ { case 0 : fwrite(tsp->msc_buf, sizeof(char), tsp->len, fd_isdbt_ts); break; case 1 : fwrite(tsp->msc_buf, sizeof(char), tsp->len, fd_tdmb_ts); break; case 2 : break; default: break; } #endif check_video_pid(tsp->msc_buf, tsp->len); queue_put(&tsp_pool_cb, (unsigned int)tsp); } #else while((tsp=(TDMB_CIF_TS_INFO *)queue_get(&tsp_queue_cb)) != NULL) { for(i=0; i<RTV_MAX_NUM_MULTI_SUB_CHANNEL; i++) { if(tsp->msc_size[i] != 0) { printf("\t (%d) Subch ID: %d: Subch Size: %d\n", i, tsp->msc_subch_id[i], tsp->msc_size[i]); printf("[0x%02X], [0x%02X], [0x%02X], [0x%02X]\n", tsp->msc_buf[i][0], tsp->msc_buf[i][1], tsp->msc_buf[i][2],tsp->msc_buf[i][3]); } } queue_put(&tsp_pool_cb, (unsigned int)tsp); } #endif } printf("[dmb_consumer_thread] Exit...\n"); pthread_exit((void *)NULL); }
void wait() { mrevent_wait(m_event); }