[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/mer-hybris/pulseaudio-modules-droid.git</param>
<param name="branch">master</param>
- <param name="revision">46bac3e0b044b8740eea83ef1bbf41dc4e892830</param>
+ <param name="revision">af15b213184c28687e4fe54231b6b265cbe300dd</param>
<param name="token"/>
<param name="debian"/>
<param name="dumb"/>
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/configure.ac
^
|
@@ -187,25 +187,6 @@
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
-#### expat (for xml config format parsing) (optional) ####
-
-AC_ARG_ENABLE([xml],
- AS_HELP_STRING([--disable-xml],[Disable optional xml config support]))
-
-AS_IF([test "x$enable_xml" != "xno"],
- [PKG_CHECK_MODULES(EXPAT, [ expat >= 2.1 ], HAVE_EXPAT=1, HAVE_EXPAT=0)],
- HAVE_EXPAT=0)
-
-AS_IF([test "x$enable_xml" = "xyes" && test "x$HAVE_EXPAT" = "x0"],
- [AC_MSG_ERROR([*** expat not found])])
-
-AC_SUBST(HAVE_EXPAT)
-AC_SUBST(EXPAT_CFLAGS)
-AC_SUBST(EXPAT_LIBS)
-AM_CONDITIONAL([HAVE_EXPAT], [test "x$HAVE_EXPAT" = x1])
-AS_IF([test "x$HAVE_EXPAT" = "x1"], AC_DEFINE([HAVE_EXPAT], 1, [Have expat?]))
-AS_IF([test "x$HAVE_EXPAT" = "x1"], ENABLE_XML="yes (expat)", ENABLE_XML=no)
-
# Output devices
CC_CHECK_DROID_ENUM([${DROIDHEADERS_CFLAGS}], [AUDIO_DEVICE_OUT_HDMI])
CC_CHECK_DROID_ENUM([${DROIDHEADERS_CFLAGS}], [AUDIO_DEVICE_OUT_HDMI_ARC])
@@ -296,12 +277,6 @@
AC_SUBST([DROID_DEVICE_CFLAGS])
fi
-# Workaround for SBJ HAL headers
-if test "x$droiddevice" = xsbj ; then
- SBJ_DEVICE_LDFLAGS="-Wl,--allow-multiple-definition"
- AC_SUBST([SBJ_DEVICE_LDFLAGS])
-fi
-
AC_MSG_CHECKING([If we are using hardfp tool chain])
case `echo | gcc -v -xc -o - - 2>&1 | grep COLLECT_GCC_OPTIONS | tail -1` in
*float-abi=hard*) hardfp=yes; AC_MSG_RESULT([yes]) ;;
@@ -334,6 +309,5 @@
prefix: ${prefix}
modules directory: ${modlibexecdir}
- Droid device: ${droiddevice}
- XML config support: ${ENABLE_XML}
+ Droid device ${droiddevice}
"
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/common/Makefile.am
^
|
@@ -1,20 +1,18 @@
AM_LIBADD = \
$(PULSEAUDIO_LIBS) \
- $(HYBRIS_LIBS) \
- $(EXPAT_LIBS)
+ $(HYBRIS_LIBS)
AM_CFLAGS = \
$(DROID_DEVICE_CFLAGS) \
$(PULSEAUDIO_CFLAGS) \
$(DROIDHEADERS_CFLAGS) \
$(HYBRIS_CFLAGS) \
- $(EXPAT_CFLAGS) \
-DPULSEAUDIO_VERSION=@PA_MAJOR@ \
-I$(top_srcdir)/src/common
modlibexec_LTLIBRARIES = libdroid-util.la
-libdroid_util_la_SOURCES = droid-util.c droid-config.c conversion.c config-parser-legacy.c config-parser-xml.c
-libdroid_util_la_LDFLAGS = -avoid-version -Wl,-z,noexecstack -lhybris-common $(SBJ_DEVICE_LDFLAGS)
+libdroid_util_la_SOURCES = droid-util.c droid-util.h
+libdroid_util_la_LDFLAGS = -avoid-version -Wl,-z,noexecstack -lhybris-common
libdroid_util_la_LIBADD = $(AM_LIBADD)
libdroid_util_la_CFLAGS = $(AM_CFLAGS)
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/common/droid-util-41qc.h
^
|
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2013 Jolla Ltd.
*
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
+ * Contact: Juho Hämäläinen <juho.hamalainen@tieto.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
@@ -29,8 +29,6 @@
#include <hardware/audio.h>
#include <hardware_legacy/audio_policy_conf.h>
-#include <pulse/channelmap.h>
-
// PulseAudio value - Android value
uint32_t conversion_table_output_channel[][2] = {
@@ -216,10 +214,6 @@
{ 0, NULL }
};
-struct string_conversion string_conversion_table_input_flag[] = {
- { 0, NULL }
-};
-
/* Channels */
struct string_conversion string_conversion_table_output_channels[] = {
STRING_ENTRY(AUDIO_CHANNEL_OUT_FRONT_LEFT),
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/common/droid-util-audio.h
^
|
@@ -29,8 +29,6 @@
#include <hardware/audio.h>
#include <hardware_legacy/audio_policy_conf.h>
-#include <pulse/channelmap.h>
-
#ifdef SPEAKER_DRC_ENABLED_TAG
#define DROID_HAVE_DRC
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/common/droid-util.c
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2013-2018 Jolla Ltd.
+ * Copyright (C) 2013 Jolla Ltd.
*
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
+ * Contact: Juho Hämäläinen <juho.hamalainen@tieto.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
@@ -58,10 +58,7 @@
#include <pulsecore/strlist.h>
#include <pulsecore/atomic.h>
-#include "version.h"
#include "droid-util.h"
-#include "droid-config.h"
-#include "conversion.h"
struct droid_quirk {
const char *name;
@@ -78,18 +75,849 @@
{ "realcall", QUIRK_REALCALL },
};
+#define SLLIST_APPEND(t, head, item) \
+ do { \
+ item->next = NULL; \
+ if (!head) { \
+ head = item; \
+ } else { \
+ t *_list; \
+ for (_list = head; _list->next; _list = _list->next); \
+ _list->next = item; \
+ } \
+ } while (0)
+
+#define SLLIST_FOREACH(i, head) \
+ for (i = (head); i; i = i->next)
+
+#define SLLIST_STEAL_FIRST(i, head) \
+ do { \
+ if (head) { \
+ i = head; \
+ head = head->next; \
+ } else \
+ i = NULL; \
+ } while (0)
+
+
+#define CONVERT_FUNC(TABL) \
+bool pa_convert_ ## TABL (uint32_t value, pa_conversion_field_t field, uint32_t *to_value) { \
+ for (unsigned int i = 0; i < sizeof( conversion_table_ ## TABL )/(sizeof(uint32_t)*2); i++) { \
+ if ( conversion_table_ ## TABL [i][field] == value) { \
+ *to_value = conversion_table_ ## TABL [i][!field]; \
+ return true; \
+ } \
+ } \
+ return false; \
+} struct __funny_extra_to_allow_semicolon
+
+/* Creates convert_format convert_channel etc.
+ * bool pa_convert_func(uint32_t value, pa_conversion_field_t field, uint32_t *to_value);
+ * return true if conversion succesful */
+CONVERT_FUNC(format);
+CONVERT_FUNC(output_channel);
+CONVERT_FUNC(input_channel);
#define DEFAULT_PRIORITY (100)
+/* Section defining custom global configuration variables. */
+#define GLOBAL_CONFIG_EXT_TAG "custom_properties"
+
+/* From recent audio_policy_conf.h */
+#ifndef AUDIO_HAL_VERSION_TAG
+#define AUDIO_HAL_VERSION_TAG "audio_hal_version"
+#endif
+#ifndef GAINS_TAG
+#define GAINS_TAG "gains"
+#endif
+
+#define GAIN_TAG_PREFIX "gain_"
+
static const char * const droid_combined_auto_outputs[3] = { "primary", "low_latency", NULL };
static const char * const droid_combined_auto_inputs[2] = { "primary", NULL };
+static void droid_config_free(pa_droid_config_audio *config);
static void droid_port_free(pa_droid_port *p);
static pa_droid_stream *get_primary_output(pa_droid_hw_module *hw);
static int input_stream_set_route(pa_droid_stream *s, audio_devices_t device);
+static bool string_convert_num_to_str(const struct string_conversion *list, const uint32_t value, const char **to_str) {
+ pa_assert(list);
+ pa_assert(to_str);
+
+ for (unsigned int i = 0; list[i].str; i++) {
+ if (list[i].value == value) {
+ *to_str = list[i].str;
+ return true;
+ }
+ }
+ return false;
+}
+
+static bool string_convert_str_to_num(const struct string_conversion *list, const char *str, uint32_t *to_value) {
+ pa_assert(list);
+ pa_assert(str);
+ pa_assert(to_value);
+
+ for (unsigned int i = 0; list[i].str; i++) {
+ if (pa_streq(list[i].str, str)) {
+ *to_value = list[i].value;
+ return true;
+ }
+ }
+ return false;
+}
+
+static char *list_string(struct string_conversion *list, uint32_t flags) {
+ char *str = NULL;
+ char *tmp;
+
+#if AUDIO_API_VERSION_MAJ >= 2
+ if (flags & AUDIO_DEVICE_BIT_IN)
+ flags &= ~AUDIO_DEVICE_BIT_IN;
+#endif
+
+ for (unsigned int i = 0; list[i].str; i++) {
+#if AUDIO_API_VERSION_MAJ >= 2
+ if (list[i].value & AUDIO_DEVICE_BIT_IN) {
+ if (popcount(list[i].value & ~AUDIO_DEVICE_BIT_IN) != 1)
+ continue;
+ } else
+#endif
+ if (popcount(list[i].value) != 1)
+ continue;
+
+ if (flags & list[i].value) {
+ if (str) {
+ tmp = pa_sprintf_malloc("%s|%s", str, list[i].str);
+ pa_xfree(str);
+ str = tmp;
+ } else {
+ str = pa_sprintf_malloc("%s", list[i].str);
+ }
+ }
+ }
+
+ return str;
+}
+
+
+/* Output device */
+bool pa_string_convert_output_device_num_to_str(audio_devices_t value, const char **to_str) {
+ return string_convert_num_to_str(string_conversion_table_output_device, (uint32_t) value, to_str);
+}
+
+bool pa_string_convert_output_device_str_to_num(const char *str, audio_devices_t *to_value) {
+ return string_convert_str_to_num(string_conversion_table_output_device, str, (uint32_t*) to_value);
+}
+
+char *pa_list_string_output_device(audio_devices_t devices) {
+ return list_string(string_conversion_table_output_device, devices);
+}
+
+/* Input device */
+bool pa_string_convert_input_device_num_to_str(audio_devices_t value, const char **to_str) {
+ return string_convert_num_to_str(string_conversion_table_input_device, (uint32_t) value, to_str);
+}
+
+bool pa_string_convert_input_device_str_to_num(const char *str, audio_devices_t *to_value) {
+ return string_convert_str_to_num(string_conversion_table_input_device, str, (uint32_t*) to_value);
+}
+
+char *pa_list_string_input_device(audio_devices_t devices) {
+ return list_string(string_conversion_table_input_device, devices);
+}
+
+/* Flags */
+bool pa_string_convert_flag_num_to_str(audio_output_flags_t value, const char **to_str) {
+ return string_convert_num_to_str(string_conversion_table_output_flag, (uint32_t) value, to_str);
+}
+
+bool pa_string_convert_flag_str_to_num(const char *str, audio_output_flags_t *to_value) {
+ return string_convert_str_to_num(string_conversion_table_output_flag, str, (uint32_t*) to_value);
+}
+
+char *pa_list_string_flags(audio_output_flags_t flags) {
+ return list_string(string_conversion_table_output_flag, flags);
+}
+
+bool pa_input_device_default_audio_source(audio_devices_t input_device, audio_source_t *default_source)
+{
+#if AUDIO_API_VERSION_MAJ >= 2
+ input_device &= ~AUDIO_DEVICE_BIT_IN;
+#endif
+
+ /* Note converting HAL values to different HAL values! */
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/common/droid-util.h
^
|
@@ -2,9 +2,9 @@
#define foodroidutilfoo
/*
- * Copyright (C) 2013-2018 Jolla Ltd.
+ * Copyright (C) 2013 Jolla Ltd.
*
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
+ * Contact: Juho Hämäläinen <juho.hamalainen@tieto.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
@@ -31,8 +31,31 @@
#include <pulsecore/strlist.h>
#include <pulsecore/atomic.h>
-#include "version.h"
-#include "droid-config.h"
+#include <android-config.h>
+
+#if !defined(ANDROID_VERSION_MAJOR) || !defined(ANDROID_VERSION_MINOR) || !defined(ANDROID_VERSION_PATCH)
+#error "ANDROID_VERSION_* not defined. Did you get your headers via extract-headers.sh?"
+#endif
+
+#if ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR == 1
+#include "droid-util-41qc.h"
+#else
+#include "droid-util-audio.h"
+#endif
+
+/* We currently support API version up-to 3.0 */
+#define DROID_API_VERSION_SUPPORT HARDWARE_DEVICE_API_VERSION(3, 0)
+
+#if AUDIO_DEVICE_API_VERSION_CURRENT > DROID_API_VERSION_SUPPORT
+#warning Compiling against higher audio device API version than currently supported!
+#warning Compile likely fails or module may malfunction.
+#endif
+
+#define AUDIO_API_VERSION_MAJ ((AUDIO_DEVICE_API_VERSION_CURRENT >> 8) & 0xff)
+#define AUDIO_API_VERSION_MIN (AUDIO_DEVICE_API_VERSION_CURRENT & 0xff)
+
+#define AUDIO_API_VERSION_GET_MAJ(x) ((x >> 8) & 0xff)
+#define AUDIO_API_VERSION_GET_MIN(x) (x & 0xff)
#if defined(QCOM_BSP) && (AUDIO_API_VERSION_MAJ >= 3)
#define DROID_AUDIO_HAL_USE_VSID
@@ -59,6 +82,9 @@
typedef struct pa_droid_card_data pa_droid_card_data;
typedef int (*common_set_parameters_cb_t)(pa_droid_card_data *card_data, const char *str);
+typedef struct pa_droid_config_audio pa_droid_config_audio;
+typedef struct pa_droid_config_hw_module pa_droid_config_hw_module;
+
typedef struct pa_droid_quirks pa_droid_quirks;
typedef enum pa_droid_hook {
@@ -139,6 +165,60 @@
common_set_parameters_cb_t set_parameters;
};
+#define AUDIO_MAX_SAMPLING_RATES (32)
+
+typedef struct pa_droid_config_global {
+ uint32_t audio_hal_version;
+ audio_devices_t attached_output_devices;
+ audio_devices_t default_output_device;
+ audio_devices_t attached_input_devices;
+} pa_droid_config_global;
+
+typedef struct pa_droid_config_output {
+ const pa_droid_config_hw_module *module;
+
+ char *name;
+ uint32_t sampling_rates[AUDIO_MAX_SAMPLING_RATES]; /* (uint32_t) -1 -> dynamic */
+ audio_channel_mask_t channel_masks; /* 0 -> dynamic */
+ audio_format_t formats; /* 0 -> dynamic */
+ audio_devices_t devices;
+ audio_output_flags_t flags;
+
+ struct pa_droid_config_output *next;
+} pa_droid_config_output;
+
+typedef struct pa_droid_config_input {
+ const pa_droid_config_hw_module *module;
+
+ char *name;
+ uint32_t sampling_rates[AUDIO_MAX_SAMPLING_RATES]; /* (uint32_t) -1 -> dynamic */
+ audio_channel_mask_t channel_masks; /* 0 -> dynamic */
+ audio_format_t formats; /* 0 -> dynamic */
+ audio_devices_t devices;
+#if AUDIO_API_VERSION_MAJ >= 3
+ audio_input_flags_t flags;
+#endif
+
+ struct pa_droid_config_input *next;
+} pa_droid_config_input;
+
+struct pa_droid_config_hw_module {
+ const pa_droid_config_audio *config;
+
+ char *name;
+ /* If global config is not defined for module, use root global config. */
+ pa_droid_config_global *global_config;
+ pa_droid_config_output *outputs;
+ pa_droid_config_input *inputs;
+
+ struct pa_droid_config_hw_module *next;
+};
+
+struct pa_droid_config_audio {
+ pa_droid_config_global *global_config;
+ pa_droid_config_hw_module *hw_modules;
+};
+
/* Profiles */
@@ -241,6 +321,41 @@
return hw->quirks && hw->quirks->enabled[quirk];
}
+/* Conversion helpers */
+typedef enum {
+ CONV_FROM_PA,
+ CONV_FROM_HAL
+} pa_conversion_field_t;
+
+bool pa_convert_output_channel(uint32_t value, pa_conversion_field_t from, uint32_t *to_value);
+bool pa_convert_input_channel(uint32_t value, pa_conversion_field_t from, uint32_t *to_value);
+bool pa_convert_format(uint32_t value, pa_conversion_field_t from, uint32_t *to_value);
+
+bool pa_string_convert_output_device_num_to_str(audio_devices_t value, const char **to_str);
+bool pa_string_convert_output_device_str_to_num(const char *str, audio_devices_t *to_value);
+bool pa_string_convert_input_device_num_to_str(audio_devices_t value, const char **to_str);
+bool pa_string_convert_input_device_str_to_num(const char *str, audio_devices_t *to_value);
+
+bool pa_string_convert_flag_num_to_str(audio_output_flags_t value, const char **to_str);
+bool pa_string_convert_flag_str_to_num(const char *str, audio_output_flags_t *to_value);
+
+char *pa_list_string_output_device(audio_devices_t devices);
+char *pa_list_string_input_device(audio_devices_t devices);
+char *pa_list_string_flags(audio_output_flags_t flags);
+
+/* Get default audio source associated with input device.
+ * Return true if default source was found, false if not. */
+bool pa_input_device_default_audio_source(audio_devices_t input_device, audio_source_t *default_source);
+
+/* Config parser */
+bool pa_parse_droid_audio_config(const char *filename, pa_droid_config_audio *config);
+pa_droid_config_audio *pa_droid_config_load(pa_modargs *ma);
+
+const pa_droid_config_output *pa_droid_config_find_output(const pa_droid_config_hw_module *module, const char *name);
+const pa_droid_config_input *pa_droid_config_find_input(const pa_droid_config_hw_module *module, const char *name);
+const pa_droid_config_hw_module *pa_droid_config_find_module(const pa_droid_config_audio *config, const char* module_id);
+
+
/* Profiles */
pa_droid_profile_set *pa_droid_profile_set_new(const pa_droid_config_hw_module *module);
pa_droid_profile_set *pa_droid_profile_set_default_new(const pa_droid_config_hw_module *module,
@@ -268,6 +383,13 @@
* May be called multiple times for one card profile. */
void pa_droid_add_card_ports(pa_card_profile *cp, pa_hashmap *ports, pa_droid_mapping *am, pa_core *core);
+/* Pretty port names */
+bool pa_droid_output_port_name(audio_devices_t value, const char **to_str);
+bool pa_droid_input_port_name(audio_devices_t value, const char **to_str);
+
+/* Pretty audio source names */
+bool pa_droid_audio_source_name(audio_source_t value, const char **to_str);
+
pa_hook *pa_droid_hooks(pa_droid_hw_module *hw);
/* Module operations */
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/droid/droid-sink.c
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2013-2018 Jolla Ltd.
+ * Copyright (C) 2013 Jolla Ltd.
*
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
+ * Contact: Juho Hämäläinen <juho.hamalainen@tieto.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
@@ -57,7 +57,6 @@
#include "droid-sink.h"
#include "droid-util.h"
-#include "conversion.h"
struct userdata {
pa_core *core;
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/droid/droid-sink.h
^
|
@@ -2,9 +2,9 @@
#define foodroidsinkfoo
/*
- * Copyright (C) 2013-2018 Jolla Ltd.
+ * Copyright (C) 2013 Jolla Ltd.
*
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
+ * Contact: Juho Hämäläinen <juho.hamalainen@tieto.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/droid/droid-source.c
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2013-2018 Jolla Ltd.
+ * Copyright (C) 2013 Jolla Ltd.
*
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
+ * Contact: Juho Hämäläinen <juho.hamalainen@tieto.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
@@ -54,7 +54,6 @@
#include "droid-source.h"
#include "droid-util.h"
-#include "conversion.h"
struct userdata {
pa_core *core;
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/droid/droid-source.h
^
|
@@ -2,9 +2,9 @@
#define foodroidsourcefoo
/*
- * Copyright (C) 2013-2018 Jolla Ltd.
+ * Copyright (C) 2013 Jolla Ltd.
*
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
+ * Contact: Juho Hämäläinen <juho.hamalainen@tieto.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/droid/keepalive.c
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2013-2018 Jolla Ltd.
+ * Copyright (C) 2013 Jolla Ltd.
*
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
+ * Contact: Juho Hämäläinen <juho.hamalainen@tieto.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/droid/keepalive.h
^
|
@@ -2,9 +2,9 @@
#define foodroidkeepalivefoo
/*
- * Copyright (C) 2013-2018 Jolla Ltd.
+ * Copyright (C) 2013 Jolla Ltd.
*
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
+ * Contact: Juho Hämäläinen <juho.hamalainen@tieto.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/droid/module-droid-card-symdef.h
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2013-2018 Jolla Ltd.
+ * Copyright (C) 2013 Jolla Ltd.
*
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
+ * Contact: Juho Hämäläinen <juho.hamalainen@tieto.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/droid/module-droid-card.c
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2013-2018 Jolla Ltd.
+ * Copyright (C) 2013 Jolla Ltd.
*
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
+ * Contact: Juho Hämäläinen <juho.hamalainen@tieto.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/droid/module-droid-keepalive-symdef.h
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2013-2018 Jolla Ltd.
+ * Copyright (C) 2013 Jolla Ltd.
*
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
+ * Contact: Juho Hämäläinen <juho.hamalainen@tieto.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/droid/module-droid-keepalive.c
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2013-2018 Jolla Ltd.
+ * Copyright (C) 2013 Jolla Ltd.
*
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
+ * Contact: Juho Hämäläinen <juho.hamalainen@tieto.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/droid/module-droid-sink-symdef.h
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2013-2018 Jolla Ltd.
+ * Copyright (C) 2013 Jolla Ltd.
*
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
+ * Contact: Juho Hämäläinen <juho.hamalainen@tieto.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/droid/module-droid-sink.c
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2013-2018 Jolla Ltd.
+ * Copyright (C) 2013 Jolla Ltd.
*
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
+ * Contact: Juho Hämäläinen <juho.hamalainen@tieto.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
@@ -39,7 +39,6 @@
#include "droid-util.h"
#include "droid-sink.h"
-#include "conversion.h"
#include "module-droid-sink-symdef.h"
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/droid/module-droid-source-symdef.h
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2013-2018 Jolla Ltd.
+ * Copyright (C) 2013 Jolla Ltd.
*
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
+ * Contact: Juho Hämäläinen <juho.hamalainen@tieto.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/droid/module-droid-source.c
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2013-2018 Jolla Ltd.
+ * Copyright (C) 2013 Jolla Ltd.
*
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
+ * Contact: Juho Hämäläinen <juho.hamalainen@tieto.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
|
[-]
[+]
|
Deleted |
_service:tar_git:pulseaudio-modules-droid-11.1.71.tar.bz2/src/common/config-parser-legacy.c
^
|
@@ -1,441 +0,0 @@
-/*
- * Copyright (C) 2018 Jolla Ltd.
- *
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
- *
- * These PulseAudio Modules are free software; you can redistribute
- * it and/or modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdbool.h>
-#include <pulsecore/macro.h>
-#include <pulsecore/core-util.h>
-#include <pulsecore/core-error.h>
-#include <pulsecore/log.h>
-#include <pulse/xmalloc.h>
-
-#include <hardware_legacy/audio_policy_conf.h>
-
-#include "version.h"
-#include "droid-config.h"
-#include "conversion.h"
-
-/* Section defining custom global configuration variables. */
-#define GLOBAL_CONFIG_EXT_TAG "custom_properties"
-
-#define GAIN_TAG_PREFIX "gain_"
-
-#define MAX_LINE_LENGTH (1024)
-#define WHITESPACE "\n\r \t"
-
-static void log_parse_error(const char *fn, const unsigned ln, const char *section, const char *v) {
- pa_log("[%s:%u] failed to parse line in section %s: unknown section (%s)", fn, ln, section, v);
-}
-
-pa_droid_config_audio *pa_parse_droid_audio_config_legacy(const char *filename) {
- pa_droid_config_audio *config = NULL;
- FILE *f;
- unsigned n = 0;
- bool ret = true;
- char *full_line = NULL;
- uint32_t hw_module_count = 0;
-
- enum config_loc {
- IN_ROOT = 0,
- IN_GLOBAL = 1,
- IN_GLOBAL_EXT = 2,
- IN_HW_MODULES = 3,
- IN_MODULE = 4,
- IN_OUTPUT_INPUT = 5,
- IN_CONFIG = 6,
- IN_MODULE_GLOBAL = 10,
- IN_DEVICES = 20,
- IN_DEVICES_DEVICE = 21,
- IN_GAINS = 22,
- IN_GAIN_N = 23
- } loc = IN_ROOT;
-
- bool in_output = true;
-
- pa_droid_config_hw_module *module = NULL;
- pa_droid_config_output *output = NULL;
- pa_droid_config_input *input = NULL;
-
- pa_assert(filename);
-
- f = fopen(filename, "r");
-
- if (!f) {
- pa_log_info("Failed to open config file (%s): %s", filename, pa_cstrerror(errno));
- ret = false;
- goto finish;
- }
-
- config = pa_xnew0(pa_droid_config_audio, 1);
- config->global_config = pa_xnew0(pa_droid_config_global, 1);
-
- pa_lock_fd(fileno(f), 1);
-
- full_line = pa_xmalloc0(sizeof(char) * MAX_LINE_LENGTH);
-
- while (!feof(f)) {
- char *ln, *d, *v, *value;
-
- if (!fgets(full_line, MAX_LINE_LENGTH, f))
- break;
-
- n++;
-
- pa_strip_nl(full_line);
-
- if (!*full_line)
- continue;
-
- ln = full_line + strspn(full_line, WHITESPACE);
-
- if (ln[0] == '#')
- continue;
-
- v = ln;
- d = v + strcspn(v, WHITESPACE);
-
- value = d + strspn(d, WHITESPACE);
- d[0] = '\0';
- d = value + strcspn(value, WHITESPACE);
- d[0] = '\0';
-
- /* Enter section */
- if (pa_streq(value, "{")) {
-
- if (!*v) {
- pa_log("[%s:%u] failed to parse line - too few words", filename, n);
- goto finish;
- }
-
- switch (loc) {
- case IN_ROOT:
- if (pa_streq(v, GLOBAL_CONFIG_TAG)) {
- loc = IN_GLOBAL;
- }
- else if (pa_streq(v, AUDIO_HW_MODULE_TAG))
- loc = IN_HW_MODULES;
- else {
- log_parse_error(filename, n, "<root>", v);
- ret = false;
- goto finish;
- }
- break;
-
- case IN_GLOBAL:
- if (pa_streq(v, GLOBAL_CONFIG_EXT_TAG))
- loc = IN_GLOBAL_EXT;
- else {
- log_parse_error(filename, n, GLOBAL_CONFIG_TAG, v);
- ret = false;
- goto finish;
- }
- break;
-
- case IN_HW_MODULES:
- pa_assert(!module);
-
- module = pa_xnew0(pa_droid_config_hw_module, 1);
- SLLIST_APPEND(pa_droid_config_hw_module, config->hw_modules, module);
- hw_module_count++;
- module->name = pa_xstrndup(v, AUDIO_HARDWARE_MODULE_ID_MAX_LEN);
- module->config = config;
- loc = IN_MODULE;
- pa_log_debug("config: New module: %s", module->name);
- break;
-
- case IN_MODULE:
- pa_assert(module);
-
- if (pa_streq(v, OUTPUTS_TAG)) {
- loc = IN_OUTPUT_INPUT;
- in_output = true;
- } else if (pa_streq(v, INPUTS_TAG)) {
- loc = IN_OUTPUT_INPUT;
- in_output = false;
- } else if (pa_streq(v, GLOBAL_CONFIG_TAG)) {
- loc = IN_MODULE_GLOBAL;
- } else if (pa_streq(v, DEVICES_TAG)) {
- loc = IN_DEVICES;
- } else {
- log_parse_error(filename, n, module->name, v);
- ret = false;
- goto finish;
- }
- break;
-
- case IN_OUTPUT_INPUT:
- pa_assert(module);
-
- if (in_output) {
- output = pa_xnew0(pa_droid_config_output, 1);
- SLLIST_APPEND(pa_droid_config_output, module->outputs, output);
- output->name = pa_xstrndup(v, AUDIO_HARDWARE_MODULE_ID_MAX_LEN);
- output->module = module;
- loc = IN_CONFIG;
- pa_log_debug("config: %s: New output: %s", module->name, output->name);
- } else {
- input = pa_xnew0(pa_droid_config_input, 1);
- SLLIST_APPEND(pa_droid_config_input, module->inputs, input);
- input->name = pa_xstrndup(v, AUDIO_HARDWARE_MODULE_ID_MAX_LEN);
|
[-]
[+]
|
Deleted |
_service:tar_git:pulseaudio-modules-droid-11.1.71.tar.bz2/src/common/config-parser-xml.c
^
|
@@ -1,1051 +0,0 @@
-/*
- * Copyright (C) 2018 Jolla Ltd.
- *
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
- *
- * These PulseAudio Modules are free software; you can redistribute
- * it and/or modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <pulsecore/log.h>
-
-#include "droid-config.h"
-
-#ifndef HAVE_EXPAT
-#include <unistd.h>
-pa_droid_config_audio *pa_parse_droid_audio_config_xml(const char *filename) {
- if (access(filename, F_OK) == 0)
- pa_log_warn("Could not parse %s, xml configuration parsing support not compiled in", filename);
- return NULL;
-}
-#else
-
-#include <stdarg.h>
-#include <string.h>
-#include <expat.h>
-
-#include <pulse/xmalloc.h>
-#include <pulsecore/core-util.h>
-#include <pulsecore/core-error.h>
-
-#include "conversion.h"
-
-#ifdef XML_UNICODE_WCHAR_T
-# include <wchar.h>
-# define XML_FMT_STR "ls"
-#else
-# define XML_FMT_STR "s"
-#endif
-
-#define POLICY_SUPPORTED_VERSION "1.0"
-
-#define ELEMENT_audioPolicyConfiguration "audioPolicyConfiguration"
-#define ELEMENT_globalConfiguration "globalConfiguration"
-#define ELEMENT_modules "modules"
-#define ELEMENT_module "module"
-#define ELEMENT_attachedDevices "attachedDevices"
-#define ELEMENT_item "item"
-#define ELEMENT_defaultOutputDevice "defaultOutputDevice"
-#define ELEMENT_mixPorts "mixPorts"
-#define ELEMENT_mixPort "mixPort"
-#define ELEMENT_profile "profile"
-#define ELEMENT_devicePorts "devicePorts"
-#define ELEMENT_devicePort "devicePort"
-/* ELEMENT_profile */
-#define ELEMENT_routes "routes"
-#define ELEMENT_route "route"
-
-#define ATTRIBUTE_version "version"
-#define ATTRIBUTE_name "name"
-#define ATTRIBUTE_halVersion "halVersion"
-#define ATTRIBUTE_format "format"
-#define ATTRIBUTE_samplingRates "samplingRates"
-#define ATTRIBUTE_channelMasks "channelMasks"
-#define ATTRIBUTE_tagName "tagName"
-#define ATTRIBUTE_role "role"
-#define ATTRIBUTE_flags "flags"
-#define ATTRIBUTE_sink "sink"
-#define ATTRIBUTE_sources "sources"
-#define ATTRIBUTE_type "type"
-
-#define PORT_TYPE_sink "sink"
-#define PORT_TYPE_source "source"
-
-
-struct parser_data;
-
-struct element_parser {
- const char *name;
- bool (*attributes)(struct parser_data *data, const char *element_name, const XML_Char **attributes);
- void (*char_data)(struct parser_data *data, const char *str);
- const struct element_parser *next;
- const struct element_parser *child;
-};
-
-struct element_parser_stack {
- const struct element_parser *data;
- struct element_parser_stack *next;
-};
-
-#define ELEMENT_STACK_PUSH(_stack, _item) \
- do { \
- struct element_parser_stack *_i; \
- _i = pa_xmalloc0(sizeof(*_i)); \
- _i->data = _item; \
- _i->next = _stack; \
- _stack = _i; \
- } while(0)
-
-#define ELEMENT_STACK_POP(_stack, _item) \
- do { \
- if (_stack) { \
- struct element_parser_stack *_t; \
- _t = _stack; \
- _item = _stack->data; \
- _stack = _stack->next; \
- pa_xfree(_t); \
- } else \
- _item = NULL; \
- } while(0)
-
-static bool parse_audio_policy_configuration(struct parser_data *data, const char *element_name, const XML_Char **attributes);
-static bool parse_route(struct parser_data *data, const char *element_name, const XML_Char **attributes);
-static bool parse_profile(struct parser_data *data, const char *element_name, const XML_Char **attributes);
-static bool parse_device_port(struct parser_data *data, const char *element_name, const XML_Char **attributes);
-static bool parse_mix_port(struct parser_data *data, const char *element_name, const XML_Char **attributes);
-static void parse_default_output_device(struct parser_data *data, const char *str);
-static void parse_item(struct parser_data *data, const char *str);
-static bool parse_module(struct parser_data *data, const char *element_name, const XML_Char **attributes);
-static bool parse_global_configuration(struct parser_data *data, const char *element_name, const XML_Char **attributes);
-
-static const struct element_parser element_parse_route = {
- ELEMENT_route,
- parse_route,
- NULL,
- NULL,
- NULL
-};
-
-static const struct element_parser element_parse_routes = {
- ELEMENT_routes,
- NULL,
- NULL,
- NULL,
- &element_parse_route
-};
-
-static const struct element_parser element_parse_profile = {
- ELEMENT_profile,
- parse_profile,
- NULL,
- NULL,
- NULL
-};
-
-static const struct element_parser element_parse_device_port = {
- ELEMENT_devicePort,
- parse_device_port,
- NULL,
- NULL,
- &element_parse_profile
-};
-
-static const struct element_parser element_parse_device_ports = {
- ELEMENT_devicePorts,
- NULL,
- NULL,
- &element_parse_routes,
- &element_parse_device_port
-};
-
-static const struct element_parser element_parse_mix_port = {
- ELEMENT_mixPort,
- parse_mix_port,
- NULL,
- NULL,
- &element_parse_profile
-};
-
-static const struct element_parser element_parse_mix_ports = {
- ELEMENT_mixPorts,
- NULL,
- NULL,
- &element_parse_device_ports,
- &element_parse_mix_port
-};
-
-static const struct element_parser element_parse_default_output_device = {
- ELEMENT_defaultOutputDevice,
- NULL,
- parse_default_output_device,
- &element_parse_mix_ports,
- NULL
-};
-
|
[-]
[+]
|
Deleted |
_service:tar_git:pulseaudio-modules-droid-11.1.71.tar.bz2/src/common/conversion.c
^
|
@@ -1,475 +0,0 @@
-/*
- * Copyright (C) 2013-2018 Jolla Ltd.
- *
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
- *
- * These PulseAudio Modules are free software; you can redistribute
- * it and/or modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "version.h"
-#if ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR == 1
-#include "droid-util-41qc.h"
-#else
-#include "droid-util-audio.h"
-#endif
-
-#include <pulsecore/core-util.h>
-
-#include <hardware/audio.h>
-
-#include "conversion.h"
-#include "droid-config.h"
-
-#define CONVERT_FUNC(TABL) \
-bool pa_convert_ ## TABL (uint32_t value, pa_conversion_field_t field, uint32_t *to_value) { \
- for (unsigned int i = 0; i < sizeof( conversion_table_ ## TABL )/(sizeof(uint32_t)*2); i++) { \
- if ( conversion_table_ ## TABL [i][field] == value) { \
- *to_value = conversion_table_ ## TABL [i][!field]; \
- return true; \
- } \
- } \
- return false; \
-} struct __funny_extra_to_allow_semicolon
-
-/* Creates convert_format convert_channel etc.
- * bool pa_convert_func(uint32_t value, pa_conversion_field_t field, uint32_t *to_value);
- * return true if conversion succesful */
-CONVERT_FUNC(format);
-CONVERT_FUNC(output_channel);
-CONVERT_FUNC(input_channel);
-
-#define value_separator(legacy) (legacy ? "|" : ",")
-
-static bool string_convert_num_to_str(const struct string_conversion *list, const uint32_t value, const char **to_str) {
- pa_assert(list);
- pa_assert(to_str);
-
- for (unsigned int i = 0; list[i].str; i++) {
- if (list[i].value == value) {
- *to_str = list[i].str;
- return true;
- }
- }
- return false;
-}
-
-static bool string_convert_str_to_num(const struct string_conversion *list, const char *str, uint32_t *to_value) {
- pa_assert(list);
- pa_assert(str);
- pa_assert(to_value);
-
- for (unsigned int i = 0; list[i].str; i++) {
- if (pa_streq(list[i].str, str)) {
- *to_value = list[i].value;
- return true;
- }
- }
- return false;
-}
-
-static char *list_string(struct string_conversion *list, uint32_t flags) {
- char *str = NULL;
- char *tmp;
-
-#if AUDIO_API_VERSION_MAJ >= 2
- if (flags & AUDIO_DEVICE_BIT_IN)
- flags &= ~AUDIO_DEVICE_BIT_IN;
-#endif
-
- for (unsigned int i = 0; list[i].str; i++) {
-#if AUDIO_API_VERSION_MAJ >= 2
- if (list[i].value & AUDIO_DEVICE_BIT_IN) {
- if (popcount(list[i].value & ~AUDIO_DEVICE_BIT_IN) != 1)
- continue;
- } else
-#endif
- if (popcount(list[i].value) != 1)
- continue;
-
- if (flags & list[i].value) {
- if (str) {
- tmp = pa_sprintf_malloc("%s|%s", str, list[i].str);
- pa_xfree(str);
- str = tmp;
- } else {
- str = pa_sprintf_malloc("%s", list[i].str);
- }
- }
- }
-
- return str;
-}
-
-
-/* Output device */
-bool pa_string_convert_output_device_num_to_str(audio_devices_t value, const char **to_str) {
- return string_convert_num_to_str(string_conversion_table_output_device, (uint32_t) value, to_str);
-}
-
-bool pa_string_convert_output_device_str_to_num(const char *str, audio_devices_t *to_value) {
- return string_convert_str_to_num(string_conversion_table_output_device, str, (uint32_t*) to_value);
-}
-
-char *pa_list_string_output_device(audio_devices_t devices) {
- return list_string(string_conversion_table_output_device, devices);
-}
-
-/* Input device */
-bool pa_string_convert_input_device_num_to_str(audio_devices_t value, const char **to_str) {
- return string_convert_num_to_str(string_conversion_table_input_device, (uint32_t) value, to_str);
-}
-
-bool pa_string_convert_input_device_str_to_num(const char *str, audio_devices_t *to_value) {
- return string_convert_str_to_num(string_conversion_table_input_device, str, (uint32_t*) to_value);
-}
-
-char *pa_list_string_input_device(audio_devices_t devices) {
- return list_string(string_conversion_table_input_device, devices);
-}
-
-/* Flags */
-bool pa_string_convert_flag_num_to_str(audio_output_flags_t value, const char **to_str) {
- return string_convert_num_to_str(string_conversion_table_output_flag, (uint32_t) value, to_str);
-}
-
-bool pa_string_convert_flag_str_to_num(const char *str, audio_output_flags_t *to_value) {
- return string_convert_str_to_num(string_conversion_table_output_flag, str, (uint32_t*) to_value);
-}
-
-char *pa_list_string_flags(audio_output_flags_t flags) {
- return list_string(string_conversion_table_output_flag, flags);
-}
-
-bool pa_input_device_default_audio_source(audio_devices_t input_device, audio_source_t *default_source)
-{
-#if AUDIO_API_VERSION_MAJ >= 2
- input_device &= ~AUDIO_DEVICE_BIT_IN;
-#endif
-
- /* Note converting HAL values to different HAL values! */
- for (unsigned int i = 0; i < sizeof(conversion_table_default_audio_source) / (sizeof(uint32_t) * 2); i++) {
- if (conversion_table_default_audio_source[i][0] & input_device) {
- *default_source = conversion_table_default_audio_source[i][1];
- return true;
- }
- }
- return false;
-}
-
-
-bool pa_droid_output_port_name(audio_devices_t value, const char **to_str) {
- return string_convert_num_to_str(string_conversion_table_output_device_fancy, (uint32_t) value, to_str);
-}
-
-bool pa_droid_input_port_name(audio_devices_t value, const char **to_str) {
- return string_convert_num_to_str(string_conversion_table_input_device_fancy, (uint32_t) value, to_str);
-}
-
-bool pa_droid_audio_source_name(audio_source_t value, const char **to_str) {
- return string_convert_num_to_str(string_conversion_table_audio_source_fancy, (uint32_t) value, to_str);
-}
-
-static int parse_list(const struct string_conversion *table,
- const char *separator,
- const char *str,
- uint32_t *dst,
- char **unknown_entries) {
- int count = 0;
- char *entry;
- char *unknown = NULL;
- const char *state = NULL;
-
- pa_assert(table);
|
[-]
[+]
|
Deleted |
_service:tar_git:pulseaudio-modules-droid-11.1.71.tar.bz2/src/common/conversion.h
^
|
@@ -1,112 +0,0 @@
-#ifndef foodroidconversionfoo
-#define foodroidconversionfoo
-
-/*
- * Copyright (C) 2018 Jolla Ltd.
- *
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
- *
- * These PulseAudio Modules are free software; you can redistribute
- * it and/or modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <pulsecore/modargs.h>
-
-#include <hardware/audio.h>
-
-/* From recent audio_policy_conf.h */
-#ifndef AUDIO_HAL_VERSION_TAG
-#define AUDIO_HAL_VERSION_TAG "audio_hal_version"
-#endif
-#ifndef GAINS_TAG
-#define GAINS_TAG "gains"
-#endif
-
-#include "version.h"
-#include "droid-config.h"
-
-typedef enum {
- CONV_FROM_PA,
- CONV_FROM_HAL
-} pa_conversion_field_t;
-
-typedef enum {
- CONV_STRING_FORMAT,
- CONV_STRING_OUTPUT_CHANNELS,
- CONV_STRING_INPUT_CHANNELS,
- CONV_STRING_OUTPUT_DEVICE,
- CONV_STRING_INPUT_DEVICE,
- CONV_STRING_OUTPUT_FLAG,
- CONV_STRING_INPUT_FLAG
-} pa_conversion_string_t;
-
-bool pa_convert_output_channel(uint32_t value, pa_conversion_field_t from, uint32_t *to_value);
-bool pa_convert_input_channel(uint32_t value, pa_conversion_field_t from, uint32_t *to_value);
-bool pa_convert_format(uint32_t value, pa_conversion_field_t from, uint32_t *to_value);
-
-bool pa_string_convert_output_device_num_to_str(audio_devices_t value, const char **to_str);
-bool pa_string_convert_output_device_str_to_num(const char *str, audio_devices_t *to_value);
-bool pa_string_convert_input_device_num_to_str(audio_devices_t value, const char **to_str);
-bool pa_string_convert_input_device_str_to_num(const char *str, audio_devices_t *to_value);
-
-bool pa_string_convert_flag_num_to_str(audio_output_flags_t value, const char **to_str);
-bool pa_string_convert_flag_str_to_num(const char *str, audio_output_flags_t *to_value);
-
-char *pa_list_string_output_device(audio_devices_t devices);
-char *pa_list_string_input_device(audio_devices_t devices);
-char *pa_list_string_flags(audio_output_flags_t flags);
-
-/* Get default audio source associated with input device.
- * Return true if default source was found. */
-bool pa_input_device_default_audio_source(audio_devices_t input_device, audio_source_t *default_source);
-
-/* Pretty port names */
-bool pa_droid_output_port_name(audio_devices_t value, const char **to_str);
-bool pa_droid_input_port_name(audio_devices_t value, const char **to_str);
-
-/* Pretty audio source names */
-bool pa_droid_audio_source_name(audio_source_t value, const char **to_str);
-
-int pa_conversion_parse_list(pa_conversion_string_t type, const char *separator,
- const char *str, uint32_t *dst, char **unknown_entries);
-
-bool pa_conversion_parse_sampling_rates(const char *fn, const unsigned ln,
- const char *str, bool legacy,
- uint32_t sampling_rates[AUDIO_MAX_SAMPLING_RATES]);
-bool pa_conversion_parse_formats(const char *fn, const unsigned ln,
- const char *str, bool legacy,
- audio_format_t *formats);
-bool pa_conversion_parse_output_channels(const char *fn, const unsigned ln,
- const char *str, bool legacy,
- audio_channel_mask_t *channels);
-bool pa_conversion_parse_input_channels(const char *fn, const unsigned ln,
- const char *str, bool legacy,
- audio_channel_mask_t *channels);
-bool pa_conversion_parse_output_devices(const char *fn, const unsigned ln,
- char *str, bool legacy, bool must_recognize_all,
- audio_devices_t *devices);
-bool pa_conversion_parse_input_devices(const char *fn, const unsigned ln,
- char *str, bool legacy, bool must_recognize_all,
- audio_devices_t *devices);
-bool pa_conversion_parse_output_flags(const char *fn, const unsigned ln,
- const char *str, audio_output_flags_t *flags);
-bool pa_conversion_parse_input_flags(const char *fn, const unsigned ln,
- const char *str, uint32_t *flags);
-bool pa_conversion_parse_version(const char *fn, const unsigned ln, const char *str, uint32_t *version);
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:pulseaudio-modules-droid-11.1.71.tar.bz2/src/common/droid-config.c
^
|
@@ -1,191 +0,0 @@
-/*
- * Copyright (C) 2013-2018 Jolla Ltd.
- *
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
- *
- * These PulseAudio Modules are free software; you can redistribute
- * it and/or modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "version.h"
-#include "droid-config.h"
-
-#include <signal.h>
-#include <stdio.h>
-#include <string.h>
-#include <strings.h>
-
-#ifdef HAVE_VALGRIND_MEMCHECK_H
-#include <valgrind/memcheck.h>
-#endif
-
-#include <pulse/rtclock.h>
-#include <pulse/timeval.h>
-#include <pulse/volume.h>
-#include <pulse/xmalloc.h>
-
-#include <pulsecore/core.h>
-#include <pulsecore/core-error.h>
-#include <pulsecore/i18n.h>
-#include <pulsecore/module.h>
-#include <pulsecore/memchunk.h>
-#include <pulsecore/sink.h>
-#include <pulsecore/modargs.h>
-#include <pulsecore/core-rtclock.h>
-#include <pulsecore/core-util.h>
-#include <pulsecore/sample-util.h>
-#include <pulsecore/log.h>
-#include <pulsecore/macro.h>
-#include <pulsecore/thread.h>
-#include <pulsecore/thread-mq.h>
-#include <pulsecore/rtpoll.h>
-#include <pulsecore/time-smoother.h>
-#include <pulsecore/refcnt.h>
-#include <pulsecore/shared.h>
-#include <pulsecore/mutex.h>
-#include <pulsecore/strlist.h>
-#include <pulsecore/atomic.h>
-
-#include <hardware/audio.h>
-#include <hardware_legacy/audio_policy_conf.h>
-
-#define VENDOR_AUDIO_POLICY_CONFIG_XML_FILE "/vendor/etc/audio_policy_configuration.xml"
-#define SYSTEM_AUDIO_POLICY_CONFIG_XML_FILE "/system/etc/audio_policy_configuration.xml"
-
-
-pa_droid_config_audio *pa_droid_config_load(pa_modargs *ma) {
- pa_droid_config_audio *config = NULL;
- const char *manual_config;
- const char *config_location[5] = {
- VENDOR_AUDIO_POLICY_CONFIG_XML_FILE,
- SYSTEM_AUDIO_POLICY_CONFIG_XML_FILE,
- AUDIO_POLICY_VENDOR_CONFIG_FILE,
- AUDIO_POLICY_CONFIG_FILE,
- NULL};
-
- pa_assert(ma);
-
- if ((manual_config = pa_modargs_get_value(ma, "config", NULL))) {
- if (!(config = pa_parse_droid_audio_config(manual_config)))
- pa_log("Failed to parse configuration from %s", manual_config);
- } else {
- int i;
- for (i = 0; config_location[i]; i++) {
- if ((config = pa_parse_droid_audio_config(config_location[i])))
- break;
- else
- pa_log_debug("Failed to parse configuration from %s", config_location[i]);
- }
-
- }
-
- if (!config)
- pa_log("Failed to parse any configuration.");
-
- return config;
-}
-
-pa_droid_config_audio *pa_parse_droid_audio_config(const char *filename) {
- const char *suffix;
-
- pa_assert(filename);
-
- if ((suffix = rindex(filename, '.'))) {
- if (strlen(suffix) == 4 && pa_streq(suffix, ".xml"))
- return pa_parse_droid_audio_config_xml(filename);
- else if (strlen(suffix) == 5 && pa_streq(suffix, ".conf"))
- return pa_parse_droid_audio_config_legacy(filename);
- }
-
- return NULL;
-}
-
-void pa_droid_config_free(pa_droid_config_audio *config) {
- pa_droid_config_hw_module *module;
- pa_droid_config_output *output;
- pa_droid_config_input *input;
-
- if (!config)
- return;
-
- while (config->hw_modules) {
- SLLIST_STEAL_FIRST(module, config->hw_modules);
-
- while (module->outputs) {
- SLLIST_STEAL_FIRST(output, module->outputs);
- pa_xfree(output->name);
- pa_xfree(output);
- }
-
- while (module->inputs) {
- SLLIST_STEAL_FIRST(input, module->inputs);
- pa_xfree(input->name);
- pa_xfree(input);
- }
-
- pa_xfree(module->global_config);
- pa_xfree(module->name);
- pa_xfree(module);
- }
-
- pa_xfree(config->global_config);
- pa_xfree(config);
-}
-
-const pa_droid_config_output *pa_droid_config_find_output(const pa_droid_config_hw_module *module, const char *name) {
- pa_droid_config_output *output;
-
- pa_assert(module);
- pa_assert(name);
-
- SLLIST_FOREACH(output, module->outputs) {
- if (pa_streq(name, output->name))
- return output;
- }
-
- return NULL;
-}
-
-const pa_droid_config_input *pa_droid_config_find_input(const pa_droid_config_hw_module *module, const char *name) {
- pa_droid_config_input *input;
-
- pa_assert(module);
- pa_assert(name);
-
- SLLIST_FOREACH(input, module->inputs) {
- if (pa_streq(name, input->name))
- return input;
- }
-
- return NULL;
-}
-
-const pa_droid_config_hw_module *pa_droid_config_find_module(const pa_droid_config_audio *config, const char* module_id) {
- pa_droid_config_hw_module *module;
-
- pa_assert(config);
- pa_assert(module_id);
-
- SLLIST_FOREACH(module, config->hw_modules) {
- if (pa_streq(module_id, module->name))
- return module;
- }
-
- return NULL;
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:pulseaudio-modules-droid-11.1.71.tar.bz2/src/common/droid-config.h
^
|
@@ -1,129 +0,0 @@
-#ifndef foodroidconfigfoo
-#define foodroidconfigfoo
-
-/*
- * Copyright (C) 2018 Jolla Ltd.
- *
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
- *
- * These PulseAudio Modules are free software; you can redistribute
- * it and/or modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <pulsecore/modargs.h>
-
-#include <android-config.h>
-#include <hardware/audio.h>
-
-#include "version.h"
-
-typedef struct pa_droid_config_audio pa_droid_config_audio;
-typedef struct pa_droid_config_hw_module pa_droid_config_hw_module;
-
-#define AUDIO_MAX_SAMPLING_RATES (32)
-
-typedef struct pa_droid_config_global {
- uint32_t audio_hal_version;
- audio_devices_t attached_output_devices;
- audio_devices_t default_output_device;
- audio_devices_t attached_input_devices;
-} pa_droid_config_global;
-
-typedef struct pa_droid_config_output {
- const pa_droid_config_hw_module *module;
-
- char *name;
- uint32_t sampling_rates[AUDIO_MAX_SAMPLING_RATES]; /* (uint32_t) -1 -> dynamic */
- audio_channel_mask_t channel_masks; /* 0 -> dynamic */
- audio_format_t formats; /* 0 -> dynamic */
- audio_devices_t devices;
- audio_output_flags_t flags;
-
- struct pa_droid_config_output *next;
-} pa_droid_config_output;
-
-typedef struct pa_droid_config_input {
- const pa_droid_config_hw_module *module;
-
- char *name;
- uint32_t sampling_rates[AUDIO_MAX_SAMPLING_RATES]; /* (uint32_t) -1 -> dynamic */
- audio_channel_mask_t channel_masks; /* 0 -> dynamic */
- audio_format_t formats; /* 0 -> dynamic */
- audio_devices_t devices;
- /* audio_input_flags_t exists in API 2 & 3, depending on adaptation,
- * so we'll keep the input flags as uint32_t for better compatibility
- * and less ifdefs. */
- uint32_t flags;
-
- struct pa_droid_config_input *next;
-} pa_droid_config_input;
-
-struct pa_droid_config_hw_module {
- const pa_droid_config_audio *config;
-
- char *name;
- /* If global config is not defined for module, use root global config. */
- pa_droid_config_global *global_config;
- pa_droid_config_output *outputs;
- pa_droid_config_input *inputs;
-
- struct pa_droid_config_hw_module *next;
-};
-
-struct pa_droid_config_audio {
- pa_droid_config_global *global_config;
- pa_droid_config_hw_module *hw_modules;
-};
-
-/* Config parser */
-pa_droid_config_audio *pa_droid_config_load(pa_modargs *ma);
-void pa_droid_config_free(pa_droid_config_audio *config);
-pa_droid_config_audio *pa_parse_droid_audio_config_legacy(const char *filename);
-pa_droid_config_audio *pa_parse_droid_audio_config_xml(const char *filename);
-/* autodetect config type from filename and parse */
-pa_droid_config_audio *pa_parse_droid_audio_config(const char *filename);
-
-const pa_droid_config_output *pa_droid_config_find_output(const pa_droid_config_hw_module *module, const char *name);
-const pa_droid_config_input *pa_droid_config_find_input(const pa_droid_config_hw_module *module, const char *name);
-const pa_droid_config_hw_module *pa_droid_config_find_module(const pa_droid_config_audio *config, const char* module_id);
-
-#define SLLIST_APPEND(t, head, item) \
- do { \
- item->next = NULL; \
- if (!head) { \
- head = item; \
- } else { \
- t *_list; \
- for (_list = head; _list->next; _list = _list->next); \
- _list->next = item; \
- } \
- } while (0)
-
-#define SLLIST_FOREACH(i, head) \
- for (i = (head); i; i = i->next)
-
-#define SLLIST_STEAL_FIRST(i, head) \
- do { \
- if (head) { \
- i = head; \
- head = head->next; \
- } else \
- i = NULL; \
- } while (0)
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:pulseaudio-modules-droid-11.1.71.tar.bz2/src/common/version.h
^
|
@@ -1,47 +0,0 @@
-#ifndef foodroidversionfoo
-#define foodroidversionfoo
-
-/*
- * Copyright (C) 2018 Jolla Ltd.
- *
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
- *
- * These PulseAudio Modules are free software; you can redistribute
- * it and/or modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA.
- */
-
-
-#include <android-config.h>
-#include <hardware/audio.h>
-
-#if !defined(ANDROID_VERSION_MAJOR) || !defined(ANDROID_VERSION_MINOR) || !defined(ANDROID_VERSION_PATCH)
-#error "ANDROID_VERSION_* not defined. Did you get your headers via extract-headers.sh?"
-#endif
-
-/* We currently support API version up-to 3.0 */
-#define DROID_API_VERSION_SUPPORT HARDWARE_DEVICE_API_VERSION(3, 0)
-
-#if AUDIO_DEVICE_API_VERSION_CURRENT > DROID_API_VERSION_SUPPORT
-#warning Compiling against higher audio device API version than currently supported!
-#warning Compile likely fails or module may malfunction.
-#endif
-
-#define AUDIO_API_VERSION_MAJ ((AUDIO_DEVICE_API_VERSION_CURRENT >> 8) & 0xff)
-#define AUDIO_API_VERSION_MIN (AUDIO_DEVICE_API_VERSION_CURRENT & 0xff)
-
-#define AUDIO_API_VERSION_GET_MAJ(x) ((x >> 8) & 0xff)
-#define AUDIO_API_VERSION_GET_MIN(x) (x & 0xff)
-
-#endif
|