live
MPEGVideoStreamFramer.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-2022 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 
29 class TimeCode {
30 public:
32  virtual ~TimeCode();
33 
34  int operator==(TimeCode const& arg2);
36 };
37 
39 public:
41  // a hack for implementing the RTP 'M' bit
42 
43  void flushInput(); // called if there is a discontinuity (seeking) in the input
44 
45 protected:
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 
55 protected: // redefined virtual functions
56  virtual void doGetNextFrame();
57  virtual void doStopGettingFrames();
58 
59 private:
60  void reset();
61 
62  static void continueReadProcessing(void* clientData,
63  unsigned char* ptr, unsigned size,
64  struct timeval presentationTime);
66 
67 protected:
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 
77 private:
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)
int operator==(TimeCode const &arg2)
virtual ~TimeCode()