Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.sip
Class OperationSetDesktopStreamingSipImpl

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.media.AbstractOperationSetVideoTelephony<OperationSetBasicTelephonySipImpl,ProtocolProviderServiceSipImpl,CallSipImpl,CallPeerSipImpl>
      extended by net.java.sip.communicator.impl.protocol.sip.OperationSetVideoTelephonySipImpl
          extended by net.java.sip.communicator.impl.protocol.sip.OperationSetDesktopStreamingSipImpl
All Implemented Interfaces:
OperationSet, OperationSetDesktopStreaming, OperationSetVideoTelephony
Direct Known Subclasses:
OperationSetDesktopSharingServerSipImpl

public class OperationSetDesktopStreamingSipImpl
extends OperationSetVideoTelephonySipImpl
implements OperationSetDesktopStreaming

Implements all desktop streaming related functions for SIP.

Author:
Sebastien Vincent

Field Summary
protected  Point origin
          Origin (x, y) of the zone streamed.
protected  Dimension size
          Dimension of the local desktop streamed.
 
Fields inherited from class net.java.sip.communicator.service.protocol.media.AbstractOperationSetVideoTelephony
basicTelephony, parentProvider
 
Fields inherited from interface net.java.sip.communicator.service.protocol.OperationSetVideoTelephony
LOCAL_VIDEO_STREAMING
 
Constructor Summary
OperationSetDesktopStreamingSipImpl(OperationSetBasicTelephonySipImpl basicTelephony)
          Initializes a new OperationSetDesktopStreamingSipImpl instance which builds upon the telephony-related functionality of a specific OperationSetBasicTelephonySipImpl.
 
Method Summary
 Call createVideoCall(Contact callee)
          Create a new video call and invite the specified CallPeer to it.
 Call createVideoCall(Contact callee, MediaDevice mediaDevice)
          Create a new video call and invite the specified CallPeer to it.
 Call createVideoCall(String uri)
          Create a new video call and invite the specified CallPeer to it.
 Call createVideoCall(String uri, MediaDevice mediaDevice)
          Create a new video call and invite the specified CallPeer to it.
 MediaUseCase getMediaUseCase()
          Get the MediaUseCase of a desktop streaming operation set.
 Point getOrigin()
          Get origin of streamed zone.
protected static Point getOriginForMediaDevice(MediaDevice device)
          Get origin of the screen.
 boolean isLocalVideoAllowed(Call call)
          Implements OperationSetVideoTelephony#isLocalVideoAllowed(Call).
 boolean isPartialStreaming(Call call)
          If the streaming is partial (not the full desktop).
 void movePartialDesktopStreaming(Call call, int x, int y)
          Move origin of a partial desktop streaming.
 void setLocalVideoAllowed(Call call, boolean allowed)
          Implements OperationSetVideoTelephony#setLocalVideoAllowed(Call, boolean).
 void setLocalVideoAllowed(Call call, MediaDevice mediaDevice, boolean allowed)
          Sets the indicator which determines whether the streaming of local video in a specific Call is allowed.
 
Methods inherited from class net.java.sip.communicator.impl.protocol.sip.OperationSetVideoTelephonySipImpl
answerVideoCallPeer, createVideoCall, createVideoCall, getQualityControl
 
Methods inherited from class net.java.sip.communicator.service.protocol.media.AbstractOperationSetVideoTelephony
addPropertyChangeListener, addVideoListener, createLocalVisualComponent, disposeLocalVisualComponent, getVisualComponent, getVisualComponents, isLocalVideoStreaming, removePropertyChangeListener, removeVideoListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.java.sip.communicator.service.protocol.OperationSetVideoTelephony
addPropertyChangeListener, addVideoListener, answerVideoCallPeer, createLocalVisualComponent, createVideoCall, createVideoCall, disposeLocalVisualComponent, getQualityControl, getVisualComponent, getVisualComponents, isLocalVideoStreaming, removePropertyChangeListener, removeVideoListener
 

Field Detail

size

protected Dimension size
Dimension of the local desktop streamed.


origin

protected Point origin
Origin (x, y) of the zone streamed. This apply only in case of partial desktop streaming.

Constructor Detail

OperationSetDesktopStreamingSipImpl

public OperationSetDesktopStreamingSipImpl(OperationSetBasicTelephonySipImpl basicTelephony)
Initializes a new OperationSetDesktopStreamingSipImpl instance which builds upon the telephony-related functionality of a specific OperationSetBasicTelephonySipImpl.

Parameters:
basicTelephony - the OperationSetBasicTelephonySipImpl the new extension should build upon
Method Detail

getMediaUseCase

public MediaUseCase getMediaUseCase()
Get the MediaUseCase of a desktop streaming operation set.

Overrides:
getMediaUseCase in class AbstractOperationSetVideoTelephony<OperationSetBasicTelephonySipImpl,ProtocolProviderServiceSipImpl,CallSipImpl,CallPeerSipImpl>
Returns:
MediaUseCase.DESKTOP

createVideoCall

public Call createVideoCall(String uri,
                            MediaDevice mediaDevice)
                     throws OperationFailedException,
                            ParseException
Create a new video call and invite the specified CallPeer to it.

