00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
00056
int _call_i;
00057
00058
00059
const SDP::PayloadTypeTable* _payload_types;
00060
00061
int fSizeLength;
00062
int fIndexLength;
00063
int fIndexDeltaLength;
00064
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
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);
00102
void put1Bit(
unsigned bit);
00103
00104
unsigned getBits(
unsigned numBits);
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
00120
void shiftBits(
unsigned char* toBasePtr,
unsigned toBitOffset,
00121
unsigned char const* fromBasePtr,
unsigned fromBitOffset,
00122
unsigned numBits);
00123
00124
00125
#endif