Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MNRTPDecoderMP4A.h

Go to the documentation of this file.
00001 /* Copyright (C) 2000 KOM/Darmstadt University of Technology 00002 * 00003 * You are allowed to use all other parts of the code under the following terms: 00004 * 00005 * For non-commercial use, code may be used in unmodified form provided 00006 * that this copyright notice and this permission notice appear in 00007 * supporting documentation. 00008 * 00009 * This software is provided "as is" and without any express or implied 00010 * warranties, including, without limitation, the implied warranty of 00011 * fitness for a particular purpose. 00012 * 00013 * The code may be subjected to the GNU General Public License, Version 2, 00014 * and re-distributed under the terms of this license. 00015 * As a special exception, permission is granted to link this code 00016 * with the Qt library and distribute executables, as long as you 00017 * follow the requirements of the GNU GPL in regard to all of the 00018 * software in the executable aside from Qt. 00019 * 00020 * Commercial use other than under the terms of the GNU General Public 00021 * License is allowed only after express negotiation of conditions 00022 * with the authors. 00023 */ 00024 #ifndef MNRTPDECODERMP4A_H 00025 #define MNRTPDECODERMP4A_H 00026 00027 #include "MNRTPDecoderCommon.h" 00028 #include "PayloadTypeEntry.h" 00029 00030 namespace SDP 00031 { 00032 class PayloadTypeTable; 00033 class PayloadTypeEntry; 00034 }; 00035 00036 struct AUHeader { 00037 unsigned size; 00038 unsigned index; 00039 }; 00040 00041 00053 class MNRTPDecoderMP4A : public MNRTPDecoderCommon 00054 { 00055 // saves the number of runs 00056 int _call_i; 00057 // saves the payload type table for retrieving the important configuration 00058 // information 00059 const SDP::PayloadTypeTable* _payload_types; 00060 // size of the au headers 00061 int fSizeLength; 00062 int fIndexLength; 00063 int fIndexDeltaLength; 00064 // number of AU headers 00065 unsigned fNumAUHeaders; 00066 unsigned fNextAUHeader; 00067 00068 struct AUHeader* fAUHeaders; 00069 00070 public: 00073 MNRTPDecoderMP4A( RetransRecvBase* retrans, int payload_type, const SDP::PayloadTypeTable* payload_types); 00074 ~MNRTPDecoderMP4A(); 00075 00078 virtual SH::DataPtr decode_data( MNRTPPacketPtr packet, MNRope*& indata ); 00079 00082 virtual SH::DataPtr decode_data( MNRTPPacketPtr packet, MNRope*& indata, u_int64_t offset ); 00083 00084 // virtual bool curPacketCompletesFrame(); 00085 00086 bool processSpecialHeader(MNRope* indata, unsigned& resultSpecialHeaderSize); 00087 }; 00088 00091 class BitVector { 00092 public: 00093 BitVector(unsigned char* baseBytePtr, 00094 unsigned baseBitOffset, 00095 unsigned totNumBits); 00096 00097 void setup(unsigned char* baseBytePtr, 00098 unsigned baseBitOffset, 00099 unsigned totNumBits); 00100 00101 void putBits(unsigned from, unsigned numBits); // "numBits" <= 32 00102 void put1Bit(unsigned bit); 00103 00104 unsigned getBits(unsigned numBits); // "numBits" <= 32 00105 unsigned get1Bit(); 00106 00107 void skipBits(unsigned numBits); 00108 00109 unsigned curBitIndex() const { return fCurBitIndex; } 00110 unsigned totNumBits() const { return fTotNumBits; } 00111 00112 private: 00113 unsigned char* fBaseBytePtr; 00114 unsigned fBaseBitOffset; 00115 unsigned fTotNumBits; 00116 unsigned fCurBitIndex; 00117 }; 00118 00119 // A general bit copy operation: 00120 void shiftBits(unsigned char* toBasePtr, unsigned toBitOffset, 00121 unsigned char const* fromBasePtr, unsigned fromBitOffset, 00122 unsigned numBits); 00123 00124 00125 #endif

Generated on Sun Mar 6 13:35:49 2005 for Komssys by doxygen 1.3.8