00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _MPEG_VIDEO_STREAM_FRAMER_HH
00023 #define _MPEG_VIDEO_STREAM_FRAMER_HH
00024
00025 #ifndef _FRAMED_FILTER_HH
00026 #include "FramedFilter.hh"
00027 #endif
00028
00029 class TimeCode {
00030 public:
00031 TimeCode();
00032 virtual ~TimeCode();
00033
00034 int operator==(TimeCode const& arg2);
00035 unsigned days, hours, minutes, seconds, pictures;
00036 };
00037
00038 class MPEGVideoStreamFramer: public FramedFilter {
00039 public:
00040 Boolean& pictureEndMarker() { return fPictureEndMarker; }
00041
00042
00043 void flushInput();
00044
00045 protected:
00046 MPEGVideoStreamFramer(UsageEnvironment& env, FramedSource* inputSource);
00047
00048 virtual ~MPEGVideoStreamFramer();
00049
00050 void computePresentationTime(unsigned numAdditionalPictures);
00051
00052 void setTimeCode(unsigned hours, unsigned minutes, unsigned seconds,
00053 unsigned pictures, unsigned picturesSinceLastGOP);
00054
00055 private:
00056 virtual void doGetNextFrame();
00057
00058 private:
00059 void reset();
00060
00061 static void continueReadProcessing(void* clientData,
00062 unsigned char* ptr, unsigned size,
00063 struct timeval presentationTime);
00064 void continueReadProcessing();
00065
00066 protected:
00067 double fFrameRate;
00068 unsigned fPictureCount;
00069 Boolean fPictureEndMarker;
00070 struct timeval fPresentationTimeBase;
00071
00072
00073 class MPEGVideoStreamParser* fParser;
00074 friend class MPEGVideoStreamParser;
00075
00076 private:
00077 TimeCode fCurGOPTimeCode, fPrevGOPTimeCode;
00078 unsigned fPicturesAdjustment;
00079 double fPictureTimeBase;
00080 unsigned fTcSecsBase;
00081 Boolean fHaveSeenFirstTimeCode;
00082 };
00083
00084 #endif