ipappprotocols_plat/rtprtcp_api/inc/rtpheader.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2004-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:    Standard fixed headers of RTP packets to send and receive.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __RTPHEADER_H
       
    22 #define __RTPHEADER_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <rtpdef.h>
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 // MACROS
       
    30 
       
    31 // DATA TYPES
       
    32 
       
    33 // FUNCTION PROTOTYPES
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 class  TRtpHeaderExtension
       
    40     {
       
    41     public:
       
    42         TRtpHeaderExtension();
       
    43         TInt iType;      // Defined by profile
       
    44         TInt iLength;    // Length of extension data
       
    45         TUint8* iData;   // Extended header data
       
    46     } ;
       
    47 inline TRtpHeaderExtension::TRtpHeaderExtension() 
       
    48     : iType( 0 ),
       
    49       iLength( 0 ),
       
    50       iData( 0 )
       
    51     {
       
    52     };
       
    53 
       
    54 /**
       
    55 *  Standard fixed header of RTP packet to send.
       
    56 *
       
    57 *  @lib RtpService.dll
       
    58 */
       
    59 class TRtpSendHeader
       
    60     {
       
    61     public: // Header fields
       
    62         TRtpSendHeader();
       
    63 
       
    64         TUint8 iPadding;                 // Padding (P) (1 bit)
       
    65         TUint8 iMarker;                  // Marker (M) (1 bit)
       
    66         TRtpPayloadType iPayloadType;    // Payload type (PT) (7 bits)
       
    67         TRtpTimeStamp iTimestamp;        // Timestamp (32 bits)
       
    68         TRtpHeaderExtension* iHeaderExtension;  // Pointer to header extension struct
       
    69     };
       
    70 
       
    71 inline TRtpSendHeader::TRtpSendHeader() : iPadding( 0 ),
       
    72                                           iMarker( 0 ),
       
    73                                           iPayloadType( 0 ),
       
    74                                           iTimestamp( 0 ),
       
    75                                           iHeaderExtension( NULL )
       
    76     {
       
    77     };
       
    78 
       
    79 /**
       
    80 *  Standard fixed header of received RTP packet.
       
    81 *
       
    82 *  @lib RtpService.dll
       
    83 */
       
    84 class TRtpRecvHeader
       
    85     {
       
    86     public: // Header fields
       
    87         TRtpRecvHeader();
       
    88 
       
    89         TUint8 iPadding;                 // Padding (P) (1 bit)
       
    90         TUint8 iExtension;               // Extension (X) (1 bit)
       
    91         TUint8 iCsrcCount;               // CSRC count (CC) (4 bits)
       
    92         TUint8 iMarker;                  // Marker (M) (1 bit)
       
    93         TRtpPayloadType iPayloadType;    // Payload type (PT) (7 bits)
       
    94         TRtpSequence iSeqNum;            // Sequence number (16 bits)
       
    95         TRtpTimeStamp iTimestamp;        // Timestamp (32 bits)
       
    96         TRtpHeaderExtension* iHeaderExtension; // Pointer to header extension struct
       
    97         TUint32* iCsrcList;      // Pointer to CSRC list
       
    98     };
       
    99 
       
   100 inline TRtpRecvHeader::TRtpRecvHeader() : iPadding( 0 ), 
       
   101                                           iExtension( 0 ), 
       
   102                                           iCsrcCount( 0 ),
       
   103                                           iMarker( 0 ),
       
   104                                           iPayloadType( 0 ),
       
   105                                           iSeqNum( 0 ),
       
   106                                           iTimestamp( 0 ),
       
   107                                           iHeaderExtension( NULL ),
       
   108                                           iCsrcList( NULL )
       
   109     {
       
   110     };
       
   111 
       
   112 #endif      // __RTPHEADER_H
       
   113 
       
   114 // End of File