Fixes issues with Jitsi VideoBridge conferencing.

cusax-fix
Lyubomir Marinov 14 years ago
parent 976ee608a0
commit 80860c7761

@ -1499,29 +1499,30 @@ public static boolean addressesAreEqual(String a, String b)
return true;
int aProtocolIndex = a.indexOf(':');
if(aProtocolIndex > -1)
if(aProtocolIndex != -1)
a = a.substring(aProtocolIndex + 1);
int bProtocolIndex = b.indexOf(':');
if(bProtocolIndex > -1)
if(bProtocolIndex != -1)
b = b.substring(bProtocolIndex + 1);
if (a.equals(b))
return true;
int aServiceBegin = a.indexOf('@');
int aServiceBegin = a.indexOf('@', aProtocolIndex);
String aUserID;
String aService;
if (aServiceBegin > -1)
if (aServiceBegin != -1)
{
aUserID = a.substring(0, aServiceBegin);
++aServiceBegin;
int slashIndex = a.indexOf("/");
if (slashIndex > 0)
aService = a.substring(aServiceBegin + 1, slashIndex);
int aResourceBegin = a.indexOf('/', aServiceBegin);
if (aResourceBegin != -1)
aService = a.substring(aServiceBegin, aResourceBegin);
else
aService = a.substring(aServiceBegin + 1);
aService = a.substring(aServiceBegin);
}
else
{
@ -1529,19 +1530,20 @@ public static boolean addressesAreEqual(String a, String b)
aService = null;
}
int bServiceBegin = b.indexOf('@');
int bServiceBegin = b.indexOf('@', bProtocolIndex);
String bUserID;
String bService;
if (bServiceBegin > -1)
if (bServiceBegin != -1)
{
bUserID = b.substring(0, bServiceBegin);
int slashIndex = b.indexOf("/");
++bServiceBegin;
if (slashIndex > 0)
bService = b.substring(bServiceBegin + 1, slashIndex);
int bResourceBegin = b.indexOf('/', bServiceBegin);
if (bResourceBegin != -1)
bService = b.substring(bServiceBegin, bResourceBegin);
else
bService = b.substring(bServiceBegin + 1);
bService = b.substring(bServiceBegin);
}
else
{

@ -9,6 +9,7 @@
import java.awt.*;
import java.awt.event.*;
import java.beans.*;
import java.util.List;
import javax.swing.*;
@ -24,13 +25,14 @@
import org.jitsi.service.configuration.*;
import org.jitsi.service.neomedia.*;
import org.jitsi.service.protocol.event.*;
import org.jitsi.service.resources.*;
import org.jitsi.util.event.*;
/**
* The panel containing details about ZRTP call security.
*
* @author Werner Dittman
* @author Lubomir Marinov
* @author Lyubomir Marinov
* @author Yana Stamcheva
*/
public class ZrtpSecurityPanel
@ -273,30 +275,31 @@ private JPanel createSasPanel()
{
sasVerified = getSecurityControl().isSecurityVerified();
TransparentPanel sasPanel = new TransparentPanel()
{
@Override
public void paintComponent(Graphics g)
TransparentPanel sasPanel
= new TransparentPanel()
{
g = g.create();
try
{
AntialiasingManager.activateAntialiasing(g);
g.setColor(new Color(1f, 1f, 1f, 0.1f));
g.fillRoundRect(
0, 0, this.getWidth(), this.getHeight(), 10, 10);
g.setColor(Color.WHITE);
g.drawRoundRect(
0, 0,
this.getWidth() - 1, this.getHeight() - 1,
10, 10);
}
finally
@Override
public void paintComponent(Graphics g)
{
g.dispose();
g = g.create();
try
{
AntialiasingManager.activateAntialiasing(g);
g.setColor(new Color(1f, 1f, 1f, 0.1f));
g.fillRoundRect(
0, 0, this.getWidth(), this.getHeight(), 10, 10);
g.setColor(Color.WHITE);
g.drawRoundRect(
0, 0,
this.getWidth() - 1, this.getHeight() - 1,
10, 10);
}
finally
{
g.dispose();
}
}
}
};
};
sasPanel.setLayout(new BoxLayout(sasPanel, BoxLayout.Y_AXIS));
@ -592,57 +595,74 @@ private void setVideoSecurityOn(final boolean isVideoSecurityOn)
{
if (!SwingUtilities.isEventDispatchThread())
{
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
setVideoSecurityOn(isVideoSecurityOn);
}
});
SwingUtilities.invokeLater(
new Runnable()
{
public void run()
{
setVideoSecurityOn(isVideoSecurityOn);
}
});
return;
}
this.isVideoSecurityOn = isVideoSecurityOn;
Icon statusIcon = null;
String statusText = null;
Icon icon = null;
String text = null;
boolean visible = false;
final OperationSetVideoTelephony telephony
= callPeer.getProtocolProvider()
.getOperationSet(OperationSetVideoTelephony.class);
OperationSetVideoTelephony videoTelephony
= callPeer.getProtocolProvider().getOperationSet(
OperationSetVideoTelephony.class);
if (telephony != null
&& ((telephony.getVisualComponents(callPeer) != null
&& telephony.getVisualComponents(callPeer).size() > 0)
|| ((MediaAwareCallPeer<?, ?, ?>) callPeer)
.isLocalVideoStreaming()))
if (videoTelephony != null)
{
if (isVideoSecurityOn)
/*
* The invocation of MediaAwareCallPeer.isLocalVideoStreaming() is
* cheaper than the invocation of
* OperationSetVideoTelephony.getVisualComponents(CallPeer).
*/
visible
= ((MediaAwareCallPeer<?,?,?>) callPeer)
.isLocalVideoStreaming();
if (!visible)
{
statusIcon = videoSecuredIcon;
statusText = GuiActivator.getResources()
.getI18NString("service.gui.security.SECURE_VIDEO");
List<Component> videos
= videoTelephony.getVisualComponents(callPeer);
visible = ((videos != null) && (videos.size() != 0));
}
else
if (visible)
{
statusIcon = videoNotSecuredIcon;
statusText = GuiActivator.getResources()
.getI18NString("service.gui.security.VIDEO_NOT_SECURED");
ResourceManagementService r = GuiActivator.getResources();
if (isVideoSecurityOn)
{
icon = videoSecuredIcon;
text = r.getI18NString("service.gui.security.SECURE_VIDEO");
}
else
{
icon = videoNotSecuredIcon;
text
= r.getI18NString(
"service.gui.security.VIDEO_NOT_SECURED");
}
}
}
else
{
videoSecurityLabel.setVisible(false);
}
if (statusIcon != null && statusText != null)
if ((icon != null) && (text != null))
{
videoSecurityLabel.setIcon(statusIcon);
videoSecurityLabel.setText(statusText);
videoSecurityLabel.setIcon(icon);
videoSecurityLabel.setText(text);
if (!videoSecurityLabel.isVisible())
videoSecurityLabel.setVisible(true);
}
else if (visible)
videoSecurityLabel.setVisible(visible);
revalidate();
repaint();
@ -740,7 +760,7 @@ public void run()
configService.setProperty(zidAorKey, callPeer.getAddress());
/*
* Reduce length of ZID name to fit the security status label.
* The security status label's tooltip contains the full name
* The security status label's tool tip contains the full name
* including an explanatory text.
*/
String label = zidNameValue;

