diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java b/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java index 6a2a85c29..1241568b5 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java @@ -391,6 +391,10 @@ public static void createDesktopSharing( public static void enableDesktopSharing(Call call, boolean enable) { enableDesktopSharing(call, null, enable); + + // in case we switch to video, disable remote control if it was + // enabled + enableDesktopRemoteControl(call.getCallPeers().next(), false); } /** diff --git a/src/net/java/sip/communicator/impl/gui/main/call/OneToOneCallPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/OneToOneCallPanel.java index ea2597cfd..e32771430 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/OneToOneCallPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/OneToOneCallPanel.java @@ -428,7 +428,10 @@ public void itemStateChanged(ItemEvent e) public void removeDesktopSharingComponents() { if (southPanel != null) + { remove(southPanel); + enableDesktopRemoteControl.setSelected(false); + } revalidate(); repaint(); diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetDesktopSharingServerJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetDesktopSharingServerJabberImpl.java index fa458b00a..9b2e233d7 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetDesktopSharingServerJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetDesktopSharingServerJabberImpl.java @@ -7,7 +7,6 @@ package net.java.sip.communicator.impl.protocol.jabber; import java.util.*; -import java.util.List; // disambiguation import java.text.*; import java.awt.event.*; @@ -246,6 +245,50 @@ protected Call createOutgoingVideoCall(String calleeAddress) return call; } + /** + * Implements OperationSetVideoTelephony#setLocalVideoAllowed(Call, + * boolean). Modifies the local media setup to reflect the requested setting + * for the streaming of the local video and then re-invites all + * CallPeers to re-negotiate the modified media setup. + * + * @param call the call where we'd like to allow sending local video. + * @param allowed true if local video transmission is allowed and + * false otherwise. + * + * @throws OperationFailedException if video initialization fails. + */ + @Override + public void setLocalVideoAllowed(Call call, boolean allowed) + throws OperationFailedException + { + ((CallJabberImpl)call).setLocalInputEvtAware(allowed); + super.setLocalVideoAllowed(call, allowed); + } + + /** + * Sets the indicator which determines whether the streaming of local video + * in a specific Call is allowed. The setting does not reflect + * the availability of actual video capture devices, it just expresses the + * desire of the user to have the local video streamed in the case the + * system is actually able to do so. + * + * @param call the Call to allow/disallow the streaming of local + * video for + * @param mediaDevice the media device to use for the desktop streaming + * @param allowed true to allow the streaming of local video for + * the specified Call; false to disallow it + * + * @throws OperationFailedException if initializing local video fails. + */ + public void setLocalVideoAllowed(Call call, + MediaDevice mediaDevice, + boolean allowed) + throws OperationFailedException + { + ((CallJabberImpl)call).setLocalInputEvtAware(allowed); + super.setLocalVideoAllowed(call, allowed); + } + /** * Enable desktop remote control. Local desktop can now regenerates keyboard * and mouse events received from peer. @@ -257,7 +300,9 @@ public void enableRemoteControl(CallPeer callPeer) if(logger.isInfoEnabled()) logger.info("Enable remote control"); + System.out.println("remote control enabled"); CallJabberImpl call = (CallJabberImpl)callPeer.getCall(); + if(call.getLocalInputEvtAware()) { remoteControlEnabled = true; @@ -277,6 +322,7 @@ public void enableRemoteControl(CallPeer callPeer) */ public void disableRemoteControl(CallPeer callPeer) { + System.out.println("remote control disabled"); if(logger.isInfoEnabled()) logger.info("Disable remote control"); diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java index dcf12daa1..62ea89f7e 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java @@ -1173,21 +1173,19 @@ protected void initialize(String screenname, OperationSetVideoTelephony.class, new OperationSetVideoTelephonyJabberImpl(basicTelephony)); -// TODO: Uncomment the following lines when the desktop sharing feature is ready -// to use. // initialize desktop streaming OperationSet -// addSupportedOperationSet( -// OperationSetDesktopStreaming.class, -// new OperationSetDesktopStreamingJabberImpl(basicTelephony)); + addSupportedOperationSet( + OperationSetDesktopStreaming.class, + new OperationSetDesktopStreamingJabberImpl(basicTelephony)); // initialize desktop sharing OperationSets -// addSupportedOperationSet( -// OperationSetDesktopSharingServer.class, -// new OperationSetDesktopSharingServerJabberImpl( -// basicTelephony)); -// addSupportedOperationSet( -// OperationSetDesktopSharingClient.class, -// new OperationSetDesktopSharingClientJabberImpl(this)); + addSupportedOperationSet( + OperationSetDesktopSharingServer.class, + new OperationSetDesktopSharingServerJabberImpl( + basicTelephony)); + addSupportedOperationSet( + OperationSetDesktopSharingClient.class, + new OperationSetDesktopSharingClientJabberImpl(this)); addSupportedOperationSet( OperationSetTelephonyConferencing.class, diff --git a/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java index f5c68fde5..c7e0f0b4c 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java @@ -103,7 +103,7 @@ public class ProtocolProviderServiceSipImpl /** * Property used in default settings if we want to override the system - * property for java.net.preferIPv6Addresses, with values true or false. + * property for java.net.preferIPv6Addresses, with values true or false. */ private static final String PREFER_IPV6_ADDRESSES = "net.java.sip.communicator.impl.protocol.sip.PREFER_IPV6_ADDRESSES"; @@ -417,8 +417,9 @@ public void register(SecurityAuthority authority) // then remove us as SipListener this.addRegistrationStateChangeListener(this); - // Enable the user name modification. Setting this property to true we'll - // allow the user to change the user name stored in the given authority. + // Enable the user name modification. Setting this property to true + // we'll allow the user to change the user name stored in the given + //authority. authority.setUserNameEditable(true); //init the security manager before doing the actual registration to @@ -640,24 +641,22 @@ protected void initialize(String sipAddress, new OperationSetVideoTelephonySipImpl( opSetBasicTelephonySipImpl)); -// TODO: Uncomment the next lines when the desktop sharing feature is ready to -// use. // OperationSetDesktopStreaming -// addSupportedOperationSet( -// OperationSetDesktopStreaming.class, -// new OperationSetDesktopStreamingSipImpl( -// opSetBasicTelephonySipImpl)); + addSupportedOperationSet( + OperationSetDesktopStreaming.class, + new OperationSetDesktopStreamingSipImpl( + opSetBasicTelephonySipImpl)); // OperationSetDesktopSharingServer -// addSupportedOperationSet( -// OperationSetDesktopSharingServer.class, -// new OperationSetDesktopSharingServerSipImpl( -// opSetBasicTelephonySipImpl)); + addSupportedOperationSet( + OperationSetDesktopSharingServer.class, + new OperationSetDesktopSharingServerSipImpl( + opSetBasicTelephonySipImpl)); // OperationSetDesktopSharingClient -// addSupportedOperationSet( -// OperationSetDesktopSharingClient.class, -// new OperationSetDesktopSharingClientSipImpl(this)); + addSupportedOperationSet( + OperationSetDesktopSharingClient.class, + new OperationSetDesktopSharingClientSipImpl(this)); // init DTMF (from JM Heitz) addSupportedOperationSet( @@ -1612,7 +1611,7 @@ private void initRegistrarConnection(SipAccountID accountID) try { - // if port is set we must use the explicitly set settings and + // if port is set we must use the explicitly set settings and // skip SRV queries if(accountID.getAccountProperty( ProtocolProviderFactory.SERVER_PORT) != null) @@ -1989,7 +1988,7 @@ void initOutboundProxy(SipAccountID accountID, int ix) proxyTransportsList, true); - proxyTransport = proxyTransportsList.get(ix); + proxyTransport = proxyTransportsList.get(ix); proxySocketAddress = proxySocketAddressesList.get(ix); } else @@ -2024,7 +2023,7 @@ void initOutboundProxy(SipAccountID accountID, int ix) proxyTransportsList, false); - proxyTransport = proxyTransportsList.get(ix); + proxyTransport = proxyTransportsList.get(ix); proxySocketAddress = proxySocketAddressesList.get(ix); } } @@ -2720,7 +2719,7 @@ public void resolveSipAddress( } } - //try to obtain SRV mappings from the DNS + //try to obtain SRV mappings from the DNS try { resolveSRV( @@ -3104,7 +3103,7 @@ private boolean checkPreferIPv6Addresses() return Boolean.parseBoolean(defaultSetting); // if there is no default setting return the system wide value. - return Boolean.getBoolean("java.net.preferIPv6Addresses"); + return Boolean.getBoolean("java.net.preferIPv6Addresses"); } } diff --git a/src/net/java/sip/communicator/service/protocol/event/RemoteControlListener.java b/src/net/java/sip/communicator/service/protocol/event/RemoteControlListener.java index 499ac6b95..f5e3fe54d 100644 --- a/src/net/java/sip/communicator/service/protocol/event/RemoteControlListener.java +++ b/src/net/java/sip/communicator/service/protocol/event/RemoteControlListener.java @@ -7,7 +7,7 @@ package net.java.sip.communicator.service.protocol.event; /** - * An event listener that should be implemented by parties interrested in + * An event listener that should be implemented by parties interested in * remote control feature (i.e desktop sharing). * * @author Sebastien Vincent