Specified by:
createVideoCall in interface OperationSetDesktopStreaming
Parameters:
uri - the address of the callee that we should invite to a new call.
mediaDevice - the media device to use for the desktop streaming
Returns:
CallPeer the CallPeer that will represented by the specified uri. All following state change events will be delivered through that call peer. The Call that this peer is a member of could be retrieved from the CallParticipatn instance with the use of the corresponding method.
Throws:
OperationFailedException - with the corresponding code if we fail to create the video call.
ParseException - if callee is not a valid sip address string.

createVideoCall

public Call createVideoCall(Contact callee,
                            MediaDevice mediaDevice)
                     throws OperationFailedException
Create a new video call and invite the specified CallPeer to it.

Specified by:
createVideoCall in interface OperationSetDesktopStreaming
Parameters:
callee - the address of the callee that we should invite to a new call.
mediaDevice - the media device to use for the desktop streaming
Returns:
CallPeer the CallPeer that will represented by the specified uri. All following state change events will be delivered through that call peer. The Call that this peer is a member of could be retrieved from the CallParticipant instance with the use of the corresponding method.
Throws:
OperationFailedException - with the corresponding code if we fail to create the video call.

createVideoCall

public Call createVideoCall(String uri)
                     throws OperationFailedException,
                            ParseException
Create a new video call and invite the specified CallPeer to it.

Specified by:
createVideoCall in interface OperationSetVideoTelephony
Overrides:
createVideoCall in class OperationSetVideoTelephonySipImpl
Parameters:
uri - the address of the callee that we should invite to a new call.
Returns:
CallPeer the CallPeer that will represented by the specified uri. All following state change events will be delivered through that call peer. The Call that this peer is a member of could be retrieved from the CallParticipatn instance with the use of the corresponding method.
Throws:
OperationFailedException - with the corresponding code if we fail to create the video call.
ParseException - if callee is not a valid sip address string.

createVideoCall

public Call createVideoCall(Contact callee)
                     throws OperationFailedException
Create a new video call and invite the specified CallPeer to it.

Specified by:
createVideoCall in interface OperationSetVideoTelephony
Overrides:
createVideoCall in class OperationSetVideoTelephonySipImpl
Parameters:
callee - the address of the callee that we should invite to a new call.
Returns:
CallPeer the CallPeer that will represented by the specified uri. All following state change events will be delivered through that call peer. The Call that this peer is a member of could be retrieved from the CallParticipatn instance with the use of the corresponding method.
Throws:
OperationFailedException - with the corresponding code if we fail to create the video call.

setLocalVideoAllowed

public void setLocalVideoAllowed(Call call,
                                 boolean allowed)
                          throws OperationFailedException
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.

Specified by:
setLocalVideoAllowed in interface OperationSetVideoTelephony
Overrides:
setLocalVideoAllowed in class OperationSetVideoTelephonySipImpl
Parameters:
call - the call where we'd like to allow sending local video.
allowed - true if local video transmission is allowed and false otherwise.
Throws:
OperationFailedException - if video initialization fails.

isLocalVideoAllowed

public boolean isLocalVideoAllowed(Call call)
Implements OperationSetVideoTelephony#isLocalVideoAllowed(Call). Modifies the local media setup to reflect the requested setting for the streaming of the local video.

Specified by:
isLocalVideoAllowed in interface OperationSetVideoTelephony
Overrides:
isLocalVideoAllowed in class AbstractOperationSetVideoTelephony<OperationSetBasicTelephonySipImpl,ProtocolProviderServiceSipImpl,CallSipImpl,CallPeerSipImpl>
Parameters:
call - the Call whose video transmission properties we are interested in.
Returns:
true if the streaming of local video for the specified Call is allowed; otherwise, false

setLocalVideoAllowed

public void setLocalVideoAllowed(Call call,
                                 MediaDevice mediaDevice,
                                 boolean allowed)
                          throws OperationFailedException
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.

Specified by:
setLocalVideoAllowed in interface OperationSetDesktopStreaming
Parameters:
call - the Call to allow/disallow the streaming of local video for
mediaDevice - the media device to use for the desktop streaming
allowed - true to allow the streaming of local video for the specified Call; false to disallow it
Throws:
OperationFailedException - if initializing local video fails.

isPartialStreaming

public boolean isPartialStreaming(Call call)
If the streaming is partial (not the full desktop).

Specified by:
isPartialStreaming in interface OperationSetDesktopStreaming
Parameters:
call - the Call whose video transmission properties we are interested in.
Returns:
true if streaming is partial, false otherwise

movePartialDesktopStreaming

public void movePartialDesktopStreaming(Call call,
                                        int x,
                                        int y)
Move origin of a partial desktop streaming.

Specified by:
movePartialDesktopStreaming in interface OperationSetDesktopStreaming
Parameters:
call - the Call whose video transmission properties we are interested in.
x - new x coordinate origin
y - new y coordinate origin

getOrigin

public Point getOrigin()
Get origin of streamed zone.

Returns:
origin of streamed zone or null if we stream the full desktop

getOriginForMediaDevice

protected static Point getOriginForMediaDevice(MediaDevice device)
Get origin of the screen.

Parameters:
device - media device
Returns:
origin

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.