50 #ifndef NPTPROCESSOR_H_
51 #define NPTPROCESSOR_H_
53 #include "system/thread/Thread.h"
54 using namespace br::pucrio::telemidia::ginga::core::system::thread;
56 #include "system/compat/SystemCompat.h"
57 using namespace ::br::pucrio::telemidia::ginga::core::system::compat;
59 #include "system/time/ITimeBaseProvider.h"
60 using namespace br::pucrio::telemidia::ginga::core::system::time;
62 #include "tuner/providers/ISTCProvider.h"
63 using namespace br::pucrio::telemidia::ginga::core::tuning;
65 #include "DSMCCSectionPayload.h"
66 #include "MpegDescriptor.h"
67 #include "NPTReference.h"
68 #include "TimeBaseClock.h"
82 namespace dataprocessing {
94 static const unsigned short MAX_NPT_VALUE = 47721;
95 static const char INVALID_CID = -1;
96 static const short NPT_ST_OCCURRING = 0;
97 static const short NPT_ST_PAUSED = 1;
103 unsigned char currentCid;
104 unsigned char occurringTimeBaseId;
106 pthread_mutex_t loopMutex;
107 pthread_mutex_t schedMutex;
108 pthread_mutex_t lifeMutex;
110 map<unsigned char, NPTReference*> scheduledNpts;
111 map<unsigned char, TimeBaseClock*> timeBaseClock;
112 map<unsigned char, Stc*> timeBaseLife;
113 map<unsigned char, set<ITimeBaseProvider*>*> loopListeners;
114 map<unsigned char, map<TimeControl*, set<ITimeBaseProvider*>*>*> timeListeners;
115 set<ITimeBaseProvider*> cidListeners;
120 map<char,NPTReference*> lastNptList;
126 void setNptPrinter(
bool nptPrinter);
129 uint64_t getSTCValue();
130 void clearUnusedTimebase();
138 bool addTimeListener(
146 unsigned char getOccurringTimeBaseId();
149 unsigned char getCurrentTimeBaseId();
150 void notifyLoopToTimeListeners();
151 void notifyTimeListeners(
unsigned char cid,
double nptValue);
152 void notifyNaturalEndListeners(
unsigned char cid,
double nptValue);
153 void notifyIdListeners(
unsigned char oldCid,
unsigned char newCid);
157 double getCurrentTimeValue(
unsigned char timeBaseId);
160 int decodeDescriptors(vector<MpegDescriptor*>* list);
161 double getNPTValue(
unsigned char contentId);
164 char getNextNptValue(
char cid,
double *nextNptValue,
double* sleepTime);
166 bool processNptValues();
Definition: TimeBaseClock.h:65
Definition: NPTProcessor.h:86
Definition: ITimeBaseListener.h:62
Definition: ISTCProvider.h:64
Definition: ITimeBaseProvider.h:62
Definition: NPTReference.h:67