multimediacommscontroller/mmccavcpayloadformat/inc/avcrtpstruct.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    Class to hold depayloadized RTP packet information
       
    15 **				 i.e. depayloadized NAL units with appropriate information
       
    16 ** 			 like timestamp, marker bit etc
       
    17 **
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef AVCRTPSTRUCT_H
       
    24 #define AVCRTPSTRUCT_H
       
    25 
       
    26 #include <e32std.h>
       
    27 
       
    28 // constants, taken from rfc3984base.h, these are possible values of PT field in the TRTPInfo struct
       
    29 // NAL packet types
       
    30 #define	PACKET_NAL_SLICE	1
       
    31 #define	PACKET_NAL_PARTA	2
       
    32 #define	PACKET_NAL_PARTB	3
       
    33 #define	PACKET_NAL_PARTC	4
       
    34 #define	PACKET_NAL_IDR  	5
       
    35 #define PACKET_NAL_SEI  	6
       
    36 #define PACKET_NAL_SPS  	7
       
    37 #define PACKET_NAL_PPS  	8
       
    38 #define PACKET_NAL_AUD  	9
       
    39 #define PACKET_NAL_EOS  	10
       
    40 #define PACKET_NAL_EOSTR	11
       
    41 #define PACKET_NAL_FD   	12
       
    42 #define PACKET_NAL_UNIT 	23
       
    43 #define PACKET_STAP_A   	24
       
    44 #define PACKET_STAP_B   	25
       
    45 #define PACKET_MTAP16   	26
       
    46 #define PACKET_MTAP24   	27
       
    47 #define PACKET_FU_A     	28
       
    48 #define PACKET_FU_B     	29
       
    49 
       
    50 // AVC information
       
    51 struct TRTPInfo {
       
    52 	TInt64 TS;	// this is in microseconds like TTimeIntervalMicroSeconds
       
    53 	TUint16 SN;
       
    54 	TUint16 DON;
       
    55 	TUint16 NRI;
       
    56 	TUint8	PT;		// packet type for H.264
       
    57 	TUint8	FUH;	// FU-Header Byte (contains, start, end and reserve bit)
       
    58 };
       
    59 
       
    60 
       
    61 // -----------------------------------------------------------------------------
       
    62 // SeqDiff -- compares two N but sequence numbers.  Returns the distance of 
       
    63 // the second arguement relative to the first.  E.g. SeqDiff<16>(10, 12) == 2 and
       
    64 // SeqDiff<16>(12, 10) == -2
       
    65 //
       
    66 // N must be <= 32
       
    67 // -----------------------------------------------------------------------------
       
    68 //
       
    69 template < unsigned N >
       
    70 TInt SeqDiff( TUint aSeqNum1, TUint aSeqNum2 )
       
    71 {
       
    72 	struct { TInt s:N; } diff;
       
    73 	diff.s = aSeqNum2 - aSeqNum1;
       
    74 	return diff.s;	// force sign extension of a B bit integer to a 32 bit integer
       
    75 }
       
    76 
       
    77 
       
    78 #endif 	// AVCRTPSTRUCT_H
       
    79