예제 #1
0
/**
 * 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();
}
예제 #2
0
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;
}
예제 #3
0
static obs_properties_t *pulse_output_properties(void *unused)
{
	UNUSED_PARAMETER(unused);

	return pulse_properties(false);
}
예제 #4
0
static obs_properties_t pulse_output_properties(void)
{
	return pulse_properties(false);
}
예제 #5
0
static obs_properties_t pulse_input_properties(void)
{
	return pulse_properties(true);
}
예제 #6
0
static obs_properties_t pulse_output_properties(const char *locale)
{
	return pulse_properties(locale, false);
}
예제 #7
0
static obs_properties_t pulse_input_properties(const char *locale)
{
	return pulse_properties(locale, true);
}