aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator
diff options
context:
space:
mode:
authorSebastien Vincent <seb@jitsi.org>2011-02-16 12:26:27 +0000
committerSebastien Vincent <seb@jitsi.org>2011-02-16 12:26:27 +0000
commitf0cde23a8fe18b8e333dd660b414d3c720b1f85b (patch)
tree86c88d80ea0df1a3eb91b60eaf9292f807366339 /src/net/java/sip/communicator
parent19b472daca80b5377d9a64e432c007dc828fa522 (diff)
downloadjitsi-f0cde23a8fe18b8e333dd660b414d3c720b1f85b.zip
jitsi-f0cde23a8fe18b8e333dd660b414d3c720b1f85b.tar.gz
jitsi-f0cde23a8fe18b8e333dd660b414d3c720b1f85b.tar.bz2
Add methods to MediaService for streaming a part of desktop and stub methods in MediaServiceImpl.
Diffstat (limited to 'src/net/java/sip/communicator')
-rw-r--r--src/net/java/sip/communicator/impl/neomedia/MediaServiceImpl.java45
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/OperationSetDesktopStreamingJabberImpl.java21
-rw-r--r--src/net/java/sip/communicator/impl/protocol/sip/OperationSetDesktopStreamingSipImpl.java21
-rw-r--r--src/net/java/sip/communicator/service/neomedia/MediaService.java36
-rw-r--r--src/net/java/sip/communicator/service/protocol/OperationSetDesktopStreaming.java9
5 files changed, 131 insertions, 1 deletions
diff --git a/src/net/java/sip/communicator/impl/neomedia/MediaServiceImpl.java b/src/net/java/sip/communicator/impl/neomedia/MediaServiceImpl.java
index 7595080..8f0a5d0 100644
--- a/src/net/java/sip/communicator/impl/neomedia/MediaServiceImpl.java
+++ b/src/net/java/sip/communicator/impl/neomedia/MediaServiceImpl.java
@@ -13,6 +13,7 @@ import java.util.List;
import javax.media.*;
import javax.media.control.*;
+import javax.media.format.RGBFormat;
import javax.media.protocol.*;
import javax.swing.*;
@@ -20,6 +21,7 @@ import net.java.sip.communicator.impl.neomedia.codec.*;
import net.java.sip.communicator.impl.neomedia.codec.video.*;
import net.java.sip.communicator.impl.neomedia.device.*;
import net.java.sip.communicator.impl.neomedia.format.*;
+import net.java.sip.communicator.impl.neomedia.protocol.*;
import net.java.sip.communicator.impl.neomedia.videoflip.*;
import net.java.sip.communicator.service.neomedia.*;
import net.java.sip.communicator.service.neomedia.device.*;
@@ -927,4 +929,47 @@ public class MediaServiceImpl
player.deallocate();
player.close();
}
+
+ /**
+ * Get a <tt>MediaDevice</tt> for a part of desktop streaming/sharing.
+ *
+ * @param mediaDevice original desktop streaming <tt>MediaDevice</tt>
+ * @param width width of the part
+ * @param height height of the part
+ * @param x origin of the x coordinate (relative to the full desktop)
+ * @param y origin of the y coordinate (relative to the full desktop)
+ * @return <tt>MediaDevice</tt> representing the part of desktop or null
+ * if problem
+ */
+ public MediaDevice getMediaDeviceForPartialDesktopStreaming(
+ MediaDevice mediaDevice, int width, int height, int x, int y)
+ {
+ return null;
+ }
+
+ /**
+ * Move origin of a partial desktop streaming <tt>MediaDevice</tt>.
+ *
+ * @param mediaDevice desktop streaming <tt>MediaDevice</tt> obtained by
+ * getMediaDeviceForPartialDesktopStreaming() method.
+ * @param x new x coordinate origin
+ * @param y new y coordinate origin
+ */
+ public void movePartialDesktopStreaming(MediaDevice mediaDevice, int x,
+ int y)
+ {
+ }
+
+ /**
+ * If the <tt>MediaDevice</tt> corresponds to partial desktop streaming
+ * device.
+ *
+ * @param mediaDevice <tt>MediaDevice</tt>
+ * @return true if <tt>MediaDevice</tt> is a partial desktop streaming
+ * device, false otherwise
+ */
+ public boolean isPartialStreaming(MediaDevice mediaDevice)
+ {
+ return false;
+ }
}
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetDesktopStreamingJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetDesktopStreamingJabberImpl.java
index 5fd97d7..8105eb8 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetDesktopStreamingJabberImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetDesktopStreamingJabberImpl.java
@@ -237,4 +237,25 @@ public class OperationSetDesktopStreamingJabberImpl
basicTelephony.createOutgoingCall(call, calleeAddress);
return call;
}
+
+ /**
+ * If the streaming is partial (not the full desktop).
+ *
+ * @param call the <tt>Call</tt> whose video transmission properties we are
+ * interested in.
+ * @return true if streaming is partial, false otherwise
+ */
+ public boolean isPartialStreaming(Call call)
+ {
+ CallJabberImpl callImpl = (CallJabberImpl)call;
+ MediaDevice device = callImpl.getDefaultDevice(MediaType.VIDEO);
+
+ if(device != null)
+ {
+ MediaService mediaService = JabberActivator.getMediaService();
+ return mediaService.isPartialStreaming(device);
+ }
+
+ return false;
+ }
}
diff --git a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetDesktopStreamingSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetDesktopStreamingSipImpl.java
index e55d07a..80a2cf9 100644
--- a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetDesktopStreamingSipImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetDesktopStreamingSipImpl.java
@@ -239,4 +239,25 @@ public class OperationSetDesktopStreamingSipImpl
/* reinvite all peers */
((CallSipImpl)call).reInvite();
}
+
+ /**
+ * If the streaming is partial (not the full desktop).
+ *
+ * @param call the <tt>Call</tt> whose video transmission properties we are
+ * interested in.
+ * @return true if streaming is partial, false otherwise
+ */
+ public boolean isPartialStreaming(Call call)
+ {
+ CallSipImpl callImpl = (CallSipImpl)call;
+ MediaDevice device = callImpl.getDefaultDevice(MediaType.VIDEO);
+
+ if(device != null)
+ {
+ MediaService mediaService = SipActivator.getMediaService();
+ return mediaService.isPartialStreaming(device);
+ }
+
+ return false;
+ }
}
diff --git a/src/net/java/sip/communicator/service/neomedia/MediaService.java b/src/net/java/sip/communicator/service/neomedia/MediaService.java
index 4f93530..6784f82 100644
--- a/src/net/java/sip/communicator/service/neomedia/MediaService.java
+++ b/src/net/java/sip/communicator/service/neomedia/MediaService.java
@@ -7,7 +7,6 @@
package net.java.sip.communicator.service.neomedia;
import java.util.*;
-import java.util.List;
import net.java.sip.communicator.service.neomedia.device.*;
import net.java.sip.communicator.service.neomedia.format.*;
@@ -203,4 +202,39 @@ public interface MediaService
*/
public Object getVideoPreviewComponent(
MediaDevice device, int preferredWidth, int preferredHeight);
+
+ /**
+ * Get a <tt>MediaDevice</tt> for a part of desktop streaming/sharing.
+ *
+ * @param mediaDevice original desktop streaming <tt>MediaDevice</tt>
+ * @param width width of the part
+ * @param height height of the part
+ * @param x origin of the x coordinate (relative to the full desktop)
+ * @param y origin of the y coordinate (relative to the full desktop)
+ * @return <tt>MediaDevice</tt> representing the part of desktop or null
+ * if problem
+ */
+ public MediaDevice getMediaDeviceForPartialDesktopStreaming(
+ MediaDevice mediaDevice, int width, int height, int x, int y);
+
+ /**
+ * Move origin of a partial desktop streaming <tt>MediaDevice</tt>.
+ *
+ * @param mediaDevice desktop streaming <tt>MediaDevice</tt> obtained by
+ * getMediaDeviceForPartialDesktopStreaming() method.
+ * @param x new x coordinate origin
+ * @param y new y coordinate origin
+ */
+ public void movePartialDesktopStreaming(MediaDevice mediaDevice, int x,
+ int y);
+
+ /**
+ * If the <tt>MediaDevice</tt> corresponds to partial desktop streaming
+ * device.
+ *
+ * @param mediaDevice <tt>MediaDevice</tt>
+ * @return true if <tt>MediaDevice</tt> is a partial desktop streaming
+ * device, false otherwise
+ */
+ public boolean isPartialStreaming(MediaDevice mediaDevice);
}
diff --git a/src/net/java/sip/communicator/service/protocol/OperationSetDesktopStreaming.java b/src/net/java/sip/communicator/service/protocol/OperationSetDesktopStreaming.java
index 2597e22..4d84a8b 100644
--- a/src/net/java/sip/communicator/service/protocol/OperationSetDesktopStreaming.java
+++ b/src/net/java/sip/communicator/service/protocol/OperationSetDesktopStreaming.java
@@ -75,4 +75,13 @@ public interface OperationSetDesktopStreaming
MediaDevice mediaDevice,
boolean allowed)
throws OperationFailedException;
+
+ /**
+ * If the streaming is partial (not the full desktop).
+ *
+ * @param call the <tt>Call</tt> whose video transmission properties we are
+ * interested in.
+ * @return true if streaming is partial, false otherwise
+ */
+ public boolean isPartialStreaming(Call call);
}