summaryrefslogtreecommitdiff
path: root/remux
diff options
context:
space:
mode:
authorschmirl <schmirl>2009-06-30 06:04:33 +0000
committerschmirl <schmirl>2009-06-30 06:04:33 +0000
commit7b8e396f775608968ebe274e36fc776bb295dd97 (patch)
treee444931f7d53a9f904b09d5f59d1a64cd628e38e /remux
parent64bf3e5ecf2657b2926fe389fb949f8cf6e7cae7 (diff)
downloadvdr-plugin-streamdev-7b8e396f775608968ebe274e36fc776bb295dd97.tar.gz
vdr-plugin-streamdev-7b8e396f775608968ebe274e36fc776bb295dd97.tar.bz2
now there's a common baseclass for all remuxers, make use of it
Modified Files: HISTORY remux/ts2pes.c remux/ts2pes.h remux/tsremux.h server/livestreamer.c server/livestreamer.h
Diffstat (limited to 'remux')
-rw-r--r--remux/ts2pes.c22
-rw-r--r--remux/ts2pes.h6
-rw-r--r--remux/tsremux.h4
3 files changed, 8 insertions, 24 deletions
diff --git a/remux/ts2pes.c b/remux/ts2pes.c
index baa57bb..eeb56d5 100644
--- a/remux/ts2pes.c
+++ b/remux/ts2pes.c
@@ -10,7 +10,7 @@
* The cRepacker family's code was originally written by Reinhard Nissl <rnissl@gmx.de>,
* and adapted to the VDR coding style by Klaus.Schmidinger@cadsoft.de.
*
- * $Id: ts2pes.c,v 1.1 2009/06/19 06:32:40 schmirl Exp $
+ * $Id: ts2pes.c,v 1.2 2009/06/30 06:04:33 schmirl Exp $
*/
#include "remux/ts2pes.h"
@@ -1931,7 +1931,7 @@ int cTS2PESRemux::Put(const uchar *Data, int Count)
return used;
}
-uchar *cTS2PESRemux::Get(int &Count, uchar *PictureType)
+uchar *cTS2PESRemux::Get(int &Count)
{
// Remove any previously skipped data from the result buffer:
@@ -1940,18 +1940,8 @@ uchar *cTS2PESRemux::Get(int &Count, uchar *PictureType)
resultSkipped = 0;
}
-#if 0
- // Test recording without determining the real frame borders:
- if (PictureType)
- *PictureType = I_FRAME;
- return resultBuffer->Get(Count);
-#endif
-
// Check for frame borders:
- if (PictureType)
- *PictureType = NO_PICTURE;
-
Count = 0;
uchar *resultData = NULL;
int resultCount = 0;
@@ -1972,8 +1962,6 @@ uchar *cTS2PESRemux::Get(int &Count, uchar *PictureType)
}
else if (!synced) {
if (pt == I_FRAME) {
- if (PictureType)
- *PictureType = pt;
resultSkipped = i; // will drop everything before this position
cTSRemux::SetBrokenLink(data + i, l);
synced = true;
@@ -1981,8 +1969,6 @@ uchar *cTS2PESRemux::Get(int &Count, uchar *PictureType)
}
else if (Count)
return resultData;
- else if (PictureType)
- *PictureType = pt;
}
}
else { //if (AUDIO_STREAM_S <= StreamType && StreamType <= AUDIO_STREAM_E || StreamType == PRIVATE_STREAM1) {
@@ -1991,15 +1977,11 @@ uchar *cTS2PESRemux::Get(int &Count, uchar *PictureType)
return resultData;
if (noVideo) {
if (!synced) {
- if (PictureType)
- *PictureType = I_FRAME;
resultSkipped = i; // will drop everything before this position
synced = true;
}
else if (Count)
return resultData;
- else if (PictureType)
- *PictureType = I_FRAME;
}
}
if (synced) {
diff --git a/remux/ts2pes.h b/remux/ts2pes.h
index 2867a41..61ac857 100644
--- a/remux/ts2pes.h
+++ b/remux/ts2pes.h
@@ -4,7 +4,7 @@
* This file is based on a copy of remux.h from Klaus Schmidinger's
* VDR, version 1.6.0.
*
- * $Id: ts2pes.h,v 1.2 2009/06/29 06:23:33 schmirl Exp $
+ * $Id: ts2pes.h,v 1.3 2009/06/30 06:04:33 schmirl Exp $
*/
#ifndef VDR_STREAMDEV_TS2PES_H
@@ -38,11 +38,9 @@ public:
int Put(const uchar *Data, int Count);
///< Puts at most Count bytes of Data into the remuxer.
///< \return Returns the number of bytes actually consumed from Data.
- uchar *Get(int &Count, uchar *PictureType = NULL);
+ uchar *Get(int &Count);
///< Gets all currently available data from the remuxer.
///< \return Count contains the number of bytes the result points to, and
- ///< PictureType (if not NULL) will contain one of NO_PICTURE, I_FRAME, P_FRAME
- ///< or B_FRAME.
void Del(int Count);
///< Deletes Count bytes from the remuxer. Count must be the number returned
///< from a previous call to Get(). Several calls to Del() with fractions of
diff --git a/remux/tsremux.h b/remux/tsremux.h
index 09a5372..dbcb9ff 100644
--- a/remux/tsremux.h
+++ b/remux/tsremux.h
@@ -14,6 +14,10 @@ namespace Streamdev {
class cTSRemux {
public:
+ virtual int Put(const uchar *Data, int Count) = 0;
+ virtual uchar *Get(int &Count) = 0;
+ virtual void Del(int Count) = 0;
+
static void SetBrokenLink(uchar *Data, int Length);
static int GetPid(const uchar *Data);
static int GetPacketLength(const uchar *Data, int Count, int Offset);