Enable desktop streaming/sharing for SIP and XMPP protocol. Note that desktop sharing with remote control works only between two SIP Communicator clients for the moment.

cusax-fix
Sebastien Vincent 15 years ago
parent d160aba9c6
commit 2fc00f48b3

@ -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);
}
/**

@ -428,7 +428,10 @@ public void itemStateChanged(ItemEvent e)
public void removeDesktopSharingComponents()
{
if (southPanel != null)
{
remove(southPanel);
enableDesktopRemoteControl.setSelected(false);
}
revalidate();
repaint();

@ -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 <tt>true</tt> if local video transmission is allowed and
* <tt>false</tt> 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 <tt>Call</tt> 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 <tt>Call</tt> to allow/disallow the streaming of local
* video for
* @param mediaDevice the media device to use for the desktop streaming
* @param allowed <tt>true</tt> to allow the streaming of local video for
* the specified <tt>Call</tt>; <tt>false</tt> 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");

@ -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,

@ -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");
}
}

@ -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

Loading…
Cancel
Save