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.

cusax-fix
Sebastien Vincent 15 years ago
parent a9999eedee
commit 9e64dda2b8

@ -920,6 +920,32 @@ public QualityControl getQualityControl()
return qualityControl;
}
/**
* 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>.

@ -513,6 +513,24 @@ private Vector<MediaDescription> createMediaDescriptionsForAnswer(
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

@ -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);
}

Loading…
Cancel
Save