summaryrefslogtreecommitdiff
path: root/remux.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2009-03-27 13:38:59 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2009-03-27 13:38:59 +0100
commit323969e58df323ddce392be9abee5fd4019b79fc (patch)
tree5debabf57fd99a6bb8757148f7bd7eb8a668d16a /remux.h
parente7ea3b3c70d737ba758527b806c040dbf8ec8e45 (diff)
downloadvdr-323969e58df323ddce392be9abee5fd4019b79fc.tar.gz
vdr-323969e58df323ddce392be9abee5fd4019b79fc.tar.bz2
Adapted cFrameDetector::Analyze() to HD NTSC broadcasts that split frames over several payload units
Diffstat (limited to 'remux.h')
-rw-r--r--remux.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/remux.h b/remux.h
index b41b4c8d..ccb38821 100644
--- a/remux.h
+++ b/remux.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: remux.h 2.8 2009/03/08 12:05:12 kls Exp $
+ * $Id: remux.h 2.9 2009/03/27 13:38:59 kls Exp $
*/
#ifndef __REMUX_H
@@ -267,14 +267,22 @@ void PesDump(const char *Name, const u_char *Data, int Length);
class cFrameDetector {
private:
+ enum { MaxPtsValues = 150 };
int pid;
int type;
+ bool synced;
bool newFrame;
bool independentFrame;
- int64_t lastPts;
+ uint32_t ptsValues[MaxPtsValues]; // 32 bit is enough - we only need the delta
+ int numPtsValues;
+ int numIFrames;
bool isVideo;
int frameDuration;
- int framesPerPayloadUnit;
+ int framesInPayloadUnit;
+ int framesPerPayloadUnit; // Some broadcasters send one frame per payload unit (== 1),
+ // some put an entire GOP into one payload unit (> 1), and
+ // some spread a single frame over several payload units (< 0).
+ int payloadUnitOfFrame;
bool scanning;
uint32_t scanner;
public:
@@ -282,10 +290,11 @@ public:
int Analyze(const uchar *Data, int Length);
///< Analyzes the TS packets pointed to by Data. Length is the number of
///< bytes Data points to, and must be a multiple of 188.
- ///< Returns the number of bytes that have been analyzed and may be written
- ///< to the recording file. If the return value is 0, the data was not
- ///< sufficient for analyzing and Analyze() needs to be called again with
- ///< more actual data.
+ ///< Returns the number of bytes that have been analyzed.
+ ///< If the return value is 0, the data was not sufficient for analyzing and
+ ///< Analyze() needs to be called again with more actual data.
+ bool Synced(void) { return synced; }
+ ///< Returns true if the frame detector has synced on the data stream.
bool NewFrame(void) { return newFrame; }
///< Returns true if the data given to the last call to Analyze() started a
///< new frame.