BMediaRoster: Add B_MEDIA_SERVER_STARTED and B_MEDIA_SERVER_QUIT

* This is done by watching to registrar notifications
  and providing a minimal service to contact the
  media roster in private API. The roster use this
  service to automatically reconnect to the media_server.
This commit is contained in:
Dario Casalinuovo
2015-07-24 12:19:33 +02:00
parent e57acc3a99
commit 32afe10ab2
7 changed files with 217 additions and 11 deletions
+3 -1
View File
@@ -47,8 +47,10 @@ enum {
B_MEDIA_NEW_PARAMETER_VALUE, /* N "node", "parameter", "when", */
/* "value" */
B_MEDIA_NODE_STOPPED, /* N "node", "when" */
B_MEDIA_FLAVORS_CHANGED /* "be:addon_id", "be:new_count", */
B_MEDIA_FLAVORS_CHANGED, /* "be:addon_id", "be:new_count", */
/* "be:gone_count" */
B_MEDIA_SERVER_STARTED,
B_MEDIA_SERVER_QUIT
};
+5 -1
View File
@@ -16,7 +16,11 @@ namespace media {
namespace dataexchange {
void InitDataExchange();
void InitServerDataExchange();
void InitRosterDataExchange(const BMessenger& rosterMessenger);
// BMessage based data exchange with the current BMediaRoster
status_t SendToRoster(BMessage* msg);
// BMessage based data exchange with the media_server
status_t SendToServer(BMessage* msg);
+2
View File
@@ -88,6 +88,8 @@ public:
BTimeSource* MakeTimeSourceObject(media_node_id timesource_id);
status_t BuildConnections();
private:
friend class BMediaRoster;
};
+6
View File
@@ -32,6 +32,12 @@ enum {
MEDIA_ADD_ON_SERVER_PLAY_MEDIA = '_TRU'
};
enum {
// local media services status notification service
MEDIA_ROSTER_REQUEST_NOTIFICATIONS = 2000,
MEDIA_ROSTER_CANCEL_NOTIFICATIONS
};
// Raw port based communication
enum {
GENERAL_PURPOSE_WAKEUP = 0, // when no action but wait termination needed