00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _DV_VIDEO_STREAM_FRAMER_HH
00022 #define _DV_VIDEO_STREAM_FRAMER_HH
00023
00024 #ifndef _FRAMED_FILTER_HH
00025 #include "FramedFilter.hh"
00026 #endif
00027
00028 #define DV_DIF_BLOCK_SIZE 80
00029 #define DV_NUM_BLOCKS_PER_SEQUENCE 150
00030 #define DV_SAVED_INITIAL_BLOCKS_SIZE ((DV_NUM_BLOCKS_PER_SEQUENCE+6-1)*DV_DIF_BLOCK_SIZE)
00031
00032
00033 class DVVideoStreamFramer: public FramedFilter {
00034 public:
00035 static DVVideoStreamFramer*
00036 createNew(UsageEnvironment& env, FramedSource* inputSource, Boolean sourceIsSeekable = False);
00037
00038
00039 char const* profileName();
00040 Boolean getFrameParameters(unsigned& frameSize, double& frameDuration);
00041
00042 protected:
00043 DVVideoStreamFramer(UsageEnvironment& env, FramedSource* inputSource, Boolean sourceIsSeekable);
00044
00045 virtual ~DVVideoStreamFramer();
00046
00047 private:
00048
00049 virtual Boolean isDVVideoStreamFramer() const;
00050 virtual void doGetNextFrame();
00051
00052 private:
00053 void getAndDeliverData();
00054 static void afterGettingFrame(void* clientData, unsigned frameSize,
00055 unsigned numTruncatedBytes,
00056 struct timeval presentationTime,
00057 unsigned durationInMicroseconds);
00058 void afterGettingFrame1(unsigned frameSize, unsigned numTruncatedBytes);
00059 void getProfile();
00060
00061 private:
00062 void const* fOurProfile;
00063 struct timeval fNextFramePresentationTime;
00064 unsigned char fSavedInitialBlocks[DV_SAVED_INITIAL_BLOCKS_SIZE];
00065 char fInitialBlocksPresent;
00066 Boolean fSourceIsSeekable;
00067 };
00068
00069 #endif