예제 #1
0
파일: h.c 프로젝트: pengyuwei/hackathon2014
int work_thread_start()
{
    Win *L1 = get_win("L1");
    Win *R1 = get_win("R1");

    start_work_thread(L1, R1);
    return 0;
}
void start_adpcm_voice_rec(void)
{
    remove(RTK_STORAGE_PCM_FILE);

    BTM_TRACE_ERROR1("%s\n", __FUNCTION__);
    if (adpcm_rec_cb.adpcm_state == NULL)
    {
       BTM_TRACE_DEBUG0("init the adpcm");
       adpcm_rec_cb.adpcm_state = adpcm_decode_alloc();
    }
    adpcm_rec_cb.n_20bytes_pkts = 0;

    if(!mutex_init)
    {
        const pthread_mutexattr_t attr = PTHREAD_MUTEX_RECURSIVE;
        pthread_mutex_init(&adpcm_rec_cb.mutex, &attr);
    }
    memset(&adpcm_voice_data_buffer,0,sizeof(adpcm_voice_data_buffer));
    UIPC_Open(UIPC_CH_ID_RTKBT_VR_AUDIO, voice_out_cb);
    UIPC_Ioctl(UIPC_CH_ID_RTKBT_VR_AUDIO, UIPC_SET_READ_POLL_TMO, 0);

    start_work_thread();
}