diff --git a/doc/media-api.txt b/doc/media-api.txt
index abf5ff9..c9c2e7a 100644
--- a/doc/media-api.txt
+++ b/doc/media-api.txt
Track duration in milliseconds
+ object Device [readonly]
+
+ Device object path.
+
MediaEndpoint1 hierarchy
========================
diff --git a/profiles/audio/player.c b/profiles/audio/player.c
index 880745d..f8920c9 100644
--- a/profiles/audio/player.c
+++ b/profiles/audio/player.c
};
struct media_player {
+ char *device; /* Device path */
char *path; /* Player object path */
GHashTable *settings; /* Player settings */
GHashTable *track; /* Player current track */
return TRUE;
}
+static gboolean get_device(const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *data)
+{
+ struct media_player *mp = data;
+
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &mp->device);
+
+ return TRUE;
+}
+
static DBusMessage *media_player_play(DBusConnection *conn, DBusMessage *msg,
void *data)
{
G_DBUS_PROPERTY_FLAG_EXPERIMENTAL },
{ "Track", "a{sv}", get_track, NULL, NULL,
G_DBUS_PROPERTY_FLAG_EXPERIMENTAL },
+ { "Device", "s", get_device, NULL, NULL,
+ G_DBUS_PROPERTY_FLAG_EXPERIMENTAL },
{ }
};
g_free(mp->cb);
g_free(mp->status);
g_free(mp->path);
+ g_free(mp->device);
g_free(mp);
}
struct media_player *mp;
mp = g_new0(struct media_player, 1);
+ mp->device = g_strdup(path);
mp->path = g_strdup_printf("%s/player1", path);
mp->settings = g_hash_table_new_full(g_str_hash, g_str_equal,
g_free, g_free);