mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
Merge branch 'master' of git://0pointer.de/pulseaudio into dbus-work
Conflicts: src/modules/module-stream-restore.c
This commit is contained in:
commit
0ad2d55cbe
46 changed files with 720 additions and 173 deletions
|
|
@ -662,6 +662,21 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *m, void *us
|
|||
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
|
||||
} else if (dbus_message_is_signal(m, "org.bluez.Device", "DisconnectRequested")) {
|
||||
pa_bluetooth_device *d;
|
||||
|
||||
if ((d = pa_hashmap_get(y->devices, dbus_message_get_path(m)))) {
|
||||
/* Device will disconnect in 2 sec */
|
||||
d->audio_state = PA_BT_AUDIO_STATE_DISCONNECTED;
|
||||
d->audio_sink_state = PA_BT_AUDIO_STATE_DISCONNECTED;
|
||||
d->audio_source_state = PA_BT_AUDIO_STATE_DISCONNECTED;
|
||||
d->headset_state = PA_BT_AUDIO_STATE_DISCONNECTED;
|
||||
|
||||
run_callback(y, d, FALSE);
|
||||
}
|
||||
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
|
||||
} else if (dbus_message_is_signal(m, "org.freedesktop.DBus", "NameOwnerChanged")) {
|
||||
const char *name, *old_owner, *new_owner;
|
||||
|
||||
|
|
@ -775,6 +790,7 @@ pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *c) {
|
|||
"type='signal',sender='org.bluez',interface='org.bluez.Adapter',member='DeviceRemoved'",
|
||||
"type='signal',sender='org.bluez',interface='org.bluez.Adapter',member='DeviceCreated'",
|
||||
"type='signal',sender='org.bluez',interface='org.bluez.Device',member='PropertyChanged'",
|
||||
"type='signal',sender='org.bluez',interface='org.bluez.Device',member='DisconnectRequested'",
|
||||
"type='signal',sender='org.bluez',interface='org.bluez.Audio',member='PropertyChanged'",
|
||||
"type='signal',sender='org.bluez',interface='org.bluez.Headset',member='PropertyChanged'",
|
||||
"type='signal',sender='org.bluez',interface='org.bluez.AudioSink',member='PropertyChanged'",
|
||||
|
|
@ -828,6 +844,7 @@ void pa_bluetooth_discovery_unref(pa_bluetooth_discovery *y) {
|
|||
"type='signal',sender='org.bluez',interface='org.bluez.Adapter',member='DeviceRemoved'",
|
||||
"type='signal',sender='org.bluez',interface='org.bluez.Adapter',member='DeviceCreated'",
|
||||
"type='signal',sender='org.bluez',interface='org.bluez.Device',member='PropertyChanged'",
|
||||
"type='signal',sender='org.bluez',interface='org.bluez.Device',member='DisconnectRequested'",
|
||||
"type='signal',sender='org.bluez',interface='org.bluez.Audio',member='PropertyChanged'",
|
||||
"type='signal',sender='org.bluez',interface='org.bluez.Headset',member='PropertyChanged'",
|
||||
"type='signal',sender='org.bluez',interface='org.bluez.AudioSink',member='PropertyChanged'",
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ static pa_hook_result_t load_module_for_device(pa_bluetooth_discovery *y, const
|
|||
|
||||
mi = pa_hashmap_get(u->hashmap, d->path);
|
||||
|
||||
pa_log("dead: %d, device_connected: %d, audio_state: %d, audio_source_state: %d", d->dead, d->device_connected, d->audio_state, d->audio_source_state);
|
||||
if (!d->dead &&
|
||||
d->device_connected > 0 && (d->audio_state >= PA_BT_AUDIO_STATE_CONNECTED || d->audio_source_state >= PA_BT_AUDIO_STATE_CONNECTED)) {
|
||||
|
||||
|
|
|
|||
|
|
@ -844,8 +844,9 @@ static int output_create_sink_input(struct output *o) {
|
|||
pa_sink_input_new_data_set_channel_map(&data, &o->userdata->sink->channel_map);
|
||||
data.module = o->userdata->module;
|
||||
data.resample_method = o->userdata->resample_method;
|
||||
data.flags = PA_SINK_INPUT_VARIABLE_RATE|PA_SINK_INPUT_DONT_MOVE|PA_SINK_INPUT_NO_CREATE_ON_SUSPEND;
|
||||
|
||||
pa_sink_input_new(&o->sink_input, o->userdata->core, &data, PA_SINK_INPUT_VARIABLE_RATE|PA_SINK_INPUT_DONT_MOVE|PA_SINK_INPUT_NO_CREATE_ON_SUSPEND);
|
||||
pa_sink_input_new(&o->sink_input, o->userdata->core, &data);
|
||||
|
||||
pa_sink_input_new_data_done(&data);
|
||||
|
||||
|
|
|
|||
|
|
@ -812,7 +812,7 @@ int pa__init(pa_module*m) {
|
|||
pa_sink_input_new_data_set_sample_spec(&sink_input_data, &ss);
|
||||
pa_sink_input_new_data_set_channel_map(&sink_input_data, &map);
|
||||
|
||||
pa_sink_input_new(&u->sink_input, m->core, &sink_input_data, 0);
|
||||
pa_sink_input_new(&u->sink_input, m->core, &sink_input_data);
|
||||
pa_sink_input_new_data_done(&sink_input_data);
|
||||
|
||||
if (!u->sink_input)
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ static void adjust_rates(struct userdata *u) {
|
|||
(double) u->latency_snapshot.source_latency / PA_USEC_PER_MSEC,
|
||||
((double) u->latency_snapshot.sink_latency + buffer_latency + u->latency_snapshot.source_latency) / PA_USEC_PER_MSEC);
|
||||
|
||||
pa_log_info("Should buffer %lu bytes, buffered at minimum %lu bytes",
|
||||
pa_log_info("Should buffer %zu bytes, buffered at minimum %zu bytes",
|
||||
u->latency_snapshot.max_request*2,
|
||||
u->latency_snapshot.min_memblockq_length);
|
||||
|
||||
|
|
@ -676,8 +676,9 @@ int pa__init(pa_module *m) {
|
|||
pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_ROLE, "abstract");
|
||||
pa_sink_input_new_data_set_sample_spec(&sink_input_data, &ss);
|
||||
pa_sink_input_new_data_set_channel_map(&sink_input_data, &map);
|
||||
sink_input_data.flags = PA_SINK_INPUT_VARIABLE_RATE;
|
||||
|
||||
pa_sink_input_new(&u->sink_input, m->core, &sink_input_data, PA_SINK_INPUT_VARIABLE_RATE);
|
||||
pa_sink_input_new(&u->sink_input, m->core, &sink_input_data);
|
||||
pa_sink_input_new_data_done(&sink_input_data);
|
||||
|
||||
if (!u->sink_input)
|
||||
|
|
@ -709,7 +710,7 @@ int pa__init(pa_module *m) {
|
|||
pa_source_output_new_data_set_sample_spec(&source_output_data, &ss);
|
||||
pa_sink_input_new_data_set_channel_map(&sink_input_data, &map);
|
||||
|
||||
pa_source_output_new(&u->source_output, m->core, &source_output_data, 0);
|
||||
pa_source_output_new(&u->source_output, m->core, &source_output_data);
|
||||
pa_source_output_new_data_done(&source_output_data);
|
||||
|
||||
if (!u->source_output)
|
||||
|
|
|
|||
|
|
@ -406,8 +406,9 @@ int pa__init(pa_module*m) {
|
|||
pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_ROLE, "filter");
|
||||
pa_sink_input_new_data_set_sample_spec(&sink_input_data, &ss);
|
||||
pa_sink_input_new_data_set_channel_map(&sink_input_data, &stream_map);
|
||||
sink_input_data.flags = (remix ? 0 : PA_SINK_INPUT_NO_REMIX);
|
||||
|
||||
pa_sink_input_new(&u->sink_input, m->core, &sink_input_data, (remix ? 0 : PA_SINK_INPUT_NO_REMIX));
|
||||
pa_sink_input_new(&u->sink_input, m->core, &sink_input_data);
|
||||
pa_sink_input_new_data_done(&sink_input_data);
|
||||
|
||||
if (!u->sink_input)
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ int pa__init(pa_module*m) {
|
|||
pa_proplist_setf(data.proplist, "sine.hz", "%u", frequency);
|
||||
pa_sink_input_new_data_set_sample_spec(&data, &ss);
|
||||
|
||||
pa_sink_input_new(&u->sink_input, m->core, &data, 0);
|
||||
pa_sink_input_new(&u->sink_input, m->core, &data);
|
||||
pa_sink_input_new_data_done(&data);
|
||||
|
||||
if (!u->sink_input)
|
||||
|
|
|
|||
|
|
@ -1834,6 +1834,10 @@ static int extension_cb(pa_native_protocol *p, pa_module *m, pa_native_connectio
|
|||
data.data = &entry;
|
||||
data.size = sizeof(entry);
|
||||
|
||||
pa_log_debug("Client %s changes entry %s.",
|
||||
pa_strnull(pa_proplist_gets(pa_native_connection_get_client(c)->proplist, PA_PROP_APPLICATION_PROCESS_BINARY)),
|
||||
name);
|
||||
|
||||
if (pa_database_set(u->database, &key, &data, mode == PA_UPDATE_REPLACE) == 0) {
|
||||
#ifdef HAVE_DBUS
|
||||
struct dbus_entry *de;
|
||||
|
|
@ -1846,8 +1850,8 @@ static int extension_cb(pa_native_protocol *p, pa_module *m, pa_native_connectio
|
|||
send_device_updated_signal(de, &entry);
|
||||
|
||||
if ((old->volume_valid != entry.volume_valid)
|
||||
|| (entry.volume_valid
|
||||
&& (!pa_cvolume_equal(&entry.volume, &old->volume) || !pa_channel_map_equal(&entry.channel_map, &old->channel_map))))
|
||||
|| (entry.volume_valid && (!pa_cvolume_equal(&entry.volume, &old->volume)
|
||||
|| !pa_channel_map_equal(&entry.channel_map, &old->channel_map))))
|
||||
send_volume_updated_signal(de, &entry);
|
||||
|
||||
if (!old->muted_valid || (entry.muted != old->muted))
|
||||
|
|
|
|||
|
|
@ -145,6 +145,9 @@ static pa_hook_result_t sink_input_fixate_hook_cb(pa_core *c, pa_sink_input_new_
|
|||
pa_assert(data);
|
||||
pa_assert(u);
|
||||
|
||||
if (data->flags & PA_SINK_INPUT_START_CORKED)
|
||||
return PA_HOOK_OK;
|
||||
|
||||
if ((d = pa_hashmap_get(u->device_infos, data->sink)))
|
||||
resume(d);
|
||||
|
||||
|
|
@ -158,6 +161,9 @@ static pa_hook_result_t source_output_fixate_hook_cb(pa_core *c, pa_source_outpu
|
|||
pa_assert(data);
|
||||
pa_assert(u);
|
||||
|
||||
if (data->flags & PA_SOURCE_OUTPUT_START_CORKED)
|
||||
return PA_HOOK_OK;
|
||||
|
||||
if (data->source->monitor_of)
|
||||
d = pa_hashmap_get(u->device_infos, data->source->monitor_of);
|
||||
else
|
||||
|
|
@ -226,11 +232,16 @@ static pa_hook_result_t sink_input_move_start_hook_cb(pa_core *c, pa_sink_input
|
|||
|
||||
static pa_hook_result_t sink_input_move_finish_hook_cb(pa_core *c, pa_sink_input *s, struct userdata *u) {
|
||||
struct device_info *d;
|
||||
pa_sink_input_state_t state;
|
||||
|
||||
pa_assert(c);
|
||||
pa_sink_input_assert_ref(s);
|
||||
pa_assert(u);
|
||||
|
||||
state = pa_sink_input_get_state(s);
|
||||
if (state != PA_SINK_INPUT_RUNNING && state != PA_SINK_INPUT_DRAINED)
|
||||
return PA_HOOK_OK;
|
||||
|
||||
if ((d = pa_hashmap_get(u->device_infos, s->sink)))
|
||||
resume(d);
|
||||
|
||||
|
|
@ -265,6 +276,9 @@ static pa_hook_result_t source_output_move_finish_hook_cb(pa_core *c, pa_source_
|
|||
pa_source_output_assert_ref(s);
|
||||
pa_assert(u);
|
||||
|
||||
if (pa_source_output_get_state(s) != PA_SOURCE_OUTPUT_RUNNING)
|
||||
return PA_HOOK_OK;
|
||||
|
||||
if (s->source->monitor_of)
|
||||
d = pa_hashmap_get(u->device_infos, s->source->monitor_of);
|
||||
else
|
||||
|
|
@ -279,6 +293,7 @@ static pa_hook_result_t source_output_move_finish_hook_cb(pa_core *c, pa_source_
|
|||
static pa_hook_result_t sink_input_state_changed_hook_cb(pa_core *c, pa_sink_input *s, struct userdata *u) {
|
||||
struct device_info *d;
|
||||
pa_sink_input_state_t state;
|
||||
|
||||
pa_assert(c);
|
||||
pa_sink_input_assert_ref(s);
|
||||
pa_assert(u);
|
||||
|
|
@ -292,15 +307,11 @@ static pa_hook_result_t sink_input_state_changed_hook_cb(pa_core *c, pa_sink_inp
|
|||
}
|
||||
|
||||
static pa_hook_result_t source_output_state_changed_hook_cb(pa_core *c, pa_source_output *s, struct userdata *u) {
|
||||
pa_source_output_state_t state;
|
||||
|
||||
pa_assert(c);
|
||||
pa_source_output_assert_ref(s);
|
||||
pa_assert(u);
|
||||
|
||||
state = pa_source_output_get_state(s);
|
||||
|
||||
if (state == PA_SOURCE_OUTPUT_RUNNING) {
|
||||
if (pa_source_output_get_state(s) == PA_SOURCE_OUTPUT_RUNNING) {
|
||||
struct device_info *d;
|
||||
|
||||
if (s->source->monitor_of)
|
||||
|
|
@ -387,22 +398,17 @@ static pa_hook_result_t device_state_changed_hook_cb(pa_core *c, pa_object *o, s
|
|||
pa_sink *s = PA_SINK(o);
|
||||
pa_sink_state_t state = pa_sink_get_state(s);
|
||||
|
||||
if (pa_sink_check_suspend(s) <= 0) {
|
||||
|
||||
if (pa_sink_check_suspend(s) <= 0)
|
||||
if (PA_SINK_IS_OPENED(state))
|
||||
restart(d);
|
||||
|
||||
}
|
||||
|
||||
} else if (pa_source_isinstance(o)) {
|
||||
pa_source *s = PA_SOURCE(o);
|
||||
pa_source_state_t state = pa_source_get_state(s);
|
||||
|
||||
if (pa_source_check_suspend(s) <= 0) {
|
||||
|
||||
if (pa_source_check_suspend(s) <= 0)
|
||||
if (PA_SOURCE_IS_OPENED(state))
|
||||
restart(d);
|
||||
}
|
||||
}
|
||||
|
||||
return PA_HOOK_OK;
|
||||
|
|
|
|||
|
|
@ -501,8 +501,9 @@ static struct session *session_new(struct userdata *u, const pa_sdp_info *sdp_in
|
|||
pa_proplist_setf(data.proplist, "rtp.payload", "%u", (unsigned) sdp_info->payload);
|
||||
data.module = u->module;
|
||||
pa_sink_input_new_data_set_sample_spec(&data, &sdp_info->sample_spec);
|
||||
data.flags = PA_SINK_INPUT_VARIABLE_RATE;
|
||||
|
||||
pa_sink_input_new(&s->sink_input, u->module->core, &data, PA_SINK_INPUT_VARIABLE_RATE);
|
||||
pa_sink_input_new(&s->sink_input, u->module->core, &data);
|
||||
pa_sink_input_new_data_done(&data);
|
||||
|
||||
if (!s->sink_input) {
|
||||
|
|
|
|||
|
|
@ -330,8 +330,9 @@ int pa__init(pa_module*m) {
|
|||
data.source = s;
|
||||
pa_source_output_new_data_set_sample_spec(&data, &ss);
|
||||
pa_source_output_new_data_set_channel_map(&data, &cm);
|
||||
data.flags = PA_SOURCE_OUTPUT_DONT_INHIBIT_AUTO_SUSPEND;
|
||||
|
||||
pa_source_output_new(&o, m->core, &data, PA_SOURCE_OUTPUT_DONT_INHIBIT_AUTO_SUSPEND);
|
||||
pa_source_output_new(&o, m->core, &data);
|
||||
pa_source_output_new_data_done(&data);
|
||||
|
||||
if (!o) {
|
||||
|
|
|
|||
|
|
@ -214,11 +214,13 @@ static void line_callback(pa_ioline *line, const char *s, void *userdata) {
|
|||
/* End of headers */
|
||||
/* We will have a header left from our looping iteration, so add it in :) */
|
||||
if (c->last_header) {
|
||||
char *tmp = pa_strbuf_tostring_free(c->header_buffer);
|
||||
/* This is not a continuation header so let's dump it into our proplist */
|
||||
pa_headerlist_puts(c->response_headers, c->last_header, pa_strbuf_tostring_free(c->header_buffer));
|
||||
pa_headerlist_puts(c->response_headers, c->last_header, tmp);
|
||||
pa_xfree(tmp);
|
||||
pa_xfree(c->last_header);
|
||||
c->last_header = NULL;
|
||||
c->header_buffer= NULL;
|
||||
c->header_buffer = NULL;
|
||||
}
|
||||
|
||||
pa_log_debug("Full response received. Dispatching");
|
||||
|
|
@ -240,9 +242,11 @@ static void line_callback(pa_ioline *line, const char *s, void *userdata) {
|
|||
}
|
||||
|
||||
if (c->last_header) {
|
||||
char *tmp = pa_strbuf_tostring_free(c->header_buffer);
|
||||
/* This is not a continuation header so let's dump the full
|
||||
header/value into our proplist */
|
||||
pa_headerlist_puts(c->response_headers, c->last_header, pa_strbuf_tostring_free(c->header_buffer));
|
||||
pa_headerlist_puts(c->response_headers, c->last_header, tmp);
|
||||
pa_xfree(tmp);
|
||||
pa_xfree(c->last_header);
|
||||
c->last_header = NULL;
|
||||
c->header_buffer = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue