live
MPEG2TransportStreamAccumulator.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// 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
30public:
33 unsigned maxPacketSize = 1456);
34
35protected:
37 FramedSource* inputSource, unsigned maxPacketSize);
38 // called only by createNew()
40
41private:
42 // redefined virtual functions:
43 virtual void doGetNextFrame();
44
45private:
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
55private:
56 unsigned const fDesiredPacketSize;
58};
59
60#endif
FramedSource * inputSource() const
Definition: FramedFilter.hh:30
MPEG2TransportStreamAccumulator(UsageEnvironment &env, FramedSource *inputSource, unsigned maxPacketSize)
static void afterGettingFrame(void *clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
static MPEG2TransportStreamAccumulator * createNew(UsageEnvironment &env, FramedSource *inputSource, unsigned maxPacketSize=1456)
void afterGettingFrame1(unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)