@ -169,7 +169,7 @@ public ConferencePeerPanel(
+ "DISABLE_SOUND_LEVEL_INDICATORS",
false))
{
call.addLocalUserSoundLevelListener(soundLevelListener);
call.addLocalUserSoundLevelListener(soundLevelListener);
}
}

@ -40,6 +40,14 @@ public class VideoConferenceCallPanel
private static final Logger logger
= Logger.getLogger(VideoConferenceCallPanel.class);
/**
* The compile-time flag which indicates whether each video displayed by
* <tt>VideoConferenceCallPanel</tt> is to be depicted with an associated
* tool bar showing information and controls related to the (local or
* remote) peer sending the respective video.
*/
private static final boolean SHOW_TOOLBARS = true;
/**
* The facility which aids this instance with the video-related information.
*/
@ -193,6 +201,7 @@ private Component createDefaultPhotoPanel(ImageIcon photoLabelIcon)
photoLabel.setIcon(photoLabelIcon);
@SuppressWarnings("serial")
JPanel photoPanel
= new TransparentPanel(new GridBagLayout())
{
@ -711,17 +720,24 @@ protected ConferenceCallPeerRenderer updateViewFromModel(
/**
* {@inheritDoc}
*
* Temporarily disables the use of <tt>ConferenceParticipantContainer</tt>
* because the functionality implemented in the model at the time of this
* writing does not fully support mapping of visual <tt>Component</tt>s
* If {@link #SHOW_TOOLBARS} is <tt>false</tt>, disables the use of
* <tt>ConferenceParticipantContainer</tt>. A reason for such a value of
* <tt>SHOW_TOOLBARS</tt> may be that the functionality implemented in the
* model may not fully support mapping of visual <tt>Component</tt>s
* displaying video to telephony conference participants (e.g. in telephony
* conferences utilizing the Jitsi VideoBridge server-side technology).
* Instead displays the videos only, does not map videos to participants and
* does not display participants who do not have videos.
* conferences utilizing the Jitsi VideoBridge server-side technology). In
* such a case displays the videos only, does not map videos to participants
* and does not display participants who do not have videos.
*/
@Override
protected void updateViewFromModelInEventDispatchThread()
{
if (SHOW_TOOLBARS)
{
super.updateViewFromModelInEventDispatchThread();
return;
}
/*
* Determine the set of visual Components displaying video streaming
* between the local peer/user and the remote peers which are to be

@ -142,26 +142,23 @@ public List<Component> getVisualComponents(CallPeer peer)
* @return the <tt>ConferenceMember</tt> corresponding to the given
* <tt>visualComponent</tt>.
*/
@SuppressWarnings("unchecked") // work with MediaAware* in media package
public ConferenceMember getConferenceMember(CallPeer peer,
Component visualComponent)
{
VideoMediaStream peerVideoStream
= (VideoMediaStream) ((W)peer).getMediaHandler()
.getStream(MediaType.VIDEO);
if (peerVideoStream == null)
return null;
@SuppressWarnings("unchecked")
W w = (W) peer;
VideoMediaStream videoStream
= (VideoMediaStream) w.getMediaHandler().getStream(MediaType.VIDEO);
for (ConferenceMember member : peer.getConferenceMembers())
if (videoStream != null)
{
Component memberComponent = peerVideoStream
.getVisualComponent(member.getVideoSsrc());
if (memberComponent != null
&& memberComponent.equals(visualComponent))
for (ConferenceMember member : peer.getConferenceMembers())
{
return member;
Component memberComponent
= videoStream.getVisualComponent(member.getVideoSsrc());
if (visualComponent.equals(memberComponent))
return member;
}
}
return null;

Loading…
Cancel
Save