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


#1

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)
             ((RTPTransformUDPConnector)rtpConnector)
                 .setEngine(createTransformEngineChain());
         else if(rtpConnector instanceof RTPTransformUDPConnector)
             ((RTPTransformUDPConnector)rtpConnector)
                 .setEngine(createTransformEngineChain());

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)
                 ((RTPTransformUDPConnector)newValue)
                     .setEngine(createTransformEngineChain());
             else if(newValue instanceof RTPTransformTCPConnector)
                 ((RTPTransformTCPConnector)newValue)
                     .setEngine(createTransformEngineChain());

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.

Regards,

···

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