live
MPEG2TransportStreamAccumulator.hh
Go to the documentation of this file.
1 /**********
2 This library is free software; you can redistribute it and/or modify it under
3 the terms of the GNU Lesser General Public License as published by the
4 Free Software Foundation; either version 3 of the License, or (at your
5 option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
6 
7 This library is distributed in the hope that it will be useful, but WITHOUT
8 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10 more details.
11 
12 You should have received a copy of the GNU Lesser General Public License
13 along with this library; if not, write to the Free Software Foundation, Inc.,
14 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15 **********/
16 // "liveMedia"
17 // Copyright (c) 1996-2021 Live Networks, Inc. All rights reserved.
18 // Collects a stream of incoming MPEG Transport Stream packets into
19 // a chunk sufficiently large to send in a single outgoing (RTP or UDP) packet.
20 // C++ header
21 
22 #ifndef _MPEG2_TRANSPORT_STREAM_ACCUMULATOR_HH
23 #define _MPEG2_TRANSPORT_STREAM_ACCUMULATOR_HH
24 
25 #ifndef _FRAMED_FILTER_HH
26 #include "FramedFilter.hh"
27 #endif
28 
30 public:
33  unsigned maxPacketSize = 1456);
34 
35 protected:
37  FramedSource* inputSource, unsigned maxPacketSize);
38  // called only by createNew()
40 
41 private:
42  // redefined virtual functions:
43  virtual void doGetNextFrame();
44 
45 private:
46  static void afterGettingFrame(void* clientData, unsigned frameSize,
47  unsigned numTruncatedBytes,
48  struct timeval presentationTime,
49  unsigned durationInMicroseconds);
50  void afterGettingFrame1(unsigned frameSize,
51  unsigned numTruncatedBytes,
52  struct timeval presentationTime,
53  unsigned durationInMicroseconds);
54 
55 private:
56  unsigned const fDesiredPacketSize;
58 };
59 
60 #endif
FramedSource * inputSource() const
Definition: FramedFilter.hh:30
MPEG2TransportStreamAccumulator(UsageEnvironment &env, FramedSource *inputSource, unsigned maxPacketSize)
static MPEG2TransportStreamAccumulator * createNew(UsageEnvironment &env, FramedSource *inputSource, unsigned maxPacketSize=1456)
static void afterGettingFrame(void *clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
void afterGettingFrame1(unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)