Beispiel #1
0
// -------------------------------------
// Initialization functions
//
Bool16 QTAtom_hinf::Initialize(void)
{
    //
    // Parse this atom's sub-atoms.
    ReadSubAtomInt32(hinfAtom_TotalRTPBytes32, &fTotalRTPBytes32);
    ReadSubAtomInt32(hinfAtom_TotalRTPPackets32, &fTotalRTPPackets32);
    ReadSubAtomInt32(hinfAtom_TotalPayloadBytes32, &fTotalPayLoadBytes32);

    
    ReadSubAtomInt64(hinfAtom_TotalRTPBytes64, &fTotalRTPBytes64);
    ReadSubAtomInt64(hinfAtom_TotalRTPPackets64, &fTotalRTPPackets64);
    ReadSubAtomInt64(hinfAtom_TotalPayloadBytes64, &fTotalPayLoadBytes64);
    
    ReadSubAtomInt64(hinfAtom_MaxDataRate64, &fMaxDataRate64);
    ReadSubAtomInt64(hinfAtom_TotalMediaBytes64, &fTotalMediaBytes64);
    ReadSubAtomInt64(hinfAtom_TotalImmedBytes64, &fTotalImmediateBytes64);
    ReadSubAtomInt64(hinfAtom_TotalRepeatBytes64, &fTotalRepeatBytes64);
    
    
    ReadSubAtomInt32(hinfAtom_MinTransTime32, &fMinTransTime32);
    ReadSubAtomInt32(hinfAtom_MaxTransTime32, &fMaxTransTime32);
    ReadSubAtomInt32(hinfAtom_MaxPacketSize32, &fMaxPacketSizeBytes32);
    ReadSubAtomInt32(hinfAtom_MaxPacketDuration32, &fMaxPacketDuration32);
    
    ReadSubAtomInt32(hinfAtom_PayloadType, &fPayloadID);
    if (fPayloadID != 0)
    {   SInt8 len = 0;
        ReadSubAtomBytes(hinfAtom_PayloadType, (char*)fPayloadStr, 5);
        len = fPayloadStr[4];
        if (len > 0)
        {   ReadSubAtomBytes(hinfAtom_PayloadType, (char*)fPayloadStr, len+5);
            ::memmove(fPayloadStr,&fPayloadStr[5],len);
            fPayloadStr[len] = 0;
        }
    }
    //
    // This atom has been successfully read in.
    return true;
}
Beispiel #2
0
Bool16 QTAtom::ReadSubAtomInt64(const char * AtomPath, UInt64 * Datum)
{
    // General vars
    UInt64      tempDatum;


    //
    // Read and flip.
    if( !ReadSubAtomBytes(AtomPath, (char *)&tempDatum, 8) )
        return false;
    
    *Datum = (UInt64) QTAtom::NTOH64(tempDatum);
    return true;
}
Beispiel #3
0
Bool16 QTAtom::ReadSubAtomInt32(const char * AtomPath, UInt32 * Datum)
{
    // General vars
    UInt32      tempDatum;


    //
    // Read and flip.
    if( !ReadSubAtomBytes(AtomPath, (char *)&tempDatum, 4) )
        return false;
    
    *Datum = bswap_32(tempDatum);
    return true;
}
Beispiel #4
0
bool QTAtom::ReadSubAtomInt16(const char * AtomPath, UInt16 * Datum)
{
	// General vars
	UInt16      tempDatum;


	//
	// Read and flip.
	if (!ReadSubAtomBytes(AtomPath, (char *)&tempDatum, 2))
		return false;

	*Datum = ntohs(tempDatum);
	return true;
}
Beispiel #5
0
Bool16 QTAtom::ReadSubAtomInt8(const char * AtomPath, UInt8 * Datum)
{
    //
    // Read and return.
    return ReadSubAtomBytes(AtomPath, (char *)Datum, 1);
}