Improves setting of the stream direction when processing jingle content-accept messages. This fixes a problem with video conferences where video streams sometimes 'freeze' if a non-focus starts to send video (while the focus is not sending video)

cusax-fix
Boris Grozev 13 years ago
parent be6bcd736e
commit e2af23f7ac

@ -172,7 +172,12 @@ public ColibriConferenceIQ createColibriChannels(
: colibri.getFrom();
if ((jitsiVideoBridge == null) || (jitsiVideoBridge.length() == 0))
{
if (logger.isInfoEnabled())
logger.info("Failed to allocate colibri channels: no " +
" videobridge found.");
return null;
}
ColibriConferenceIQ conferenceRequest = new ColibriConferenceIQ();
@ -231,10 +236,27 @@ public ColibriConferenceIQ createColibriChannels(
packetCollector.cancel();
if ((response == null)
|| (response.getError() != null)
|| !(response instanceof ColibriConferenceIQ))
if (response == null)
{
if (logger.isInfoEnabled())
logger.info("Failed to allocate colibri channels: response " +
"is null");
return null;
}
else if (response.getError() != null)
{
if (logger.isInfoEnabled())
logger.info("Failed to allocate colibri channels: " +
response.getError());
return null;
}
else if (!(response instanceof ColibriConferenceIQ))
{
if (logger.isInfoEnabled())
logger.info("Failed to allocate colibri channels: response is" +
"not a colibri conference");
return null;
}
ColibriConferenceIQ conferenceResponse = (ColibriConferenceIQ) response;
String conferenceResponseID = conferenceResponse.getID();

@ -1422,6 +1422,44 @@ private void processContent(
//determine the direction that we need to announce.
MediaDirection remoteDirection
= JingleUtils.getDirection(content, getPeer().isInitiator());
boolean checkUserPreference = true;
/* If we are the focus of a conference and a peer is sending video to
* us, we should announce at least SENDONLY, even if we are not
* sending video ourselves.
*/
if (MediaType.VIDEO.equals(mediaType))
{
Call call = getPeer().getCall();
if (call != null && call.getConference().isConferenceFocus())
{
/* We don't keep per-CallPeer MediaDirections, so we use the
* current direction of our video MediaStream as a hint that
* one of our peers is sending video to us.
*/
MediaStream mediaStream = getStream(MediaType.VIDEO);
if (mediaStream != null)
{
MediaDirection streamDirection = mediaStream.getDirection();
if (streamDirection != null &&
streamDirection.allowsReceiving())
{
checkUserPreference = false;
remoteDirection
= remoteDirection.or(MediaDirection.SENDONLY);
}
}
}
}
if (checkUserPreference)
{
// Take the preference of the user with respect to streaming
// mediaType into account.
devDirection
= devDirection.and(getDirectionUserPreference(mediaType));
}
MediaDirection direction
= devDirection.getDirectionForAnswer(remoteDirection);

@ -472,7 +472,7 @@ else if (di != null)
else
{
ProtocolProviderServiceJabberImpl.throwOperationFailedException(
"Failed to create a call",
"Failed to create a call to " + fullCalleeURI,
OperationFailedException.INTERNAL_ERROR,
t,
logger);

@ -974,6 +974,10 @@ protected Map<MediaTypeSrtpControl, SrtpControl> getSrtpControls()
*/
public MediaStream getStream(MediaType mediaType)
{
MediaHandler mediaHandler = getMediaHandler();
if (mediaHandler != null)
return mediaHandler.getStream(this, mediaType);
switch (mediaType)
{
case AUDIO:

@ -909,7 +909,8 @@ MediaStream initStream(
}
else
{
// this is a reinit
if (logger.isDebugEnabled())
logger.debug("Reinitializing stream: " + stream);
}
return

Loading…
Cancel
Save