00001 /********** 00002 This library is free software; you can redistribute it and/or modify it under 00003 the terms of the GNU Lesser General Public License as published by the 00004 Free Software Foundation; either version 2.1 of the License, or (at your 00005 option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.) 00006 00007 This library is distributed in the hope that it will be useful, but WITHOUT 00008 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00009 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 00010 more details. 00011 00012 You should have received a copy of the GNU Lesser General Public License 00013 along with this library; if not, write to the Free Software Foundation, Inc., 00014 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00015 **********/ 00016 // "liveMedia" 00017 // Copyright (c) 1996-2008 Live Networks, Inc. All rights reserved. 00018 // A MPEG 1 or 2 Elementary Stream, demultiplexed from a Program Stream 00019 // C++ header 00020 00021 #ifndef _MPEG_1OR2_DEMUXED_ELEMENTARY_STREAM_HH 00022 #define _MPEG_1OR2_DEMUXED_ELEMENTARY_STREAM_HH 00023 00024 #ifndef _MPEG_1OR2_DEMUX_HH 00025 #include "MPEG1or2Demux.hh" 00026 #endif 00027 00028 class MPEG1or2DemuxedElementaryStream: public FramedSource { 00029 public: 00030 MPEG1or2Demux::SCR lastSeenSCR() const { return fLastSeenSCR; } 00031 00032 unsigned char mpegVersion() const { return fMPEGversion; } 00033 00034 MPEG1or2Demux& sourceDemux() const { return fOurSourceDemux; } 00035 00036 private: // We are created only by a MPEG1or2Demux (a friend) 00037 MPEG1or2DemuxedElementaryStream(UsageEnvironment& env, 00038 u_int8_t streamIdTag, 00039 MPEG1or2Demux& sourceDemux); 00040 virtual ~MPEG1or2DemuxedElementaryStream(); 00041 00042 private: 00043 // redefined virtual functions: 00044 virtual void doGetNextFrame(); 00045 virtual void doStopGettingFrames(); 00046 virtual char const* MIMEtype() const; 00047 virtual unsigned maxFrameSize() const; 00048 00049 private: 00050 static void afterGettingFrame(void* clientData, 00051 unsigned frameSize, unsigned numTruncatedBytes, 00052 struct timeval presentationTime, 00053 unsigned durationInMicroseconds); 00054 00055 void afterGettingFrame1(unsigned frameSize, unsigned numTruncatedBytes, 00056 struct timeval presentationTime, 00057 unsigned durationInMicroseconds); 00058 00059 private: 00060 u_int8_t fOurStreamIdTag; 00061 MPEG1or2Demux& fOurSourceDemux; 00062 char const* fMIMEtype; 00063 MPEG1or2Demux::SCR fLastSeenSCR; 00064 unsigned char fMPEGversion; 00065 00066 friend class MPEG1or2Demux; 00067 }; 00068 00069 #endif
1.5.2