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-2012 Live Networks, Inc. All rights reserved. 00018 // A server demultiplexer for a MPEG 1 or 2 Program Stream 00019 // C++ header 00020 00021 #ifndef _MPEG_1OR2_FILE_SERVER_DEMUX_HH 00022 #define _MPEG_1OR2_FILE_SERVER_DEMUX_HH 00023 00024 #ifndef _SERVER_MEDIA_SESSION_HH 00025 #include "ServerMediaSession.hh" 00026 #endif 00027 #ifndef _MPEG_1OR2_DEMUXED_ELEMENTARY_STREAM_HH 00028 #include "MPEG1or2DemuxedElementaryStream.hh" 00029 #endif 00030 00031 class MPEG1or2FileServerDemux: public Medium { 00032 public: 00033 static MPEG1or2FileServerDemux* 00034 createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 00035 00036 ServerMediaSubsession* newAudioServerMediaSubsession(); // MPEG-1 or 2 audio 00037 ServerMediaSubsession* newVideoServerMediaSubsession(Boolean iFramesOnly = False, 00038 double vshPeriod = 5.0 00039 /* how often (in seconds) to inject a Video_Sequence_Header, 00040 if one doesn't already appear in the stream */); 00041 ServerMediaSubsession* newAC3AudioServerMediaSubsession(); // AC-3 audio (from VOB) 00042 00043 unsigned fileSize() const { return fFileSize; } 00044 float fileDuration() const { return fFileDuration; } 00045 00046 private: 00047 MPEG1or2FileServerDemux(UsageEnvironment& env, char const* fileName, 00048 Boolean reuseFirstSource); 00049 // called only by createNew(); 00050 virtual ~MPEG1or2FileServerDemux(); 00051 00052 private: 00053 friend class MPEG1or2DemuxedServerMediaSubsession; 00054 MPEG1or2DemuxedElementaryStream* newElementaryStream(unsigned clientSessionId, 00055 u_int8_t streamIdTag); 00056 00057 private: 00058 char const* fFileName; 00059 unsigned fFileSize; 00060 float fFileDuration; 00061 Boolean fReuseFirstSource; 00062 MPEG1or2Demux* fSession0Demux; 00063 MPEG1or2Demux* fLastCreatedDemux; 00064 unsigned fLastClientSessionId; 00065 }; 00066 00067 #endif
1.5.2