/* * Initialize mixer control thread */ int mixer_init(void) { msgqueue_init(&mixerq); pthread_t mixerthread; pthread_mutex_init(&mixer_mutex, NULL); pthread_cond_init(&state_cond, NULL); pthread_create(&mixerthread, NULL, (void *) mixer_msg_loop, NULL); bitmap_load(&volume_control, "gfx/volume.u16"); volume_backing.width = volume_control.width; volume_backing.height = volume_control.height; volume_backing.bitmap = malloc(volume_control.width * volume_control.height * sizeof(__u16)); volume_backing.x = 0; volume_backing.y = 0; if (!volume_backing.bitmap) { /* out of memory already, we are in trouble...... */ DBG_PRINTF("mixer: out-of-memory\n"); return -1; } set_volume(master_volume, master_volume); return 0; }
void init_avplay(struct avplay_t* avplay, struct codecs_t* codecs) { msgqueue_init(&avplay->msgqueue); avplay->url = NULL; avplay->next_url = NULL; avplay->codecs = codecs; avplay->duration = -1; avplay->PTS = -1; pthread_mutex_init(&avplay->mutex,NULL); pthread_create(&avplay->thread,NULL,(void * (*)(void *))avplay_thread,avplay); }
msgqueue::msgqueue() { m_pForm = (Control *) msgqueue_init (); }