src/net/java/sip/communicator/impl/protocol/jabber/OperationSetDesktopSharingServerJabberImpl.java
/**
     * Check if the remote part supports Jingle video.
     *
     * @param calleeAddress Contact address
     * @param videoDevice specific video device to use (null to use default
     * device)
     * @return true if contact support Jingle video, false otherwise
     *
     * @throws OperationFailedException with the corresponding code if we fail
     * to create the video call.
     */
Check if the remote part supports Jingle video.
@param calleeAddress Contact address
@param videoDevice specific video device to use (null to use default
device)
@return true if contact support Jingle video, false otherwise

@throws OperationFailedException with the corresponding code if we fail
to create the video call.
Check if the remote part supports Jingle video . @param calleeAddress Contact address @param videoDevice specific video device to use ( null to use default device ) @return true if contact support Jingle video false otherwise @throws OperationFailedException with the corresponding code if we fail to create the video call .
@Override
    protected Call createOutgoingVideoCall(
            String calleeAddress,
            MediaDevice videoDevice)
        throws OperationFailedException
    {
        boolean remoteControlSupported = false;
        Jid calleeJid;
        try
        {
            calleeJid = JidCreate.from(calleeAddress);
        }
        catch (XmppStringprepException e)
        {
            throw new OperationFailedException(
                calleeAddress + "is not a valid JID",
                OperationFailedException.GENERAL_ERROR,
                e
            );
        }
        FullJid fullCalleeURI;
        if (calleeJid.hasResource())
        {
            fullCalleeURI = calleeJid.asFullJidOrThrow();
        }
        else
        {
            Roster r = Roster.getInstanceFor(parentProvider.getConnection());
            fullCalleeURI = r.getPresence(calleeJid.asBareJid())
                .getFrom()
                .asFullJidOrThrow();
        }
        if (logger.isInfoEnabled())
            logger.info("creating outgoing desktop sharing call...");
        DiscoverInfo di = null;
        try
        {
            di = parentProvider.getDiscoveryManager()
                    .discoverInfo(fullCalleeURI);
            if (di.containsFeature(InputEvtIQ.NAMESPACE_CLIENT))
            {
                if (logger.isInfoEnabled())
                    logger.info(fullCalleeURI + ": remote-control supported");
                remoteControlSupported = true;
            }
            else
            {
                if (logger.isInfoEnabled())
                {
                    logger.info(
                            fullCalleeURI + ": remote-control not supported!");
                }
                /*
                throw new OperationFailedException(
                        "Failed to create a true desktop sharing.\n"
                            + fullCalleeURI + " does not support inputevt",
                        OperationFailedException.INTERNAL_ERROR);
                */
            }
        }
        catch (XMPPException
            | InterruptedException
            | NotConnectedException
            | NoResponseException ex)
        {
            logger.warn("could not retrieve info for " + fullCalleeURI, ex);
        }
        if (parentProvider.getConnection() == null)
        {
            throw new OperationFailedException(
                    "Failed to create OutgoingJingleSession.\n"
                    + "we don't have a valid XMPPConnection."
                    , OperationFailedException.INTERNAL_ERROR);
        }
        CallJabberImpl call = new CallJabberImpl(basicTelephony);
        MediaUseCase useCase = getMediaUseCase();
        if (videoDevice != null)
        {
            call.setVideoDevice(videoDevice, useCase);
            call.setLocalVideoAllowed(true, useCase);
            call.setLocalInputEvtAware(remoteControlSupported);
            size = (((VideoMediaFormat)videoDevice.getFormat()).getSize());
        }
        basicTelephony.createOutgoingCall(call, calleeAddress);
        new CallPeerJabberImpl(calleeJid, call);
        return call;
    }
@ Override protected Call createOutgoingVideoCall ( String calleeAddress , MediaDevice videoDevice ) throws OperationFailedException { boolean remoteControlSupported = false ; Jid calleeJid ; try { calleeJid = JidCreate . from ( calleeAddress ) ; } catch ( XmppStringprepException e ) { throw new OperationFailedException ( calleeAddress + "is not a valid JID" , OperationFailedException . GENERAL_ERROR , e ) ; } FullJid fullCalleeURI ; if ( calleeJid . hasResource ( ) ) { fullCalleeURI = calleeJid . asFullJidOrThrow ( ) ; } else { Roster r = Roster . getInstanceFor ( parentProvider . getConnection ( ) ) ; fullCalleeURI = r . getPresence ( calleeJid . asBareJid ( ) ) . getFrom ( ) . asFullJidOrThrow ( ) ; } if ( logger . isInfoEnabled ( ) ) logger . info ( "creating outgoing desktop sharing call..." ) ; DiscoverInfo di = null ; try { di = parentProvider . getDiscoveryManager ( ) . discoverInfo ( fullCalleeURI ) ; if ( di . containsFeature ( InputEvtIQ . NAMESPACE_CLIENT ) ) { if ( logger . isInfoEnabled ( ) ) logger . info ( fullCalleeURI + ": remote-control supported" ) ; remoteControlSupported = true ; } else { if ( logger . isInfoEnabled ( ) ) { logger . info ( fullCalleeURI + ": remote-control not supported!" ) ; } /*
                throw new OperationFailedException(
                        "Failed to create a true desktop sharing.\n"
                            + fullCalleeURI + " does not support inputevt",
                        OperationFailedException.INTERNAL_ERROR);
                */ } } catch ( XMPPException | InterruptedException | NotConnectedException | NoResponseException ex ) { logger . warn ( "could not retrieve info for " + fullCalleeURI , ex ) ; } if ( parentProvider . getConnection ( ) == null ) { throw new OperationFailedException ( "Failed to create OutgoingJingleSession.\n" + "we don't have a valid XMPPConnection." , OperationFailedException . INTERNAL_ERROR ) ; } CallJabberImpl call = new CallJabberImpl ( basicTelephony ) ; MediaUseCase useCase = getMediaUseCase ( ) ; if ( videoDevice != null ) { call . setVideoDevice ( videoDevice , useCase ) ; call . setLocalVideoAllowed ( true , useCase ) ; call . setLocalInputEvtAware ( remoteControlSupported ) ; size = ( ( ( VideoMediaFormat ) videoDevice . getFormat ( ) ) . getSize ( ) ) ; } basicTelephony . createOutgoingCall ( call , calleeAddress ) ; new CallPeerJabberImpl ( calleeJid , call ) ; return call ; }
Check if the remote part supports Jingle video.
Check if the remote part supports Jingle video .
// check if the remote client supports inputevt (remote control) // TODO fail or not? // enable video // enable remote-control