device-manager: Add support for network device type 67/208067/1
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 17 Jun 2019 23:22:02 +0000 (08:22 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 17 Jun 2019 23:34:41 +0000 (08:34 +0900)
The previous raop device type is changed to network device type.
Rather the 'raop' is demoted from device type to a role of the
type. A new role will be added to this network device type in the
upcoming patch.

[Version] 11.1.52
[Issue type] Improvement

Change-Id: I939d253de1a5804b85dae6cdb0ae375209ee41e9
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/pulseaudio-modules-tizen.spec
src/device-manager.c
src/module-tizenaudio-policy.c
src/tizen-device-def.c
src/tizen-device-def.h

index f13b60c..e8d631f 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          11.1.51
+Version:          11.1.52
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index 0782054..f1aa002 100644 (file)
@@ -1439,14 +1439,14 @@ static void handle_raop_pulse_device(pa_object *pdevice, bool is_loaded, pa_devi
         const char *name = pa_proplist_gets(prop, PA_PROP_DEVICE_DESCRIPTION);
 
         pa_tz_device_new_data_init(&data, dm->device_list, dm->comm, dm->dbus_conn);
-        _fill_new_data_basic(&data, DEVICE_TYPE_RAOP, DM_DEVICE_DIRECTION_OUT, false, dm);
+        _fill_new_data_basic(&data, DEVICE_TYPE_NETWORK, DM_DEVICE_DIRECTION_OUT, false, dm);
         pa_tz_device_new_data_set_name(&data, name);
         pa_tz_device_new_data_set_system_id(&data, system_id);
-        pa_tz_device_new_data_add_sink(&data, DEVICE_ROLE_NORMAL, PA_SINK(pdevice));
+        pa_tz_device_new_data_add_sink(&data, DEVICE_ROLE_RAOP, PA_SINK(pdevice));
         pa_tz_device_new(&data);
         pa_tz_device_new_data_done(&data);
     } else {
-        if (!(device = device_list_get_device(dm, DEVICE_TYPE_RAOP, NULL, system_id)))
+        if (!(device = device_list_get_device(dm, DEVICE_TYPE_NETWORK, NULL, system_id)))
             pa_log_warn("Can't get RAOP device for %s", system_id);
         else
             pa_tz_device_free(device);
@@ -2315,7 +2315,7 @@ static pa_sink* load_sink(pa_device_manager *dm, const char *type, const char *r
     }
 
     if (!(type_info = _device_manager_get_type_info(dm->type_infos, type, role))) {
-        pa_log_error("No type map for %s", type);
+        pa_log_error("No type map for %s.%s", type, role);
         return NULL;
     }
 
@@ -2364,7 +2364,7 @@ static void unload_sink(pa_device_manager *dm, const char *type, const char *rol
     pa_log_info("Unload Sink for '%s.%s'", type, role);
 
     if (!(type_info = _device_manager_get_type_info(dm->type_infos, type, role))) {
-        pa_log_error("No type map for %s", type);
+        pa_log_error("No type map for %s.%s", type, role);
         return;
     }
 
@@ -2406,7 +2406,7 @@ static pa_source* load_source(pa_device_manager *dm, const char *type, const cha
     }
 
     if (!(type_info = _device_manager_get_type_info(dm->type_infos, type, role))) {
-        pa_log_error("No type map for %s", type);
+        pa_log_error("No type map for %s.%s", type, role);
         return NULL;
     }
 
@@ -2455,7 +2455,7 @@ static void unload_source(pa_device_manager *dm, const char *type, const char *r
     pa_log_info("Unload Source for '%s.%s'", type, role);
 
     if (!(type_info = _device_manager_get_type_info(dm->type_infos, type, role))) {
-        pa_log_error("No type map for %s", type);
+        pa_log_error("No type map for %s.%s", type, role);
         return;
     }
 
@@ -2570,9 +2570,8 @@ const char* pa_device_manager_get_device_string(pa_device_manager *dm, bool is_p
     pa_assert(type);
     pa_assert(role);
 
-    type_info = _device_manager_get_type_info(dm->type_infos, type, role);
-    if (type_info == NULL) {
-        pa_log_error("No type info for %s", type);
+    if (!(type_info = _device_manager_get_type_info(dm->type_infos, type, role))) {
+        pa_log_error("No type info for %s.%s", type, role);
         return NULL;
     }
 
index 674b0c3..3c35d78 100644 (file)
@@ -111,7 +111,7 @@ typedef enum _device_type {
     DEVICE_HDMI,
     DEVICE_FORWARDING,
     DEVICE_USB_AUDIO,
-    DEVICE_RAOP,
+    DEVICE_NETWORK,
     DEVICE_UNKNOWN,
     DEVICE_MAX,
 } device_type_t;
@@ -144,9 +144,8 @@ static device_type_t convert_device_type_str(const char *device)
         return DEVICE_FORWARDING;
     else if (pa_safe_streq(device, DEVICE_TYPE_USB_AUDIO))
         return DEVICE_USB_AUDIO;
-    else if (pa_safe_streq(device, DEVICE_TYPE_RAOP))
-        return DEVICE_RAOP;
-
+    else if (pa_safe_streq(device, DEVICE_TYPE_NETWORK))
+        return DEVICE_NETWORK;
 
     pa_log_warn("unknown device (%s)", device);
     return DEVICE_UNKNOWN;
index e423af4..eff1e5e 100644 (file)
@@ -57,7 +57,7 @@ bool device_type_is_valid(const char *device_type) {
         return true;
     else if (pa_safe_streq(device_type, DEVICE_TYPE_USB_AUDIO))
         return true;
-    else if (pa_safe_streq(device_type, DEVICE_TYPE_RAOP))
+    else if (pa_safe_streq(device_type, DEVICE_TYPE_NETWORK))
         return true;
     else
         return false;
@@ -68,7 +68,7 @@ bool device_type_is_use_external_card(const char *device_type) {
         return true;
     else if (pa_safe_streq(device_type, DEVICE_TYPE_BT_A2DP))
         return true;
-    else if (pa_safe_streq(device_type, DEVICE_TYPE_RAOP))
+    else if (pa_safe_streq(device_type, DEVICE_TYPE_NETWORK))
         return true;
     else
         return false;
@@ -134,7 +134,7 @@ bool device_type_is_valid_direction(const char *device_type, dm_device_direction
         return direction == DM_DEVICE_DIRECTION_BOTH;
     else if (pa_safe_streq(device_type, DEVICE_TYPE_USB_AUDIO))
         return direction == DM_DEVICE_DIRECTION_BOTH || direction == DM_DEVICE_DIRECTION_OUT || direction == DM_DEVICE_DIRECTION_IN;
-    else if (pa_safe_streq(device_type, DEVICE_TYPE_RAOP))
+    else if (pa_safe_streq(device_type, DEVICE_TYPE_NETWORK))
         return direction == DM_DEVICE_DIRECTION_OUT;
     else
         return false;
@@ -171,6 +171,8 @@ bool device_role_is_valid(const char *device_role) {
         return true;
     else if (pa_safe_streq(device_role, DEVICE_ROLE_UHQA))
         return true;
+    else if (pa_safe_streq(device_role, DEVICE_ROLE_RAOP))
+        return true;
     else
         return false;
 }
index a64b34e..55b2a49 100644 (file)
@@ -13,7 +13,7 @@
 #define DEVICE_TYPE_HDMI                    "hdmi"
 #define DEVICE_TYPE_FORWARDING              "forwarding"
 #define DEVICE_TYPE_USB_AUDIO               "usb-audio"
-#define DEVICE_TYPE_RAOP                    "raop"
+#define DEVICE_TYPE_NETWORK                 "network"
 #define DEVICE_TYPE_NONE                    "none"
 
 #define DEVICE_ROLE_NORMAL                  "normal"
@@ -23,6 +23,7 @@
 #define DEVICE_ROLE_LOW_LATENCY             "low-latency"
 #define DEVICE_ROLE_HIGH_LATENCY            "high-latency"
 #define DEVICE_ROLE_UHQA                    "uhqa"
+#define DEVICE_ROLE_RAOP                    "raop"
 
 typedef enum dm_device_direction_type {
     DM_DEVICE_DIRECTION_NONE,