[jitsi-dev] Re: [jitsi~svn:8786] Adds support for RTP over TCP and Google Talk's TCP/TURN-TCP/TURN-SSLTCP


Hi Werner,

(Redirected to dev mailing-list).

Hi Seb,

maybe I'm wrong here but one modification inside MediaStreamImpl looks suspicious
to me:

below line 1123 I see the following new code:

         if(rtpConnector instanceof RTPTransformUDPConnector)
         else if(rtpConnector instanceof RTPTransformUDPConnector)

The "else if" checks the same condition as the if and also performs the same
action? Or do I miss something here?

A few lines below 1244 I see the following code:

             if(newValue instanceof RTPTransformUDPConnector)
             else if(newValue instanceof RTPTransformTCPConnector)

which, at least to me, makes more sense :-).

Good catch, yes it should be "instanceof RTPTransformTCPConnector".

However, both connector classes seem to implement the setEngine() method, why
perform an "instanceof" before calling setEngine() ?

Because RTPTransformUDPConnector and RTPTransformTCPConnector does not inherit from a "RTPTransformConnector" classes.

In fact, you have AbstractRTPConnector is inherited by RTPConnectorTCPImpl and RTPConnectorUDPImpl.
RTPConnectorTCPImpl is inherited by RTPTransformTCPConnector and RTPConnectorUDPImpl is inherited by RTPTransformUDPConnector.

So the only same parent of RTPTransform[TCP|UDP]Connector is AbstractRTPConnector which does not have setEngine. Of course we can add an interface with "setEngine" method.



Le 20/07/11 17:45, Werner Dittmann a écrit :