live
MPEGVideoStreamFramer.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 breaks up an MPEG video elementary stream into
19// headers and frames
20// C++ header
21
22#ifndef _MPEG_VIDEO_STREAM_FRAMER_HH
23#define _MPEG_VIDEO_STREAM_FRAMER_HH
24
25#ifndef _FRAMED_FILTER_HH
26#include "FramedFilter.hh"
27#endif
28
29class TimeCode {
30public:
32 virtual ~TimeCode();
33
34 int operator==(TimeCode const& arg2) const;
36};
37
39public:
41 // a hack for implementing the RTP 'M' bit
42
43 void flushInput(); // called if there is a discontinuity (seeking) in the input
44
45protected:
47 // we're an abstract base class
49
50 void computePresentationTime(unsigned numAdditionalPictures);
51 // sets "fPresentationTime"
52 void setTimeCode(unsigned hours, unsigned minutes, unsigned seconds,
53 unsigned pictures, unsigned picturesSinceLastGOP);
54
55protected: // redefined virtual functions
56 virtual void doGetNextFrame();
57 virtual void doStopGettingFrames();
58
59private:
60 void reset();
61
62 static void continueReadProcessing(void* clientData,
63 unsigned char* ptr, unsigned size,
64 struct timeval presentationTime);
66
67protected:
68 double fFrameRate; // Note: For MPEG-4, this is really a 'tick rate'
69 unsigned fPictureCount; // hack used to implement doGetNextFrame()
71 struct timeval fPresentationTimeBase;
72
73 // parsing state
75 friend class MPEGVideoStreamParser; // hack
76
77private:
81 unsigned fTcSecsBase;
83};
84
85#endif
unsigned char Boolean
Definition: Boolean.hh:25
FramedSource * inputSource() const
Definition: FramedFilter.hh:30
struct timeval fPresentationTimeBase
virtual ~MPEGVideoStreamFramer()
class MPEGVideoStreamParser * fParser
static void continueReadProcessing(void *clientData, unsigned char *ptr, unsigned size, struct timeval presentationTime)
void computePresentationTime(unsigned numAdditionalPictures)
MPEGVideoStreamFramer(UsageEnvironment &env, FramedSource *inputSource)
virtual void doStopGettingFrames()
virtual void doGetNextFrame()
void setTimeCode(unsigned hours, unsigned minutes, unsigned seconds, unsigned pictures, unsigned picturesSinceLastGOP)
virtual ~TimeCode()
int operator==(TimeCode const &arg2) const