Introduce functionality for syncing with the media services

* The global synchro semaphore is provided with the purpose of
being used to avoid threads lock up when the media_server is in
an undefined state. There's still room for improvements.
* BMediaRoster::SyncToServices lock up on a semaphore until
the multi_audio correctly connected to the mixer.
This commit is contained in:
Dario Casalinuovo
2016-04-04 01:27:09 +02:00
parent 866084f7a9
commit 53c3fa5137
7 changed files with 65 additions and 6 deletions
+5 -1
View File
@@ -42,7 +42,11 @@ public:
// same time.
// Check if the media services are running.
static bool IsRunning();
static bool IsRunning();
// This functions blocks until the media services are available,
// don't abuse of it.
static status_t SyncToServices(bigtime_t timeout = -1);
// Getting common instances of system nodes:
status_t GetVideoInput(media_node* _node);
+4
View File
@@ -28,6 +28,9 @@ enum {
// add_system_beep_event()
MEDIA_SERVER_ADD_SYSTEM_BEEP_EVENT,
// sent by the rescan thread
MEDIA_SERVER_RESCAN_COMPLETED,
// media add-on server
MEDIA_ADD_ON_SERVER_PLAY_MEDIA = '_TRU'
};
@@ -370,6 +373,7 @@ struct server_register_app_request : request_data {
};
struct server_register_app_reply : reply_data {
sem_id global_synchro;
};
struct server_unregister_app_request : request_data {