Name: pulseaudio-modules-tizen
Summary: Pulseaudio modules for Tizen
-Version: 5.0.102
+Version: 5.0.103
Release: 0
Group: Multimedia/Audio
License: LGPL-2.1+
NULL
};
-/* A macro to ease iteration through all entries */
-#define PA_HASHMAP_FOREACH_KEY(e, h, state, key) \
- for ((state) = NULL, (e) = pa_hashmap_iterate((h), &(state), (const void**)&(key)); (e); (e) = pa_hashmap_iterate((h), &(state), (const void**)&(key)))
-
#define BT_CVSD_CODEC_ID 1 // narrow-band
#define BT_MSBC_CODEC_ID 2 // wide-band
/*
return NULL;
}
- PA_HASHMAP_FOREACH_KEY(_device_string, pcm_devices, state, role) {
+ PA_HASHMAP_FOREACH_KV(role, _device_string, pcm_devices, state) {
if (pa_streq(_device_string, device_string)) {
return role;
}
return -1;
}
- PA_HASHMAP_FOREACH_KEY(device_string, type_info->playback_devices, state, role) {
+ PA_HASHMAP_FOREACH_KV(role, device_string, type_info->playback_devices, state) {
sink = _core_get_sink(dm->core, device_string, NULL);
if (sink)
pa_tz_device_new_data_add_sink(data, role, sink);
return -1;
}
- PA_HASHMAP_FOREACH_KEY(device_string, type_info->capture_devices, state, role) {
+ PA_HASHMAP_FOREACH_KV(role, device_string, type_info->capture_devices, state) {
source = _core_get_source(dm->core, device_string, NULL);
if (source)
pa_tz_device_new_data_add_source(data, role, source);
static int _load_type_devices(struct device_type_info *type_info, bool is_playback, pa_device_manager *dm) {
pa_hashmap *pcm_devices;
pa_idxset *file_infos;
- void *state = NULL;
+ void *state;
char *role;
const char *device_string, *params;
return -1;
}
- PA_HASHMAP_FOREACH_KEY(device_string, pcm_devices, state, role) {
+ PA_HASHMAP_FOREACH_KV(role, device_string, pcm_devices, state) {
params = _file_infos_get_param(file_infos, device_string, role);
if (params == NULL) {
pa_log_error("Failed to get param for %s", device_string);
DM_DEVICE_BT_SCO_STATUS_OPENED
} dm_device_bt_sco_status_t;
-/* A macro to ease iteration through all entries */
-#define PA_HASHMAP_FOREACH_KEY(e, h, state, key) \
- for ((state) = NULL, (e) = pa_hashmap_iterate((h), &(state), (const void**)&(key)); (e); (e) = pa_hashmap_iterate((h), &(state), (const void**)&(key)))
-
bool device_type_is_builtin(const char *device_type);
bool device_type_is_use_external_card(const char *device_type);
bool device_type_is_valid(const char *device_type);
static char* get_playback_list_str(pa_hashmap *playback_devices) {
pa_sink *sink = NULL;
- void *state = NULL;
+ void *state;
const char *role;
pa_strbuf *buf;
buf = pa_strbuf_new();
pa_strbuf_printf(buf, " Playback device list\n");
- PA_HASHMAP_FOREACH_KEY(sink, playback_devices, state, role)
+ PA_HASHMAP_FOREACH_KV(role, sink, playback_devices, state)
pa_strbuf_printf(buf, " %-13s -> %s\n", role, sink->name);
return pa_strbuf_tostring_free(buf);
static char* get_capture_list_str(pa_hashmap *capture_devices) {
pa_source *source = NULL;
- void *state = NULL;
+ void *state;
const char *role;
pa_strbuf *buf;
buf = pa_strbuf_new();
pa_strbuf_printf(buf, " Capture device list\n");
- PA_HASHMAP_FOREACH_KEY(source, capture_devices, state, role)
+ PA_HASHMAP_FOREACH_KV(role, source, capture_devices, state)
pa_strbuf_printf(buf, " %-13s -> %s\n", role, source->name);
return pa_strbuf_tostring_free(buf);
pa_assert(device);
- PA_HASHMAP_FOREACH_KEY(_sink, device->playback_devices, state, role) {
+ PA_HASHMAP_FOREACH_KV(role, _sink, device->playback_devices, state) {
if (sink == _sink)
return device_remove_sink_with_role(device, role);
}
pa_assert(device);
- PA_HASHMAP_FOREACH_KEY(_source, device->capture_devices, state, role) {
+ PA_HASHMAP_FOREACH_KV(role, _source, device->capture_devices, state) {
if (source == _source)
return device_remove_source_with_role(device, role);
}
bool pa_tz_device_is_all_suspended(pa_tz_device *device) {
pa_sink *sink;
pa_source *source;
- void *state1 = NULL, *state2 = NULL;
+ void *state;
- PA_HASHMAP_FOREACH(sink, device->playback_devices, state1) {
+ PA_HASHMAP_FOREACH(sink, device->playback_devices, state) {
if (pa_sink_get_state(sink) != PA_SINK_SUSPENDED)
return false;
}
- PA_HASHMAP_FOREACH(source, device->capture_devices, state2) {
+ PA_HASHMAP_FOREACH(source, device->capture_devices, state) {
if (pa_source_get_state(source) != PA_SOURCE_SUSPENDED)
return false;
}