51 #if defined (PLAYER_STATIC)
52 #define PLAYERCORE_EXPORT
53 #elif defined (playercore_EXPORTS)
54 #define PLAYERCORE_EXPORT __declspec (dllexport)
56 #define PLAYERCORE_EXPORT __declspec (dllimport)
59 #define PLAYERCORE_EXPORT
64 #include <libplayercommon/playercommon.h>
65 #include <libplayercore/message.h>
66 #include <libplayerinterface/player.h>
67 #include <libplayercore/property.h>
86 #define HANDLE_CAPABILITY_REQUEST(device_addr, queue, hdr, data, cap_type, cap_subtype) \
87 if(Message::MatchMessage(hdr, PLAYER_MSGTYPE_REQ, PLAYER_CAPABILTIES_REQ, device_addr)) \
89 player_capabilities_req_t & cap_req = * reinterpret_cast<player_capabilities_req_t *> (data);\
90 if (cap_req.type == cap_type && cap_req.subtype == cap_subtype) \
92 Publish(device_addr, queue, PLAYER_MSGTYPE_RESP_ACK, PLAYER_CAPABILTIES_REQ); \
120 bool HasSubscriptions();
153 virtual bool Wait(
double TimeOut=0.0);
156 int AddFileWatch(
int fd,
bool ReadWatch =
true,
bool WriteWatch =
false,
bool ExceptWatch =
true);
159 int RemoveFileWatch(
int fd,
bool ReadWatch =
true,
bool WriteWatch =
false,
bool ExceptWatch =
true);
171 virtual void Lock(
void);
173 virtual void Unlock(
void);
176 virtual void SubscriptionLock(
void);
178 virtual void SubscriptionUnlock(
void);
214 double* timestamp=NULL,
235 double* timestamp=NULL,
306 bool overwrite_cmds =
true,
374 virtual int Terminate();
399 void ProcessMessages(
int maxmsgs);
405 void ProcessMessages(
void);
422 this->ProcessMessages();
432 virtual int ProcessInternalMessages(
QueuePointer& resp_queue,
443 virtual bool RegisterProperty(
const char *key,
Property *prop,
ConfigFile* cf,
int section);
455 typedef enum player_thread_state
457 PLAYER_THREAD_STATE_STOPPED,
458 PLAYER_THREAD_STATE_RUNNING,
459 PLAYER_THREAD_STATE_STOPPING,
460 PLAYER_THREAD_STATE_RESTARTING
461 } player_thread_state_t;
468 pthread_mutex_init(&barrierMutex,NULL);
469 pthread_cond_init(&barrierCond,NULL);
474 pthread_mutex_destroy(&barrierMutex);
475 pthread_cond_destroy(&barrierCond);
478 int SetValue(
int Value)
480 return barrierValue = Value;
485 pthread_mutex_lock(&barrierMutex);
486 assert(barrierValue);
488 pthread_cond_wait(&barrierCond,&barrierMutex);
490 pthread_cond_broadcast(&barrierCond);
491 pthread_mutex_unlock(&barrierMutex);
497 pthread_mutex_t barrierMutex;
501 pthread_cond_t barrierCond;
552 virtual void StartThread(
void);
558 virtual void StopThread(
void);
562 static void* DummyMain(
void *driver);
566 static void DummyMainQuit(
void *driver);
577 bool SetupSuccessful;
612 bool overwrite_cmds =
true,
647 virtual void Main(
void) = 0;
667 bool Wait(
double TimeOut=0.0);