[PATCH 08/13] AVRCP: Implement notification AVAILABLE_PLAYERS_CHANGED

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Notify remote controller about change in available players
when player is being registered or unregistered.
---
 audio/avrcp.c |    5 ++++-
 audio/media.c |    2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/audio/avrcp.c b/audio/avrcp.c
index 9ff0700..895001e 100644
--- a/audio/avrcp.c
+++ b/audio/avrcp.c
@@ -462,6 +462,7 @@ int avrcp_player_event(struct avrcp_player *player, uint8_t id, void *data)
 		break;
 	case AVRCP_EVENT_TRACK_REACHED_END:
 	case AVRCP_EVENT_TRACK_REACHED_START:
+	case AVRCP_EVENT_AVAILABLE_PLAYERS_CHANGED:
 		size = 1;
 		break;
 	default:
@@ -634,11 +635,12 @@ static uint8_t avrcp_handle_get_capabilities(struct avrcp_player *player,
 
 		return AVC_CTYPE_STABLE;
 	case CAP_EVENTS_SUPPORTED:
-		pdu->params[1] = 4;
+		pdu->params[1] = 5;
 		pdu->params[2] = AVRCP_EVENT_PLAYBACK_STATUS_CHANGED;
 		pdu->params[3] = AVRCP_EVENT_TRACK_CHANGED;
 		pdu->params[4] = AVRCP_EVENT_TRACK_REACHED_START;
 		pdu->params[5] = AVRCP_EVENT_TRACK_REACHED_END;
+		pdu->params[6] = AVRCP_EVENT_AVAILABLE_PLAYERS_CHANGED;
 
 		pdu->params_len = htons(2 + pdu->params[1]);
 		return AVC_CTYPE_STABLE;
@@ -985,6 +987,7 @@ static uint8_t avrcp_handle_register_notification(struct avrcp_player *player,
 		break;
 	case AVRCP_EVENT_TRACK_REACHED_END:
 	case AVRCP_EVENT_TRACK_REACHED_START:
+	case AVRCP_EVENT_AVAILABLE_PLAYERS_CHANGED:
 		len = 1;
 		break;
 	default:
diff --git a/audio/media.c b/audio/media.c
index 3455496..6ee8955 100644
--- a/audio/media.c
+++ b/audio/media.c
@@ -1411,6 +1411,8 @@ static void media_update_players(struct media_adapter *adapter)
 		players[i] = mp->path;
 	}
 
+	avrcp_player_event(adapter->addressed->player, AVRCP_EVENT_AVAILABLE_PLAYERS_CHANGED, NULL);
+
 	emit_array_property_changed(adapter->conn, adapter->path,
 					MEDIA_INTERFACE, "Players",
 					DBUS_TYPE_OBJECT_PATH, &players, i);
-- 
on behalf of ST-Ericsson

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux