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 filter that breaks up an MPEG-4 video elementary stream into 00019 // frames for: 00020 // - Visual Object Sequence (VS) Header + Visual Object (VO) Header 00021 // + Video Object Layer (VOL) Header 00022 // - Group of VOP (GOV) Header 00023 // - VOP frame 00024 // C++ header 00025 00026 #ifndef _MPEG4_VIDEO_STREAM_FRAMER_HH 00027 #define _MPEG4_VIDEO_STREAM_FRAMER_HH 00028 00029 #ifndef _MPEG_VIDEO_STREAM_FRAMER_HH 00030 #include "MPEGVideoStreamFramer.hh" 00031 #endif 00032 00033 class MPEG4VideoStreamFramer: public MPEGVideoStreamFramer { 00034 public: 00035 static MPEG4VideoStreamFramer* 00036 createNew(UsageEnvironment& env, FramedSource* inputSource); 00037 00038 u_int8_t profile_and_level_indication() const { 00039 return fProfileAndLevelIndication; 00040 } 00041 00042 unsigned char* getConfigBytes(unsigned& numBytes) const; 00043 00044 void setConfigInfo(u_int8_t profileAndLevelIndication, char const* configStr); 00045 // Assigns the "profile_and_level_indication" number, and the 'config' bytes. 00046 // If this function is not called, then this data is only assigned later, when it appears in the input stream. 00047 00048 protected: 00049 MPEG4VideoStreamFramer(UsageEnvironment& env, 00050 FramedSource* inputSource, 00051 Boolean createParser = True); 00052 // called only by createNew(), or by subclass constructors 00053 virtual ~MPEG4VideoStreamFramer(); 00054 00055 void startNewConfig(); 00056 void appendToNewConfig(unsigned char* newConfigBytes, 00057 unsigned numNewBytes); 00058 void completeNewConfig(); 00059 00060 private: 00061 // redefined virtual functions: 00062 virtual Boolean isMPEG4VideoStreamFramer() const; 00063 00064 protected: 00065 u_int8_t fProfileAndLevelIndication; 00066 unsigned char* fConfigBytes; 00067 unsigned fNumConfigBytes; 00068 00069 private: 00070 unsigned char* fNewConfigBytes; 00071 unsigned fNumNewConfigBytes; 00072 friend class MPEG4VideoStreamParser; // hack 00073 }; 00074 00075 #endif
1.5.2