Lines Matching refs:sndmonitor
98 static sndmonitor_state_t sndmonitor; variable
149 list_add_tail(&sndmonitor.cards, &s->node); in add_new_sndcard()
280 sndmonitor.num_cards = num_cards; in enum_sndcards()
286 while (!list_empty(&sndmonitor.cards)) { in free_sndcards()
287 struct listnode * n = list_head(&sndmonitor.cards); in free_sndcards()
304 list_add_tail(&sndmonitor.dev_events, &d->node); in add_new_dev_event()
340 sndmonitor.num_dev_events = num_dev_events; in enum_dev_events()
346 while (!list_empty(&sndmonitor.dev_events)) { in free_dev_events()
347 struct listnode * n = list_head(&sndmonitor.dev_events); in free_dev_events()
366 if (sndmonitor.notify) in notify()
367 sndmonitor.notify(sndmonitor.target, str); in notify()
460 unsigned int num_poll_fds = sndmonitor.num_cards + in monitor_thread_loop()
461 sndmonitor.num_dev_events + 1/*pipe*/; in monitor_thread_loop()
467 pfd[0].fd = sndmonitor.intpipe[0]; in monitor_thread_loop()
472 list_for_each(node, &sndmonitor.cards) { in monitor_thread_loop()
479 list_for_each(node, &sndmonitor.dev_events) { in monitor_thread_loop()
524 list_for_each(node, &sndmonitor.cards) { in monitor_thread_loop()
540 list_for_each(node, &sndmonitor.dev_events) { in monitor_thread_loop()
588 hashmapLock(sndmonitor.listeners); in snd_mon_update()
589 hashmapForEach(sndmonitor.listeners, snd_cb, parms); in snd_mon_update()
590 hashmapUnlock(sndmonitor.listeners); in snd_mon_update()
597 sndmonitor.listeners = hashmapCreate(5, hashfn, hasheq); in listeners_init()
598 if (!sndmonitor.listeners) in listeners_init()
611 Hashmap * map = sndmonitor.listeners; in add_listener()
620 Hashmap * map = sndmonitor.listeners; in del_listener()
631 if (!sndmonitor.initcheck) in audio_extn_snd_mon_deinit()
634 write(sndmonitor.intpipe[1], "Q", 1); in audio_extn_snd_mon_deinit()
635 pthread_join(sndmonitor.monitor_thread, (void **) NULL); in audio_extn_snd_mon_deinit()
639 close(sndmonitor.intpipe[0]); in audio_extn_snd_mon_deinit()
640 close(sndmonitor.intpipe[1]); in audio_extn_snd_mon_deinit()
642 sndmonitor.initcheck = 0; in audio_extn_snd_mon_deinit()
648 sndmonitor.notify = snd_mon_update; in audio_extn_snd_mon_init()
649 sndmonitor.target = NULL; // unused for now in audio_extn_snd_mon_init()
650 list_init(&sndmonitor.cards); in audio_extn_snd_mon_init()
651 list_init(&sndmonitor.dev_events); in audio_extn_snd_mon_init()
652 sndmonitor.initcheck = false; in audio_extn_snd_mon_init()
654 if (pipe(sndmonitor.intpipe) < 0) in audio_extn_snd_mon_init()
667 int ret = pthread_create(&sndmonitor.monitor_thread, in audio_extn_snd_mon_init()
674 sndmonitor.initcheck = true; in audio_extn_snd_mon_init()
682 close(sndmonitor.intpipe[0]); in audio_extn_snd_mon_init()
683 close(sndmonitor.intpipe[1]); in audio_extn_snd_mon_init()
690 if (!sndmonitor.initcheck) { in audio_extn_snd_mon_register_listener()
700 if (!sndmonitor.initcheck) { in audio_extn_snd_mon_unregister_listener()