Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber
Class OperationSetDesktopStreamingJabberImpl

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.media.AbstractOperationSetVideoTelephony<OperationSetBasicTelephonyJabberImpl,ProtocolProviderServiceJabberImpl,CallJabberImpl,CallPeerJabberImpl>
      extended by net.java.sip.communicator.impl.protocol.jabber.OperationSetVideoTelephonyJabberImpl
          extended by net.java.sip.communicator.impl.protocol.jabber.OperationSetDesktopStreamingJabberImpl
All Implemented Interfaces:
OperationSet, OperationSetDesktopStreaming, OperationSetVideoTelephony
Direct Known Subclasses:
OperationSetDesktopSharingServerJabberImpl

public class OperationSetDesktopStreamingJabberImpl
extends OperationSetVideoTelephonyJabberImpl
implements OperationSetDesktopStreaming

Implements all desktop streaming related functions for XMPP.

Author:
Sebastien Vincent

Field Summary
protected  Point origin
          Origin (x, y) of the zone streamed.
protected  Dimension size
          Video panel size.
 
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
OperationSetDesktopStreamingJabberImpl(OperationSetBasicTelephonyJabberImpl basicTelephony)
          Initializes a new OperationSetDesktopStreamingJabberImpl instance which builds upon the telephony-related functionality of a specific OperationSetBasicTelephonyJabberImpl.
 
Method Summary
protected  Call createOutgoingVideoCall(String calleeAddress, MediaDevice videoDevice)
          Check if the remote part supports Jingle video.
 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.
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.jabber.OperationSetVideoTelephonyJabberImpl
answerVideoCallPeer, createOutgoingVideoCall, getQualityControl
 
Methods inherited from class net.java.sip.communicator.service.protocol.media.AbstractOperationSetVideoTelephony
addPropertyChangeListener, addVideoListener, createLocalVisualComponent, createVideoCall, createVideoCall, 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
Video panel size.


origin

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

Constructor Detail

OperationSetDesktopStreamingJabberImpl

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

Parameters:
basicTelephony - the OperationSetBasicTelephonyJabberImpl 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<OperationSetBasicTelephonyJabberImpl,ProtocolProviderServiceJabberImpl,CallJabberImpl,CallPeerJabberImpl>
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 CallParticipant 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 Jabber 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 CallParticipatn 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
Create a new video call and invite the specified CallPeer to it.

Specified by:
createVideoCall in interface OperationSetVideoTelephony
Overrides:
createVideoCall in class OperationSetVideoTelephonyJabberImpl
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.

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 OperationSetVideoTelephonyJabberImpl
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 OperationSetVideoTelephonyJabberImpl
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.

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. If the device is null, the default device is used.
allowed - true to allow the streaming of local video for the specified Call; false to disallow it
Throws:
OperationFailedException - if initializing local video 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<OperationSetBasicTelephonyJabberImpl,ProtocolProviderServiceJabberImpl,CallJabberImpl,CallPeerJabberImpl>
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

createOutgoingVideoCall

protected Call createOutgoingVideoCall(String calleeAddress,
                                       MediaDevice videoDevice)
                                throws OperationFailedException
Check if the remote part supports Jingle video.

Parameters:
calleeAddress - Contact address
videoDevice - MediaDevice used
Returns:
true if contact support Jingle video, false otherwise
Throws:
OperationFailedException - with the corresponding code if we fail to create the video call.

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

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.