aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java
diff options
context:
space:
mode:
authorSebastien Vincent <seb@jitsi.org>2010-10-04 06:29:42 +0000
committerSebastien Vincent <seb@jitsi.org>2010-10-04 06:29:42 +0000
commite03fd00b5737905ed3b17918105b2d9255a1bc59 (patch)
treee5717281ad3dc48e2031357c5eb56bd1931ed971 /src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java
parent92a82069beb70e34de0d1cc6f72aac57c4a9a229 (diff)
downloadjitsi-e03fd00b5737905ed3b17918105b2d9255a1bc59.zip
jitsi-e03fd00b5737905ed3b17918105b2d9255a1bc59.tar.gz
jitsi-e03fd00b5737905ed3b17918105b2d9255a1bc59.tar.bz2
Implement new OperationSetDesktopStreaming interface to prepare integration of the desktop streaming/sharing GUI.
Diffstat (limited to 'src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java')
-rw-r--r--src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java58
1 files changed, 55 insertions, 3 deletions
diff --git a/src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java b/src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java
index 49999c6..c495d9a 100644
--- a/src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java
+++ b/src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java
@@ -84,6 +84,20 @@ public abstract class MediaAwareCall<
protected MediaUseCase mediaUseCase = MediaUseCase.ANY;
/**
+ * The <tt>MediaDevice</tt> for video we should use in the call.
+ * In case this member is null, a lookup corresponding to MediaType.VIDEO is
+ * performed to the <tt>MediaService</tt>.
+ */
+ private MediaDevice videoDevice = null;
+
+ /**
+ * The <tt>MediaDevice</tt> for audio we should use in the call.
+ * In case this member is null, a lookup corresponding to MediaType.AUDIO is
+ * performed to the <tt>MediaService</tt>.
+ */
+ private MediaDevice audioDevice = null;
+
+ /**
* The listener that would actually subscribe for level events from the
* media handler if there's at least one listener in
* <tt>localUserAudioLevelListeners</tt>.
@@ -234,7 +248,6 @@ public abstract class MediaAwareCall<
* @param evt The <tt>CallPeerChangeEvent</tt> instance containing
* the source event as well as its previous and its new status.
*/
- @SuppressWarnings("unchecked") // should refactor at some point
public void peerStateChanged(CallPeerChangeEvent evt)
{
CallPeerState newState = (CallPeerState) evt.getNewValue();
@@ -331,9 +344,27 @@ public abstract class MediaAwareCall<
*/
public MediaDevice getDefaultDevice(MediaType mediaType)
{
+ MediaDevice device = null;
MediaService mediaService = ProtocolMediaActivator.getMediaService();
- MediaDevice device = mediaService.getDefaultDevice(mediaType,
- mediaUseCase);
+
+ switch(mediaType)
+ {
+ case AUDIO:
+ device = audioDevice;
+ break;
+ case VIDEO:
+ device = videoDevice;
+ break;
+ default:
+ /* no other type supported */
+ return null;
+ }
+
+ if(device == null)
+ {
+ device = mediaService.getDefaultDevice(mediaType,
+ mediaUseCase);
+ }
if (MediaType.AUDIO.equals(mediaType))
{
@@ -611,4 +642,25 @@ public abstract class MediaAwareCall<
}
return recorder;
}
+
+
+ /**
+ * Set the <tt>MediaDevice</tt> used for the video.
+ *
+ * @param dev video <tt>MediaDevice</tt>
+ */
+ public void setVideoDevice(MediaDevice dev)
+ {
+ videoDevice = dev;
+ }
+
+ /**
+ * Set the <tt>MediaDevice</tt> used for the audio.
+ *
+ * @param dev audio <tt>MediaDevice</tt>
+ */
+ public void setAudioDevice(MediaDevice dev)
+ {
+ this.audioDevice = dev;
+ }
}