Name: pulseaudio-modules-tizen
Summary: Pulseaudio modules for Tizen
-Version: 11.1.50
+Version: 11.1.51
Release: 0
Group: Multimedia/Audio
License: LGPL-2.1+
return NULL;
}
- if ((spk_sink = pa_tz_device_get_sink(spk_device, DEVICE_ROLE_NORMAL)) == NULL) {
+ if ((spk_sink = pa_tz_device_get_sink(spk_device, NULL)) == NULL) {
pa_log_error("Get speaker sink failed");
return NULL;
}
/* currently, we support two sinks for combining */
if (data->stream_type == STREAM_SINK_INPUT) {
if (!combine_sink_arg1) {
- if ((sink = combine_sink_arg1 = pa_tz_device_get_sink(device, DEVICE_ROLE_NORMAL)))
+ if ((sink = combine_sink_arg1 = pa_tz_device_get_sink(device, NULL)))
pa_log_info(" -- combine_sink_arg1[%s], combine_sink_arg2[%p]", sink->name, combine_sink_arg2);
else
pa_log_warn(" -- could not get combine_sink_arg1");
} else if (!combine_sink_arg2) {
- sink = combine_sink_arg2 = pa_tz_device_get_sink(device, DEVICE_ROLE_NORMAL);
+ sink = combine_sink_arg2 = pa_tz_device_get_sink(device, NULL);
if (sink && !pa_safe_streq(sink->name, combine_sink_arg1->name)) {
uint32_t s_idx = 0;
}
} else if (data->stream_type == STREAM_SOURCE_OUTPUT) {
- if ((source = pa_tz_device_get_source(device, DEVICE_ROLE_NORMAL))) {
+ if ((source = pa_tz_device_get_source(device, NULL))) {
if (data->origins_from_new_data)
*(data->proper_source) = source;
else {
CONVERT_TO_DEVICE_ROLE(data->stream_role, device_role);
pa_log_info("[ROUTE][MOVE] stream_role[%s], device role[%s]", data->stream_role, device_role);
if (data->stream_type == STREAM_SINK_INPUT) {
- if (!(sink = pa_tz_device_get_sink(device, DEVICE_ROLE_NORMAL)) ||
+ if (!(sink = pa_tz_device_get_sink(device, NULL)) ||
!(dst_sink = pa_tz_device_get_sink(device, device_role)) ||
sink == dst_sink) {
pa_log_info("[ROUTE][MOVE][%s] no need to move streams, sink(%p), dst_sink(%p)", data->stream_role, sink, dst_sink);
}
streams = sink->inputs;
} else if (data->stream_type == STREAM_SOURCE_OUTPUT) {
- if (!(source = pa_tz_device_get_source(device, DEVICE_ROLE_NORMAL)) ||
+ if (!(source = pa_tz_device_get_source(device, NULL)) ||
!(dst_source = pa_tz_device_get_source(device, device_role)) ||
source == dst_source) {
pa_log_info("[ROUTE][MOVE][%s] no need to move streams, source(%p), dst_source(%p)", data->stream_role, source, dst_source);
/* Check for in/out devices in case of loopback */
if (pa_safe_streq(data->stream_role, STREAM_ROLE_LOOPBACK)) {
if ((data->stream_type == STREAM_SINK_INPUT) && (dm_device_direction & DM_DEVICE_DIRECTION_OUT))
- u->loopback_args.sink = pa_tz_device_get_sink(device, DEVICE_ROLE_NORMAL);
+ u->loopback_args.sink = pa_tz_device_get_sink(device, NULL);
else if ((data->stream_type == STREAM_SOURCE_OUTPUT) && (dm_device_direction & DM_DEVICE_DIRECTION_IN))
- u->loopback_args.source = pa_tz_device_get_source(device, DEVICE_ROLE_NORMAL);
+ u->loopback_args.source = pa_tz_device_get_source(device, NULL);
}
if (IS_AVAILABLE_DIRECTION(data->stream_type, dm_device_direction)) {
device_direction = pa_tz_device_get_direction(device);
if (device_direction == DM_DEVICE_DIRECTION_OUT) {
if ((use_internal_codec = pa_tz_device_is_use_internal_codec(device))) {
- sink = pa_tz_device_get_sink(device, DEVICE_ROLE_NORMAL);
+ sink = pa_tz_device_get_sink(device, NULL);
break;
}
}
/* unload loopback module */
if (u->module_loopback)
- if (u->loopback_args.sink == pa_tz_device_get_sink(conn->device, DEVICE_ROLE_NORMAL))
+ if (u->loopback_args.sink == pa_tz_device_get_sink(conn->device, NULL))
update_loopback_module(u, false);
}
if (device_direction & DM_DEVICE_DIRECTION_IN) {
/* unload loopback module */
if (u->module_loopback)
- if (u->loopback_args.source == pa_tz_device_get_source(conn->device, DEVICE_ROLE_NORMAL))
+ if (u->loopback_args.source == pa_tz_device_get_source(conn->device, NULL))
update_loopback_module(u, false);
}
}
device_type = pa_tz_device_get_type(device);
if (stream_type == STREAM_SINK_INPUT) {
pa_sink *sink;
- if ((sink = pa_tz_device_get_sink(device, DEVICE_ROLE_NORMAL)))
+ if ((sink = pa_tz_device_get_sink(device, NULL)))
use_internal_codec = sink->use_internal_codec;
else
pa_log_warn("sink is null");
} else {
pa_source *source;
- if ((source = pa_tz_device_get_source(device, DEVICE_ROLE_NORMAL)))
+ if ((source = pa_tz_device_get_source(device, NULL)))
use_internal_codec = source->use_internal_codec;
else
pa_log_warn("source is null");
const char *cur_device_type = pa_proplist_gets(si->proplist, PA_PROP_MEDIA_ROUTE_AUTO_ACTIVE_DEV);
char *device_type = pa_tz_device_get_type(device);
pa_tz_device *cur_device = pa_device_manager_get_device(m->dm, cur_device_type);
- pa_sink *sink = pa_tz_device_get_sink(device, DEVICE_ROLE_NORMAL);
+ pa_sink *sink = pa_tz_device_get_sink(device, NULL);
if (is_connected) {
bool available = false;
- pa_sink *cur_sink = pa_tz_device_get_sink(cur_device, DEVICE_ROLE_NORMAL);
+ pa_sink *cur_sink = pa_tz_device_get_sink(cur_device, NULL);
if (cur_sink == sink)
return true;
pa_sink *cur_sink = NULL;
if (cur_device)
- cur_sink = pa_tz_device_get_sink(cur_device, DEVICE_ROLE_NORMAL);
+ cur_sink = pa_tz_device_get_sink(cur_device, NULL);
if (cur_sink && (cur_sink != sink))
return true;
pa_log_error("failed to get next_device");
return true;
}
- next_sink = pa_tz_device_get_sink(next_device, DEVICE_ROLE_NORMAL);
+ next_sink = pa_tz_device_get_sink(next_device, NULL);
if (!reload_filter(m, stream_role, next_sink)) {
new_device_type = pa_tz_device_get_type(next_device);
pa_proplist_sets(si->proplist, PA_PROP_MEDIA_ROUTE_AUTO_ACTIVE_DEV, new_device_type);
pa_log_debug("[SM][UPDATE_SINK_SOURCE][AUTO] route_type(%d), deivce_type(%s), is_connected(%d))",
stream_route_type, device_type, is_connected);
if (stream_type == STREAM_SINK_INPUT)
- sink = pa_tz_device_get_sink(device, DEVICE_ROLE_NORMAL);
+ sink = pa_tz_device_get_sink(device, NULL);
else
- source = pa_tz_device_get_source(device, DEVICE_ROLE_NORMAL);
+ source = pa_tz_device_get_source(device, NULL);
PA_IDXSET_FOREACH(s, streams, s_idx) { /* streams: core->source_outputs/core->sink_inputs */
if (get_route_type(s, stream_type, false, &route_type))
continue;
find_next_device_for_auto_route(m, route_type, role, stream_type, device_type, &next_device);
if (next_device) {
- if ((next_sink = pa_tz_device_get_sink(next_device, DEVICE_ROLE_NORMAL))) {
+ if ((next_sink = pa_tz_device_get_sink(next_device, NULL))) {
new_device_type = pa_tz_device_get_type(next_device);
/* update activated device */
pa_proplist_sets(GET_STREAM_PROPLIST(s, stream_type), PA_PROP_MEDIA_ROUTE_AUTO_ACTIVE_DEV, new_device_type);
continue;
find_next_device_for_auto_route(m, route_type, role, stream_type, device_type, &next_device);
if (next_device) {
- if ((next_source = pa_tz_device_get_source(next_device, DEVICE_ROLE_NORMAL))) {
+ if ((next_source = pa_tz_device_get_source(next_device, NULL))) {
new_device_type = pa_tz_device_get_type(next_device);
/* update activated device */
pa_proplist_sets(GET_STREAM_PROPLIST(s, stream_type), PA_PROP_MEDIA_ROUTE_AUTO_ACTIVE_DEV, new_device_type);
const char *media_role = NULL;
hal_route_option route_option;
- if ((sink = pa_tz_device_get_sink(data->device, DEVICE_ROLE_NORMAL))) {
+ if ((sink = pa_tz_device_get_sink(data->device, NULL))) {
pa_idxset *filtered_streams = get_streams_for_matching_active_device(sink->inputs, device_type);
mute_sink_inputs_as_device_disconnection(m, data->event_id, true, filtered_streams);
pa_xfree(filtered_streams);
/* Update streams belong to this external device that have MAUAL_EXT route type */
if (!use_internal_codec) {
if (device_direction & DM_DEVICE_DIRECTION_IN) {
- if ((source = pa_tz_device_get_source(data->device, DEVICE_ROLE_NORMAL)))
+ if ((source = pa_tz_device_get_source(data->device, NULL)))
update_sink_or_source_as_device_change(m, STREAM_ROUTE_TYPE_MANUAL_EXT, source->outputs,
STREAM_SOURCE_OUTPUT, data->device, data->is_connected);
}
if (device_direction & DM_DEVICE_DIRECTION_OUT) {
- if ((sink = pa_tz_device_get_sink(data->device, DEVICE_ROLE_NORMAL)))
+ if ((sink = pa_tz_device_get_sink(data->device, NULL)))
update_sink_or_source_as_device_change(m, STREAM_ROUTE_TYPE_MANUAL_EXT, sink->inputs,
STREAM_SINK_INPUT, data->device, data->is_connected);
}
else if (pa_safe_streq(x_stream_role, STREAM_ROLE_VOIP)) \
x_device_role = DEVICE_ROLE_VOIP; \
else \
- x_device_role = DEVICE_ROLE_NORMAL; \
+ x_device_role = NULL; \
} while (0)
#define GET_STREAM_NEW_PROPLIST(stream, type) \
pa_assert(device);
pa_assert(device->playback_devices);
+ /* If the role is null, it returns the first one. We consider it as default sink
+ * until the default value is newly defined in device-map.json later on. */
+ if (!role) {
+ if ((sink = pa_hashmap_first(device->playback_devices)) == NULL) {
+ pa_log_warn("Failed to get sink for default");
+ return NULL;
+ }
+ return sink;
+ }
+
if ((sink = pa_hashmap_get(device->playback_devices, role)) == NULL) {
pa_log_warn("Failed to get sink for %s", role);
return NULL;
pa_assert(device);
pa_assert(device->capture_devices);
+ /* If the role is null, it returns the first one. We consider it as default source
+ * until the default value is newly defined in device-map.json later on. */
+ if (!role) {
+ if ((source = pa_hashmap_first(device->capture_devices)) == NULL) {
+ pa_log_warn("Failed to get source for default");
+ return NULL;
+ }
+ return source;
+ }
+
if ((source = pa_hashmap_get(device->capture_devices, role)) == NULL) {
pa_log_warn("Failed to get source for %s", role);
return NULL;
device->specified_stream_role = pa_xstrdup("none");
if (device_type_is_use_external_card(device->type)) {
- if ((sink = device_get_sink(device, DEVICE_ROLE_NORMAL)))
+ if ((sink = device_get_sink(device, NULL)))
sink->device_item = device;
- if ((source = device_get_source(device, DEVICE_ROLE_NORMAL)))
+ if ((source = device_get_source(device, NULL)))
source->device_item = device;
}