aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java
diff options
context:
space:
mode:
authorSebastien Vincent <seb@jitsi.org>2011-10-26 07:54:36 +0000
committerSebastien Vincent <seb@jitsi.org>2011-10-26 07:54:36 +0000
commit9e64dda2b82d0c2e98c3036b9f9e71251b9621ac (patch)
tree09351d2961253ac40ef5e91b0c5c9ccb3b41e9ac /src/net/java
parenta9999eedeef4bd233256d5e15069ebc654675a68 (diff)
downloadjitsi-9e64dda2b82d0c2e98c3036b9f9e71251b9621ac.zip
jitsi-9e64dda2b82d0c2e98c3036b9f9e71251b9621ac.tar.gz
jitsi-9e64dda2b82d0c2e98c3036b9f9e71251b9621ac.tar.bz2
Fixes call video resolution changes in the following situation: A changes to low resolution (LO), B switches to LO, A switch to standard resolution (SD) and B automatically switches to SD which is not desired.
Diffstat (limited to 'src/net/java')
-rw-r--r--src/net/java/sip/communicator/impl/neomedia/VideoMediaStreamImpl.java26
-rw-r--r--src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandlerSipImpl.java18
-rw-r--r--src/net/java/sip/communicator/service/neomedia/VideoMediaStream.java10
3 files changed, 54 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/impl/neomedia/VideoMediaStreamImpl.java b/src/net/java/sip/communicator/impl/neomedia/VideoMediaStreamImpl.java
index 7181e6f..0d02c96 100644
--- a/src/net/java/sip/communicator/impl/neomedia/VideoMediaStreamImpl.java
+++ b/src/net/java/sip/communicator/impl/neomedia/VideoMediaStreamImpl.java
@@ -921,6 +921,32 @@ public class VideoMediaStreamImpl
}
/**
+ * Updates the <tt>QualityControl</tt> of this <tt>VideoMediaStream</tt>.
+ *
+ * @param advancedParams parameters of advanced attributes that may affect
+ * quality control
+ */
+ public void updateQualityControl(
+ Map<String, String> advancedParams)
+ {
+ for(Map.Entry<String, String> entry : advancedParams.entrySet())
+ {
+ if(entry.getKey().equals("imageattr"))
+ {
+ Dimension res[] = parseSendRecvResolution(entry.getValue());
+
+ if(res != null)
+ {
+ qualityControl.setRemoteSendMaxPreset(
+ new QualityPreset(res[0]));
+ qualityControl.setRemoteReceiveResolution(
+ res[1]);
+ }
+ }
+ }
+ }
+
+ /**
* Implements the <tt>KeyFrameControl</tt> of this
* <tt>VideoMediaStream</tt>.
*
diff --git a/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandlerSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandlerSipImpl.java
index 44327db..f1257c6 100644
--- a/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandlerSipImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandlerSipImpl.java
@@ -513,6 +513,24 @@ public class CallPeerMediaHandlerSipImpl
QualityPreset sendQualityPreset = null;
QualityPreset receiveQualityPreset = null;
+ // update stream
+ MediaStream stream = getStream(MediaType.VIDEO);
+
+ if(stream != null && dev != null)
+ {
+ List<MediaFormat> fmts = intersectFormats(
+ dev.getSupportedFormats(),
+ remoteFormats);
+
+ if(fmts.size() > 0)
+ {
+ MediaFormat fmt = fmts.get(0);
+
+ ((VideoMediaStream)stream).updateQualityControl(
+ fmt.getAdvancedAttributes());
+ }
+ }
+
if(qualityControls != null)
{
// the one we will send is the other party receive
diff --git a/src/net/java/sip/communicator/service/neomedia/VideoMediaStream.java b/src/net/java/sip/communicator/service/neomedia/VideoMediaStream.java
index 2530f19..28738ee 100644
--- a/src/net/java/sip/communicator/service/neomedia/VideoMediaStream.java
+++ b/src/net/java/sip/communicator/service/neomedia/VideoMediaStream.java
@@ -7,6 +7,7 @@
package net.java.sip.communicator.service.neomedia;
import java.awt.*;
+import java.util.*;
import net.java.sip.communicator.service.neomedia.control.*;
import net.java.sip.communicator.service.neomedia.event.*;
@@ -88,4 +89,13 @@ public interface VideoMediaStream
* @return the <tt>QualityControl</tt> of this <tt>VideoMediaStream</tt>
*/
public QualityControl getQualityControl();
+
+ /**
+ * Updates the <tt>QualityControl</tt> of this <tt>VideoMediaStream</tt>.
+ *
+ * @param advancedParams parameters of advanced attributes that may affect
+ * quality control
+ */
+ public void updateQualityControl(
+ Map<String, String> advancedParams);
}