/** * Initialize the pulse audio context with properties and callback */ static void pulse_init_context() { pulse_lock(); pa_proplist *p = pulse_properties(); pulse_context = pa_context_new_with_proplist( pa_threaded_mainloop_get_api(pulse_mainloop), "OBS", p); pa_context_set_state_callback(pulse_context, pulse_context_state_changed, NULL); pa_context_connect(pulse_context, NULL, PA_CONTEXT_NOAUTOSPAWN, NULL); pa_proplist_free(p); pulse_unlock(); }
pa_stream* pulse_stream_new(const char* name, const pa_sample_spec* ss, const pa_channel_map* map) { if (pulse_context_ready() < 0) return NULL; pulse_lock(); pa_proplist *p = pulse_properties(); pa_stream *s = pa_stream_new_with_proplist( pulse_context, name, ss, map, p); pa_proplist_free(p); pulse_unlock(); return s; }
static obs_properties_t *pulse_output_properties(void *unused) { UNUSED_PARAMETER(unused); return pulse_properties(false); }
static obs_properties_t pulse_output_properties(void) { return pulse_properties(false); }
static obs_properties_t pulse_input_properties(void) { return pulse_properties(true); }
static obs_properties_t pulse_output_properties(const char *locale) { return pulse_properties(locale, false); }
static obs_properties_t pulse_input_properties(const char *locale) { return pulse_properties(locale, true); }