natfw/natfwconnectionmultiplexer/src/cncmconnectionobserverhandler.cpp
changeset 23 a297cbce4e85
parent 0 1bce908db942
equal deleted inserted replaced
22:b6d70b04aa2d 23:a297cbce4e85
   258         // field, which has always value of 2. Thus value of first byte of 
   258         // field, which has always value of 2. Thus value of first byte of 
   259         // RTP/RTCP message is at least 128.
   259         // RTP/RTCP message is at least 128.
   260         const TInt KRtpRtcpDiffByteOffset( 1 );
   260         const TInt KRtpRtcpDiffByteOffset( 1 );
   261         const TInt KLowestAssignedRtcpMsgType = 200;
   261         const TInt KLowestAssignedRtcpMsgType = 200;
   262         const TInt KHighestAssignedRtcpMsgType = 209;
   262         const TInt KHighestAssignedRtcpMsgType = 209;
       
   263         TInt rtcpType = aMessage[KRtpRtcpDiffByteOffset];
   263         TBool isRtcp = 
   264         TBool isRtcp = 
   264            ( KLowestAssignedRtcpMsgType <= aMessage[KRtpRtcpDiffByteOffset] &&
   265            ( KLowestAssignedRtcpMsgType <= rtcpType &&
   265             aMessage[KRtpRtcpDiffByteOffset] <= KHighestAssignedRtcpMsgType );
   266         		   rtcpType <= KHighestAssignedRtcpMsgType );
   266         
   267         
   267         // This offset refers either to SR RTP timestamp or RR highest 
   268         // This offset refers to RR highest sequence number received.
   268         // sequence number received. These are unique for a distinct 
   269         const TInt KRRtcpDiffByteOffset( 19 );
   269         // RTCP packet.
   270         
   270         const TInt KRtcpDiffByteOffset( 19 );
   271         // This offset refers either to SR RTP packet count received.
       
   272         const TInt KSRtcpDiffByteOffset( 23 );
   271         
   273         
   272         // This offset refers to lower byte of unique RTP sequence number.
   274         // This offset refers to lower byte of unique RTP sequence number.
   273         const TInt KRtpDiffByteOffset( 3 );
   275         const TInt KRtpDiffByteOffset( 3 );
   274         TInt diffByteOffset 
   276         TInt diffByteOffset 
   275             = isRtcp ? KRtcpDiffByteOffset : KRtpDiffByteOffset;
   277             = isRtcp ? KRRtcpDiffByteOffset : KRtpDiffByteOffset;
   276 
   278 
       
   279         diffByteOffset = (rtcpType == KLowestAssignedRtcpMsgType)?
       
   280         		KSRtcpDiffByteOffset : diffByteOffset;
       
   281         
   277         if ( diffByteOffset < aMessage.Size() )
   282         if ( diffByteOffset < aMessage.Size() )
   278             {
   283             {
   279             hash = aMessage[diffByteOffset];
   284             hash = aMessage[diffByteOffset];
   280             }
   285             }
   281         else
   286         else
   292                 "CNcmConnectionObserverHandler::IsDuplicatePacket TRUE" )
   297                 "CNcmConnectionObserverHandler::IsDuplicatePacket TRUE" )
   293             isDuplicate = ETrue;
   298             isDuplicate = ETrue;
   294             }
   299             }
   295         else
   300         else
   296             {
   301             {
   297             isDuplicate = EFalse;
   302             iLatestHashes.Append( hash );
   298             }
   303             const TInt KMaxHashCount( 5 );
   299         
   304             if ( KMaxHashCount <= iLatestHashes.Count() )
   300         iLatestHashes.Append( hash );
   305                 {
   301         const TInt KMaxHashCount( 5 );
   306                 iLatestHashes.Remove( 0 );
   302         if ( KMaxHashCount <= iLatestHashes.Count() )
   307                 }
   303             {
       
   304             iLatestHashes.Remove( 0 );
       
   305             }
   308             }
   306         }
   309         }
   307     else
   310     else
   308         {
   311         {
   309         __CONNECTIONMULTIPLEXER( 
   312         __CONNECTIONMULTIPLEXER(