summaryrefslogtreecommitdiff
path: root/tsstreamerrorcounter.h
diff options
context:
space:
mode:
authoretobi <git@e-tobi.net>2011-10-02 23:10:29 +0200
committeretobi <git@e-tobi.net>2011-10-02 23:10:29 +0200
commit0e7880576c0dcf84eaa53cd9c73bc2b5bf1e8d01 (patch)
tree1f4e839ce18099b540143bfacfe1cedc537b48d6 /tsstreamerrorcounter.h
downloadvdr-checkts-0e7880576c0dcf84eaa53cd9c73bc2b5bf1e8d01.tar.gz
vdr-checkts-0e7880576c0dcf84eaa53cd9c73bc2b5bf1e8d01.tar.bz2
Initial commitHEAD0.1master
Diffstat (limited to 'tsstreamerrorcounter.h')
-rw-r--r--tsstreamerrorcounter.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/tsstreamerrorcounter.h b/tsstreamerrorcounter.h
new file mode 100644
index 0000000..4f21fbc
--- /dev/null
+++ b/tsstreamerrorcounter.h
@@ -0,0 +1,31 @@
+#ifndef __TSCHECKER_H
+#define __TSCHECKER_H
+
+#define TS_SYNC_BYTE 0x47
+#define TS_SIZE 188
+
+// TS stream error counter:
+// Count (continuity) errors in a TS packet stream
+
+#define MAX_PIDS 20
+typedef unsigned char uchar;
+
+class cTsStreamErrorCounter {
+private:
+ int errorCount;
+ int pids[MAX_PIDS];
+ uchar counters[MAX_PIDS];
+public:
+ cTsStreamErrorCounter(void);
+ void CheckTsPackets(uchar* Data, int Length);
+ ///< Check for errors in the TS packets pointed to by Data. Length is the
+ ///< number of bytes Data points to, and must be a multiple of 188.
+ int ErrorCount(void) const { return errorCount; };
+ ///< Return the number of errors found in the analyzed TS packet stream.
+ ///< Right now, only continuity errors are reported.
+private:
+ void CheckTsPacketContinuity(int pid, int counter);
+ };
+
+
+#endif // __TSCHECKER_H