914 { |
914 { |
915 // found remote IP4 RTCP address |
915 // found remote IP4 RTCP address |
916 const TUint8 KAddrOffsetFromNetType = 4; |
916 const TUint8 KAddrOffsetFromNetType = 4; |
917 TInt addr_offset = |
917 TInt addr_offset = |
918 value.Match( KMatchIp ) + KAddrOffsetFromNetType; |
918 value.Match( KMatchIp ) + KAddrOffsetFromNetType; |
919 TPtrC8 remoteRtcpAddr = value.Mid( addr_offset ); |
919 TPtrC8 remoteRtcpAddrTxt = value.Mid( addr_offset ); |
920 |
920 |
921 const TUint8 KPortOffsetFromIP = 1; |
921 const TUint8 KPortOffsetFromIP = 1; |
922 TInt port_offset = |
922 TInt port_offset = |
923 value.Match( KMatchIN ) - KPortOffsetFromIP; |
923 value.Match( KMatchIN ) - KPortOffsetFromIP; |
924 TPtrC8 remoteRtcpPort = value.Left( port_offset ); |
924 HBufC8* dataRemoteRtcpPort = value.Left( port_offset ).AllocLC(); |
925 |
925 TPtr8 remoteRtcpPort( dataRemoteRtcpPort->Des() ); |
|
926 remoteRtcpPort.TrimAll(); |
926 TLex8 lexPT( remoteRtcpPort ); |
927 TLex8 lexPT( remoteRtcpPort ); |
927 User::LeaveIfError( lexPT.Val( rtcpPort, EDecimal ) ); |
928 User::LeaveIfError( lexPT.Val( rtcpPort, EDecimal ) ); |
928 // copy the address into correct format |
929 // copy the address into correct format |
929 TBuf16 <KMaxAddressLength> input; |
930 TBuf16 <KMaxAddressLength> input; |
930 input.Copy( remoteRtcpAddr ); |
931 input.Copy( remoteRtcpAddrTxt ); |
931 |
932 input.TrimAll(); |
932 MCEMM_DEBUG_SVALUE( "Found RTCP address", input ) |
933 MCEMM_DEBUG_SVALUE( "Found RTCP address", input ) |
933 |
934 |
934 aStream.SetRemoteRtcpMediaAddrL( input ); |
935 TInetAddr remoteRtcpAddr; |
|
936 User::LeaveIfError( remoteRtcpAddr.Input( input ) ); |
|
937 TInetAddr localIpAddr( aStream.Session()->iLocalIpAddress ); |
|
938 TBool validRemoteRtcpAddr( |
|
939 remoteRtcpAddr.IsLoopback() || !localIpAddr.Match( remoteRtcpAddr ) ); |
|
940 MCEMM_DEBUG_DVALUE( "Remote RTCP addr valid:", validRemoteRtcpAddr ) |
|
941 if ( validRemoteRtcpAddr ) |
|
942 { |
|
943 aStream.SetRemoteRtcpMediaAddrL( input ); |
|
944 } |
|
945 CleanupStack::PopAndDestroy( dataRemoteRtcpPort ); |
935 } |
946 } |
936 else |
947 else |
937 { |
948 { |
938 // only port present |
949 // only port present |
939 TLex8 lexPT( value ); |
950 HBufC8* dataRemoteRtcpPort = value.AllocLC(); |
|
951 TPtr8 remoteRtcpPort( dataRemoteRtcpPort->Des() ); |
|
952 remoteRtcpPort.TrimAll(); |
|
953 TLex8 lexPT( remoteRtcpPort ); |
940 User::LeaveIfError ( lexPT.Val( rtcpPort, EDecimal ) ); |
954 User::LeaveIfError ( lexPT.Val( rtcpPort, EDecimal ) ); |
|
955 CleanupStack::PopAndDestroy( dataRemoteRtcpPort ); |
941 } |
956 } |
942 |
957 |
943 aStream.SetRemoteRtcpMediaPort( rtcpPort ); |
958 aStream.SetRemoteRtcpMediaPort( rtcpPort ); |
944 |
959 |
945 MCEMM_DEBUG_DVALUE( "RTCP Port", rtcpPort ) |
960 MCEMM_DEBUG_DVALUE( "RTCP Port", rtcpPort ) |