summaryrefslogtreecommitdiff
path: root/dxr3nextpts.h
diff options
context:
space:
mode:
authoraustriancoder <austriancoder>2004-08-05 23:05:21 +0000
committeraustriancoder <austriancoder>2004-08-05 23:05:21 +0000
commitc47666d42f7972e1b51f9de61ce0fa27c72f3127 (patch)
treee34a87e37901b7f892fb6f330ccb15bcba30039b /dxr3nextpts.h
downloadvdr-plugin-dxr3-c47666d42f7972e1b51f9de61ce0fa27c72f3127.tar.gz
vdr-plugin-dxr3-c47666d42f7972e1b51f9de61ce0fa27c72f3127.tar.bz2
initial import
Diffstat (limited to 'dxr3nextpts.h')
-rw-r--r--dxr3nextpts.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/dxr3nextpts.h b/dxr3nextpts.h
new file mode 100644
index 0000000..0391a48
--- /dev/null
+++ b/dxr3nextpts.h
@@ -0,0 +1,42 @@
+/*
+ * dxr3nextpts.h:
+ *
+ * See the main source file 'dxr3.c' for copyright information and
+ * how to reach the author.
+ *
+ */
+
+#ifndef _DXR3NEXTPTS_H_
+#define _DXR3NEXTPTS_H_
+
+#include <unistd.h>
+#include <stdint.h>
+#include "dxr3vdrincludes.h"
+#include "dxr3singleton.h"
+
+// ==================================
+// pts program time stamp
+// damit wird ermittelt welches audio frame zu welchem bild gehört
+class cDxr3NextPts : public Singleton<cDxr3NextPts>
+{
+public:
+ cDxr3NextPts() {}
+ ~cDxr3NextPts() {}
+
+ void SetNextPts(uint32_t pts) { Lock(); if (pts) m_nextPts = pts; Unlock(); }
+ uint32_t GetNextPts() { Lock(); uint32_t tmpPts = m_nextPts; Unlock(); return tmpPts;}
+
+ void Clear() { Lock(); m_nextPts = 0; Unlock();}
+
+protected:
+ static cMutex* m_pMutex;
+ uint32_t m_nextPts;
+
+ static void Lock() {cDxr3NextPts::m_pMutex->Lock();}
+ static void Unlock() {cDxr3NextPts::m_pMutex->Unlock();}
+
+private:
+ cDxr3NextPts(cDxr3NextPts&); // no copy constructor
+};
+
+#endif /*_DXR3NEXTPTS_H_*/