[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-183-g3c4c1f4

Lennart Poettering gitmailer-noreply at 0pointer.de
Mon Jun 8 07:59:31 PDT 2009


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The master branch has been updated
      from  12d53826f692f5dac60a5026521cffb5c5fb7b85 (commit)

- Log -----------------------------------------------------------------
3c4c1f4 udev: reshuffle the properties we read from udev a bit
f13bbd5 prop: introduce new PA_PROP_DEVICE_INTENDED_ROLES property
-----------------------------------------------------------------------

Summary of changes:
 src/modules/bluetooth/module-bluetooth-device.c |    4 ++++
 src/modules/module-raop-sink.c                  |    1 +
 src/modules/udev-util.c                         |   23 ++++++++++++++++++-----
 src/pulse/proplist.h                            |    3 +++
 src/pulsecore/card.c                            |    1 +
 src/pulsecore/sink.c                            |   17 +++++++++++++++++
 src/pulsecore/sink.h                            |    1 +
 src/pulsecore/source.c                          |    1 +
 8 files changed, 46 insertions(+), 5 deletions(-)

-----------------------------------------------------------------------

commit f13bbd576fef8911275c8eed41ef425163b70398
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Jun 8 16:58:45 2009 +0200

    prop: introduce new PA_PROP_DEVICE_INTENDED_ROLES property

diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index dbec00d..40093cf 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -1622,6 +1622,8 @@ static int add_sink(struct userdata *u) {
         data.module = u->module;
         pa_sink_new_data_set_sample_spec(&data, &u->sample_spec);
         pa_proplist_sets(data.proplist, "bluetooth.protocol", u->profile == PROFILE_A2DP ? "a2dp" : "sco");
+        if (u->profile == PROFILE_HSP)
+            pa_proplist_sets(data.proplist, PA_PROP_DEVICE_INTENDED_ROLES, "phone");
         data.card = u->card;
         data.name = get_name("sink", u->modargs, u->address, &b);
         data.namereg_fail = b;
@@ -1680,6 +1682,8 @@ static int add_source(struct userdata *u) {
         data.module = u->module;
         pa_source_new_data_set_sample_spec(&data, &u->sample_spec);
         pa_proplist_sets(data.proplist, "bluetooth.protocol", u->profile == PROFILE_A2DP ? "a2dp" : "hsp");
+        if (u->profile == PROFILE_HSP)
+            pa_proplist_sets(data.proplist, PA_PROP_DEVICE_INTENDED_ROLES, "phone");
         data.card = u->card;
         data.name = get_name("source", u->modargs, u->address, &b);
         data.namereg_fail = b;
diff --git a/src/modules/module-raop-sink.c b/src/modules/module-raop-sink.c
index 052a3a5..54de42c 100644
--- a/src/modules/module-raop-sink.c
+++ b/src/modules/module-raop-sink.c
@@ -583,6 +583,7 @@ int pa__init(pa_module*m) {
     pa_sink_new_data_set_name(&data, pa_modargs_get_value(ma, "sink_name", DEFAULT_SINK_NAME));
     pa_sink_new_data_set_sample_spec(&data, &ss);
     pa_proplist_sets(data.proplist, PA_PROP_DEVICE_STRING, server);
+    pa_proplist_sets(data.proplist, PA_PROP_DEVICE_INTENDED_ROLES, "music");
     if ((desc = pa_modargs_get_value(ma, "description", NULL)))
         pa_proplist_sets(data.proplist, PA_PROP_DEVICE_DESCRIPTION, desc);
     else
diff --git a/src/pulse/proplist.h b/src/pulse/proplist.h
index 4c791dc..bc4dbd8 100644
--- a/src/pulse/proplist.h
+++ b/src/pulse/proplist.h
@@ -206,6 +206,9 @@ PA_C_DECL_BEGIN
 /** For devices: profile identifier for the profile this devices is in. e.g. "analog-stereo", "analog-surround-40", "iec958-stereo", ...*/
 #define PA_PROP_DEVICE_PROFILE_NAME            "device.profile.name"
 
+/** For devices: intended use. A comma seperated list of roles (see PA_PROP_MEDIA_ROLE) this device is particularly well suited for, due to latency, quality or form factor. \since 0.9.16 */
+#define PA_PROP_DEVICE_INTENDED_ROLES          "device.intended_roles"
+
 /** For devices: human readable one-line description of the profile this device is in. e.g. "Analog Stereo", ... */
 #define PA_PROP_DEVICE_PROFILE_DESCRIPTION     "device.profile.description"
 
diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
index 59b8cda..9c16ef2 100644
--- a/src/pulsecore/card.c
+++ b/src/pulsecore/card.c
@@ -164,6 +164,7 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
 
     pa_device_init_description(c->proplist);
     pa_device_init_icon(c->proplist, TRUE);
+    pa_device_init_intended_roles(c->proplist);
 
     pa_assert_se(pa_idxset_put(core->cards, c, &c->index) >= 0);
 
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 13f0e11..1da094a 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -177,6 +177,7 @@ pa_sink* pa_sink_new(
 
     pa_device_init_description(data->proplist);
     pa_device_init_icon(data->proplist, TRUE);
+    pa_device_init_intended_roles(data->proplist);
 
     if (pa_hook_fire(&core->hooks[PA_CORE_HOOK_SINK_FIXATE], data) < 0) {
         pa_xfree(s);
@@ -2287,3 +2288,19 @@ pa_bool_t pa_device_init_description(pa_proplist *p) {
 
     return FALSE;
 }
+
+pa_bool_t pa_device_init_intended_roles(pa_proplist *p) {
+    const char *s;
+    pa_assert(p);
+
+    if (pa_proplist_contains(p, PA_PROP_DEVICE_INTENDED_ROLES))
+        return TRUE;
+
+    if ((s = pa_proplist_gets(p, PA_PROP_DEVICE_FORM_FACTOR)))
+        if (pa_streq(s, "handset") || pa_streq(s, "hands-free")) {
+            pa_proplist_sets(p, PA_PROP_DEVICE_INTENDED_ROLES, "phone");
+            return TRUE;
+        }
+
+    return FALSE;
+}
diff --git a/src/pulsecore/sink.h b/src/pulsecore/sink.h
index 4dce3f9..0f32d16 100644
--- a/src/pulsecore/sink.h
+++ b/src/pulsecore/sink.h
@@ -241,6 +241,7 @@ void pa_sink_mute_changed(pa_sink *s, pa_bool_t new_muted);
 
 pa_bool_t pa_device_init_description(pa_proplist *p);
 pa_bool_t pa_device_init_icon(pa_proplist *p, pa_bool_t is_sink);
+pa_bool_t pa_device_init_intended_roles(pa_proplist *p);
 
 /**** May be called by everyone, from main context */
 
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 53697c5..d35c852 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -167,6 +167,7 @@ pa_source* pa_source_new(
 
     pa_device_init_description(data->proplist);
     pa_device_init_icon(data->proplist, FALSE);
+    pa_device_init_intended_roles(data->proplist);
 
     if (pa_hook_fire(&core->hooks[PA_CORE_HOOK_SOURCE_FIXATE], data) < 0) {
         pa_xfree(s);

commit 3c4c1f4945b309b3eba11ca67c010469c7ff9256
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Jun 8 16:59:47 2009 +0200

    udev: reshuffle the properties we read from udev a bit

diff --git a/src/modules/udev-util.c b/src/modules/udev-util.c
index 144ad79..de8f5f2 100644
--- a/src/modules/udev-util.c
+++ b/src/modules/udev-util.c
@@ -84,6 +84,19 @@ int pa_udev_get_info(pa_core *core, pa_proplist *p, int card_idx) {
         goto finish;
     }
 
+    if (!pa_proplist_contains(p, PA_PROP_DEVICE_BUS_PATH))
+        if (((v = udev_device_get_property_value(card, "ID_PATH")) && *v) ||
+            (v = udev_device_get_devpath(card)))
+            pa_proplist_sets(p, PA_PROP_DEVICE_BUS_PATH, v);
+
+    if (!pa_proplist_contains(p, "sysfs.path"))
+        if ((v = udev_device_get_devpath(card)))
+            pa_proplist_sets(p, "sysfs.path", v);
+
+    if (!pa_proplist_contains(p, "udev.id"))
+        if ((v = udev_device_get_property_value(card, "ID_ID")) && *v)
+            pa_proplist_sets(p, "udev.id", v);
+
     if (!pa_proplist_contains(p, PA_PROP_DEVICE_BUS))
         if ((v = udev_device_get_property_value(card, "ID_BUS")) && *v)
             pa_proplist_sets(p, PA_PROP_DEVICE_BUS, v);
@@ -114,15 +127,15 @@ int pa_udev_get_info(pa_core *core, pa_proplist *p, int card_idx) {
         if ((v = udev_device_get_property_value(card, "ID_SERIAL")) && *v)
             pa_proplist_sets(p, PA_PROP_DEVICE_SERIAL, v);
 
+    if (!pa_proplist_contains(p, PA_PROP_DEVICE_CLASS))
+        if ((v = udev_device_get_property_value(card, "SOUND_CLASS")) && *v)
+            pa_proplist_sets(p, PA_PROP_DEVICE_CLASS, v);
+
     if (!pa_proplist_contains(p, PA_PROP_DEVICE_FORM_FACTOR))
         if ((v = udev_device_get_property_value(card, "SOUND_FORM_FACTOR")) && *v)
             pa_proplist_sets(p, PA_PROP_DEVICE_FORM_FACTOR, v);
 
-    if (!pa_proplist_contains(p, PA_PROP_DEVICE_BUS_PATH))
-        if ((v = udev_device_get_devpath(card)))
-            pa_proplist_sets(p, PA_PROP_DEVICE_BUS_PATH, v);
-
-    /* This is normaly not set by th udev rules but may be useful to
+    /* This is normaly not set by the udev rules but may be useful to
      * allow administrators to overwrite the device description.*/
     if (!pa_proplist_contains(p, PA_PROP_DEVICE_DESCRIPTION))
         if ((v = udev_device_get_property_value(card, "SOUND_DESCRIPTION")) && *v)

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list