rtp/rtpstack/src/rtppacket.cpp
branchRCL_3
changeset 44 0dcb073356a5
parent 43 b5e99d8877c7
child 33 b8a7e07b2677
equal deleted inserted replaced
43:b5e99d8877c7 44:0dcb073356a5
   121     /****************************
   121     /****************************
   122      * dataP[0] = 8 bit         *
   122      * dataP[0] = 8 bit         *
   123      *                          *
   123      *                          *
   124      *    2 bit = version       *
   124      *    2 bit = version       *
   125      *    1 bit = padding       *
   125      *    1 bit = padding       *
   126      *    1 bit = extension     *
   126      *    1 bit = CRSRC Count   *
   127      *    4 bit = CRSRC Count   *
   127      *    4 bit = extension     *
   128      ****************************/
   128      ****************************/
   129     
   129     
   130     //version (2 bit)
   130     //version (2 bit)
   131     // 0111001
   131     // 0111001
   132     // 1100000
   132     // 1100000
   141     if ( aInitParam->TRTP.fHeaderExtension)
   141     if ( aInitParam->TRTP.fHeaderExtension)
   142         {
   142         {
   143         dataP[0] |= ( 1 << 4 );
   143         dataP[0] |= ( 1 << 4 );
   144         }
   144         }
   145 
   145 
   146     // CC 4 bit)
   146     // CC = 0 (1 bit)
   147     if( aInitParam->TRTP.numCSRC)
       
   148         {
       
   149         dataP[0] |= aInitParam->TRTP.numCSRC;
       
   150         }
       
   151     
   147     
   152     /****************************
   148     /****************************
   153      * dataP[1] = 8 bit         *
   149      * dataP[1] = 8 bit         *
   154      *                          *
   150      *                          *
   155      *    1 bit = marker        *
   151      *    1 bit = marker        *
   156      *    7 bits = payload type  *
   152      *    1 bit = payload type  *
   157      ****************************/
   153      ****************************/
   158     
   154     
   159     // marker (1 bit)
   155     // marker (1 bit)
   160     dataP[1] |= static_cast<TUint8>( aInitParam->TRTP.marker << 7 );
   156     dataP[1] |= static_cast<TUint8>( aInitParam->TRTP.marker << 7 );
   161 
   157 
   184     // SSRC (32 bit)
   180     // SSRC (32 bit)
   185     Write32( dataP, aStreamParam->TRTP.SSRC );
   181     Write32( dataP, aStreamParam->TRTP.SSRC );
   186 
   182 
   187     //set the pointer to point to the first bit after SSRC
   183     //set the pointer to point to the first bit after SSRC
   188     dataP += 4;
   184     dataP += 4;
   189     
       
   190     
       
   191     //Set CSRC if Present
       
   192     for(TInt count = 0; count<aInitParam->TRTP.numCSRC; count++)
       
   193         {
       
   194         Write32( dataP, (*aInitParam->TRTP.iCsrcList)[count]);
       
   195         dataP += 4;
       
   196         }
       
   197     
       
   198 
   185 
   199     if ( aInitParam->TRTP.fHeaderExtension )
   186     if ( aInitParam->TRTP.fHeaderExtension )
   200         {
   187         {
   201 	    
   188 	    
   202 	    //calculate 8 bit values to 32 bit words
   189 	    //calculate 8 bit values to 32 bit words
   686             }
   673             }
   687 
   674 
   688         // Originally Allocate memory for all CSRC:s
   675         // Originally Allocate memory for all CSRC:s
   689         //it will have memeory resouce problem so only allocate when
   676         //it will have memeory resouce problem so only allocate when
   690         // CSRC<2
   677         // CSRC<2
   691         if ( aExtractParam->TRTP.numCSRC <= KCSRCListMax )
   678         if ( aExtractParam->TRTP.numCSRC < KCSRCListMax )
   692         	{
   679         	{
   693         	if ( !aExtractParam->TRTP.CSRCarray )
   680         	if ( !aExtractParam->TRTP.CSRCarray )
   694 	        	{
   681 	        	{
   695 	             TRAP( err,
   682 	             TRAP( err,
   696 	                   aExtractParam->TRTP.CSRCarray =
   683 	                   aExtractParam->TRTP.CSRCarray =