rtp/rtpstack/src/rtppacket.cpp
changeset 33 b8a7e07b2677
parent 30 d7640adb246b
equal deleted inserted replaced
30:d7640adb246b 33:b8a7e07b2677
   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 = CRSRC Count   *
   126      *    1 bit = extension     *
   127      *    4 bit = extension     *
   127      *    4 bit = CRSRC Count   *
   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 = 0 (1 bit)
   146     // CC 4 bit)
       
   147     if( aInitParam->TRTP.numCSRC)
       
   148         {
       
   149         dataP[0] |= aInitParam->TRTP.numCSRC;
       
   150         }
   147     
   151     
   148     /****************************
   152     /****************************
   149      * dataP[1] = 8 bit         *
   153      * dataP[1] = 8 bit         *
   150      *                          *
   154      *                          *
   151      *    1 bit = marker        *
   155      *    1 bit = marker        *
   152      *    1 bit = payload type  *
   156      *    7 bits = payload type  *
   153      ****************************/
   157      ****************************/
   154     
   158     
   155     // marker (1 bit)
   159     // marker (1 bit)
   156     dataP[1] |= static_cast<TUint8>( aInitParam->TRTP.marker << 7 );
   160     dataP[1] |= static_cast<TUint8>( aInitParam->TRTP.marker << 7 );
   157 
   161 
   180     // SSRC (32 bit)
   184     // SSRC (32 bit)
   181     Write32( dataP, aStreamParam->TRTP.SSRC );
   185     Write32( dataP, aStreamParam->TRTP.SSRC );
   182 
   186 
   183     //set the pointer to point to the first bit after SSRC
   187     //set the pointer to point to the first bit after SSRC
   184     dataP += 4;
   188     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     
   185 
   198 
   186     if ( aInitParam->TRTP.fHeaderExtension )
   199     if ( aInitParam->TRTP.fHeaderExtension )
   187         {
   200         {
   188 	    
   201 	    
   189 	    //calculate 8 bit values to 32 bit words
   202 	    //calculate 8 bit values to 32 bit words
   673             }
   686             }
   674 
   687 
   675         // Originally Allocate memory for all CSRC:s
   688         // Originally Allocate memory for all CSRC:s
   676         //it will have memeory resouce problem so only allocate when
   689         //it will have memeory resouce problem so only allocate when
   677         // CSRC<2
   690         // CSRC<2
   678         if ( aExtractParam->TRTP.numCSRC < KCSRCListMax )
   691         if ( aExtractParam->TRTP.numCSRC <= KCSRCListMax )
   679         	{
   692         	{
   680         	if ( !aExtractParam->TRTP.CSRCarray )
   693         	if ( !aExtractParam->TRTP.CSRCarray )
   681 	        	{
   694 	        	{
   682 	             TRAP( err,
   695 	             TRAP( err,
   683 	                   aExtractParam->TRTP.CSRCarray =
   696 	                   aExtractParam->TRTP.CSRCarray =