c->parent.parent.free = core_free;
c->parent.process_msg = core_process_msg;
+ c->state = PA_CORE_STARTUP;
c->mainloop = m;
c->clients = pa_idxset_new(NULL, NULL);
c->sinks = pa_idxset_new(NULL, NULL);
pa_core_check_idle(c);
+ c->state = PA_CORE_RUNNING;
+
return c;
}
int j;
pa_assert(c);
+ c->state = PA_CORE_SHUTDOWN;
+
pa_module_unload_all(c);
pa_assert(!c->modules);
#include <pulsecore/sink-input.h>
#include <pulsecore/msgobject.h>
+typedef enum pa_core_state {
+ PA_CORE_STARTUP,
+ PA_CORE_RUNNING,
+ PA_CORE_SHUTDOWN
+} pa_core_state_t;
+
typedef enum pa_core_hook {
PA_CORE_HOOK_SINK_NEW,
PA_CORE_HOOK_SINK_FIXATE,
struct pa_core {
pa_msgobject parent;
+ pa_core_state_t state;
+
/* A random value which may be used to identify this instance of
* PulseAudio. Not cryptographically secure in any way. */
uint32_t cookie;