Fixes issues with video conferencing such as the display of a non-focus participant's video to other non-focus participants and the stopping of the streaming between non-focus participants upon stopping of the streaming of the focus' local video.

cusax-fix
Lyubomir Marinov 14 years ago
parent c3f189792f
commit 073d015251

@ -6,6 +6,8 @@
*/
package net.java.sip.communicator.impl.protocol.jabber;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.service.protocol.media.*;
import net.java.sip.communicator.util.*;
@ -17,14 +19,12 @@
* of Jabber and Gtalk protocols.
*
* @author Vincent Lucas
* @author Lyubomir Marinov
*/
public abstract class AbstractCallPeerJabberGTalkImpl
<T extends AbstractCallJabberGTalkImpl<?>,
U extends AbstractCallPeerMediaHandlerJabberGTalkImpl<?>>
extends MediaAwareCallPeer<
T,
U,
ProtocolProviderServiceJabberImpl>
U extends AbstractCallPeerMediaHandlerJabberGTalkImpl<?>>
extends MediaAwareCallPeer<T, U, ProtocolProviderServiceJabberImpl>
{
/**
* The <tt>Logger</tt> used by the <tt>AbstractCallPeerJabberGTalkImpl</tt>
@ -34,14 +34,20 @@ public abstract class AbstractCallPeerJabberGTalkImpl
= Logger.getLogger(AbstractCallPeerJabberGTalkImpl.class);
/**
* The jabber address of this peer
* Any discovery information that we have for this peer.
*/
protected String peerJID = null;
private DiscoverInfo discoverInfo;
/**
* Any discovery information that we have for this peer.
* The indicator which determines whether this peer was initiated the
* session.
*/
private DiscoverInfo discoverInfo;
protected boolean initiator = false;
/**
* The jabber address of this peer
*/
protected String peerJID;
/**
* Creates a new call peer with address <tt>peerAddress</tt>.
@ -50,9 +56,7 @@ public abstract class AbstractCallPeerJabberGTalkImpl
* peer.
* @param owningCall the call that contains this call peer.
*/
protected AbstractCallPeerJabberGTalkImpl(
String peerAddress,
T owningCall)
protected AbstractCallPeerJabberGTalkImpl(String peerAddress, T owningCall)
{
super(owningCall);
@ -60,14 +64,29 @@ protected AbstractCallPeerJabberGTalkImpl(
}
/**
* Sets the service discovery information that we have for this peer.
* Returns a String locator for that peer.
*
* @param discoverInfo the discovery information that we have obtained for
* this peer.
* @return the peer's address or phone number.
*/
public void setDiscoverInfo(DiscoverInfo discoverInfo)
public String getAddress()
{
this.discoverInfo = discoverInfo;
return peerJID;
}
/**
* Returns the contact corresponding to this peer or null if no
* particular contact has been associated.
* <p>
* @return the <tt>Contact</tt> corresponding to this peer or null
* if no particular contact has been associated.
*/
public Contact getContact()
{
ProtocolProviderService pps = getCall().getProtocolProvider();
OperationSetPresence opSetPresence
= pps.getOperationSet(OperationSetPresence.class);
return opSetPresence.findContactByID(getAddress());
}
/**
@ -81,7 +100,46 @@ public DiscoverInfo getDiscoverInfo()
}
/**
* Retrives the DiscoverInfo for a given peer identified by its URI.
* Returns a human readable name representing this peer.
*
* @return a String containing a name for that peer.
*/
public String getDisplayName()
{
if (getCall() != null)
{
Contact contact = getContact();
if (contact != null)
return contact.getDisplayName();
}
return peerJID;
}
/**
* Returns full URI of the address.
*
* @return full URI of the address
*/
public String getURI()
{
return "xmpp:" + peerJID;
}
/**
* Determines whether this peer initiated the session. Note that if this
* peer is the initiator of the session, then we are the responder!
*
* @return <tt>true</tt> if this peer initiated the session; <tt>false</tt>,
* otherwise (i.e. if _we_ initiated the session).
*/
public boolean isInitiator()
{
return initiator;
}
/**
* Retrieves the DiscoverInfo for a given peer identified by its URI.
*
* @param calleeURI The URI of the call peer.
* @param ppsJabberImpl The call protocol provider service.
@ -105,4 +163,37 @@ protected void retrieveDiscoverInfo(String calleeURI)
logger.warn("could not retrieve info for " + calleeURI, ex);
}
}
/**
* Specifies the address, phone number, or other protocol specific
* identifier that represents this call peer. This method is to be
* used by service users and MUST NOT be called by the implementation.
*
* @param address The address of this call peer.
*/
public void setAddress(String address)
{
if (!peerJID.equals(address))
{
String oldAddress = getAddress();
peerJID = address;
fireCallPeerChangeEvent(
CallPeerChangeEvent.CALL_PEER_ADDRESS_CHANGE,
oldAddress,
address);
}
}
/**
* Sets the service discovery information that we have for this peer.
*
* @param discoverInfo the discovery information that we have obtained for
* this peer.
*/
public void setDiscoverInfo(DiscoverInfo discoverInfo)
{
this.discoverInfo = discoverInfo;
}
}

@ -496,8 +496,9 @@ public Iterable<ContentPacketExtension> generateSessionAccept()
//let's now see what was the format we announced as first and
//configure the stream with it.
String contentName = ourContent.getName();
ContentPacketExtension theirContent
= this.remoteContentMap.get(ourContent.getName());
= this.remoteContentMap.get(contentName);
RtpDescriptionPacketExtension theirDescription
= JingleUtils.getRtpDescription(theirContent);
MediaFormat format = null;
@ -560,7 +561,7 @@ public Iterable<ContentPacketExtension> generateSessionAccept()
// create the corresponding stream...
initStream(
ourContent.getName(),
contentName,
connector,
dev,
format,

@ -66,7 +66,7 @@ public void setLocalVideoAllowed(Call call, boolean allowed)
{
super.setLocalVideoAllowed(call, allowed);
((CallJabberImpl)call).modifyVideoContent(allowed);
((AbstractCallJabberGTalkImpl<?>) call).modifyVideoContent(allowed);
}
/**
@ -171,10 +171,10 @@ public void answerVideoCallPeer(CallPeer peer)
*/
public QualityControl getQualityControl(CallPeer peer)
{
if(peer instanceof CallPeerJabberImpl)
return ((CallPeerJabberImpl) peer).getMediaHandler().
getQualityControl();
else
return null;
return
(peer instanceof CallPeerJabberImpl)
? ((CallPeerJabberImpl) peer).getMediaHandler()
.getQualityControl()
: null;
}
}

Loading…
Cancel
Save