live
MPEG2TransportStreamFramer.hh
Go to the documentation of this file.
1/**********
2This library is free software; you can redistribute it and/or modify it under
3the terms of the GNU Lesser General Public License as published by the
4Free Software Foundation; either version 3 of the License, or (at your
5option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
6
7This library is distributed in the hope that it will be useful, but WITHOUT
8ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10more details.
11
12You should have received a copy of the GNU Lesser General Public License
13along with this library; if not, write to the Free Software Foundation, Inc.,
1451 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15**********/
16// "liveMedia"
17// Copyright (c) 1996-2024 Live Networks, Inc. All rights reserved.
18// A filter that passes through (unchanged) chunks that contain an integral number
19// of MPEG-2 Transport Stream packets, but returning (in "fDurationInMicroseconds")
20// an updated estimate of the time gap between chunks.
21// C++ header
22
23#ifndef _MPEG2_TRANSPORT_STREAM_FRAMER_HH
24#define _MPEG2_TRANSPORT_STREAM_FRAMER_HH
25
26#ifndef _FRAMED_FILTER_HH
27#include "FramedFilter.hh"
28#endif
29
30#ifndef _HASH_TABLE_HH
31#include "HashTable.hh"
32#endif
33
35public:
38
39 u_int64_t tsPacketCount() const { return fTSPacketCount; }
40
41 void changeInputSource(FramedSource* newInputSource) { fInputSource = newInputSource; }
42
44 void setNumTSPacketsToStream(unsigned long numTSRecordsToStream);
45 void setPCRLimit(float pcrLimit);
46
47protected:
49 // called only by createNew()
51
52private:
53 // Redefined virtual functions:
54 virtual void doGetNextFrame();
55 virtual void doStopGettingFrames();
56
57private:
58 static void afterGettingFrame(void* clientData, unsigned frameSize,
59 unsigned numTruncatedBytes,
60 struct timeval presentationTime,
61 unsigned durationInMicroseconds);
62 void afterGettingFrame1(unsigned frameSize,
63 struct timeval presentationTime);
64
65 Boolean updateTSPacketDurationEstimate(unsigned char* pkt, double timeNow);
66
67private:
68 u_int64_t fTSPacketCount;
71 u_int64_t fTSPCRCount;
73 unsigned long fNumTSPacketsToStream; // used iff "fLimitNumTSPacketsToStream" is True
75 float fPCRLimit; // used iff "fLimitTSPacketsToStreamByPCR" is True
76};
77
78#endif
unsigned char Boolean
Definition: Boolean.hh:25
FramedSource * fInputSource
Definition: FramedFilter.hh:49
FramedSource * inputSource() const
Definition: FramedFilter.hh:30
static void afterGettingFrame(void *clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
void changeInputSource(FramedSource *newInputSource)
void afterGettingFrame1(unsigned frameSize, struct timeval presentationTime)
virtual void doGetNextFrame()
void setNumTSPacketsToStream(unsigned long numTSRecordsToStream)
void setPCRLimit(float pcrLimit)
static MPEG2TransportStreamFramer * createNew(UsageEnvironment &env, FramedSource *inputSource)
Boolean updateTSPacketDurationEstimate(unsigned char *pkt, double timeNow)
virtual ~MPEG2TransportStreamFramer()
MPEG2TransportStreamFramer(UsageEnvironment &env, FramedSource *inputSource)
virtual void doStopGettingFrames()