Handles local hold when a videobridge is in use

cusax-fix
Boris Grozev 13 years ago
parent 6ddb25fb8a
commit d0a4297332

@ -1880,10 +1880,10 @@ public void setRemotelyOnHold(boolean onHold)
* need to ask the videobridge to change the stream
* direction on behalf of us.
*/
ColibriConferenceIQ.Channel channel
= getColibriChannel(mediaType);
if(remotelyOnHold)
{
ColibriConferenceIQ.Channel channel
= getColibriChannel(mediaType);
getPeer().getCall().setChannelDirection(
channel.getID(),
mediaType,
@ -1892,8 +1892,6 @@ public void setRemotelyOnHold(boolean onHold)
else
{
//TODO: does SENDRECV always make sense?
ColibriConferenceIQ.Channel channel
= getColibriChannel(mediaType);
getPeer().getCall().setChannelDirection(
channel.getID(),
mediaType,
@ -2152,6 +2150,48 @@ public boolean isRemotelyOnHold()
return remotelyOnHold;
}
/**
* {@inheritDoc}
*
* Handles the case when a videobridge is in use.
*
* @param locallyOnHold <tt>true</tt> if we are to make our streams
* stop transmitting and <tt>false</tt> if we are to start transmitting
*/
@Override
public void setLocallyOnHold(boolean locallyOnHold)
{
if (!getPeer().isJitsiVideoBridge())
{
super.setLocallyOnHold(locallyOnHold);
}
else
{
this.locallyOnHold = locallyOnHold;
if (!locallyOnHold
&& CallPeerState.ON_HOLD_MUTUALLY.equals(getPeer().getState()))
return;
for (MediaType mediaType : MediaType.values())
{
ColibriConferenceIQ.Channel channel
= getColibriChannel(mediaType);
if (channel == null)
continue;
MediaDirection direction
= locallyOnHold
? MediaDirection.INACTIVE
: MediaDirection.SENDRECV;
getPeer().getCall().setChannelDirection(
channel.getID(),
mediaType,
direction);
}
}
}
}

@ -134,7 +134,7 @@ public boolean requestKeyFrame()
/**
* Determines whether we have placed the call on hold locally.
*/
private boolean locallyOnHold = false;
protected boolean locallyOnHold = false;
/**
* The listener that the <tt>CallPeer</tt> registered for local user audio
@ -1534,7 +1534,7 @@ public void setLocalAudioTransmissionEnabled(boolean enabled)
* (according to the value of <tt>locallyOnHold</tt>). This would also be
* taken into account when the next update offer is generated.
*
* @param locallyOnHold <tt>true</tt> if we are to make our audio stream
* @param locallyOnHold <tt>true</tt> if we are to make our streams
* stop transmitting and <tt>false</tt> if we are to start transmitting
* again.
*/

Loading…
Cancel
Save