Allow changing remote video quality.

cusax-fix
Yana Stamcheva 15 years ago
parent 926eb21784
commit d825ea02a4

@ -89,7 +89,7 @@ service.gui.CHANGE_NICKNAME=Change nickname...
service.gui.CHANGE_NICKNAME_LABEL=In the field below, you can enter your new nickname.
service.gui.CHANGE_ROOM_SUBJECT=Change room's subject...
service.gui.CHANGE_ROOM_SUBJECT_LABEL=In the field below, you can enter the new subject for this room.
service.gui.CHANGE_VIDEO_QUALITY=Change video quality
service.gui.CHANGE_VIDEO_QUALITY=Change remote video quality
service.gui.CHAT_ROOM_ALREADY_JOINED=The {0} chat room is already joined.
service.gui.CHAT_ROOM_CONFIGURATION={0} chat room configuration
service.gui.CHAT_ROOM_CONFIGURATION_FAILED=Failed to obtain the {0} chat room configuration form.
@ -220,7 +220,7 @@ service.gui.GRANT_MEMBERSHIP=Grant membership
service.gui.GRANT_VOICE=Grant voice
service.gui.GUEST=visitor
service.gui.HANG_UP=Hang up
service.gui.HD_QUALITY=HD video (720p)
service.gui.HD_QUALITY=HD video
service.gui.HELP=&Help
service.gui.HIDE=Hide
service.gui.HIDE_OFFLINE_CONTACTS=Hide offline contacts
@ -273,7 +273,7 @@ service.gui.LOGIN_GENERAL_ERROR=An error occurred while logging in with account:
service.gui.LOGIN_INTERNAL_ERROR=An error occurred while logging in with account: User name: {0}, Server name: {1}. This is most probably an internal application error. Please report the problem to our developers mailing list (dev@jitsi.java.net).
service.gui.LOGIN_INVALID_PROPERTIES_ERROR=Unable to log in with account: User name: {0}, Server name: {1}, due to an account configuration problem. Please check your account configuration.
service.gui.LOGOFF_NOT_SUCCEEDED=An error occurred while logging off with the following account: User name: {0}, Server name: {1}.
service.gui.LOW_QUALITY=Low quality (175p)
service.gui.LOW_QUALITY=Low quality
service.gui.MEMBER=member
service.gui.MESSAGE=Message:
service.gui.MISSED_CALLS_TOOL_TIP=Missed calls from:
@ -318,7 +318,7 @@ service.gui.NO_GROUP_CHAT_ACCOUNT_AVAILABLE=No accounts, supporting multi user c
service.gui.NO_ONLINE_TELEPHONY_ACCOUNT=At least one online telephony account is needed in order to make a call. Please login to one of your telephony accounts and try again.
service.gui.NON_EMPTY_CHAT_WINDOW_CLOSE=You're trying to close a chat with a non-sent message. Are you sure you want to close this chat?
service.gui.NON_EXISTING_USER_ID=The {0} server does not recognize specified user id.
service.gui.SD_QUALITY=Standard quality (480p)
service.gui.SD_QUALITY=Standard quality
service.gui.OFFLINE=Offline
service.gui.OK=&OK
service.gui.OLDER_CALLS=Older calls
@ -434,6 +434,7 @@ service.gui.TRANSFER_CALL_TITLE=Transfer Call
service.gui.TRANSFER_CALL_TO=Transfer to:
service.gui.TRANSPARENCY_NOT_ENABLED=Transparency is not supported by your current configuration.
service.gui.TYPE_YOUR_REQUEST=Type your request here
service.gui.UNABLE_TO_CHANGE_VIDEO_QUALITY=We were not able to change video quality for this call.
service.gui.UNMUTE=Unmute
service.gui.USER_IDENTIFIER=User identifier:
service.gui.USER_EXISTS_ERROR=This user already exists on the selected network. Please choose another user or network.

@ -895,6 +895,50 @@ public void callStateChanged(CallChangeEvent evt)
}
}
/**
* Sets the given quality preset for the video of the given call peer.
*
* @param callPeer the peer, which video quality we're setting
* @param qualityPreset the new quality settings
*/
public static void setVideoQualityPreset(final CallPeer callPeer,
final QualityPreset qualityPreset)
{
ProtocolProviderService provider = callPeer.getProtocolProvider();
final OperationSetVideoTelephony videoOpSet
= (OperationSetVideoTelephony) provider
.getOperationSet(OperationSetVideoTelephony.class);
if (videoOpSet != null)
{
new Thread(new Runnable()
{
public void run()
{
try
{
videoOpSet.setQualityPreset(
callPeer, qualityPreset);
}
catch(OperationFailedException e)
{
logger.info("Unable to change video quality.", e);
new ErrorDialog(
null,
GuiActivator.getResources()
.getI18NString("service.gui.WARNING"),
GuiActivator.getResources().getI18NString(
"service.gui.UNABLE_TO_CHANGE_VIDEO_QUALITY"),
e)
.showDialog();
}
}
}).start();
}
}
/**
* Adds a missed call notification.
*

@ -296,11 +296,11 @@ public void stateChanged(ChangeEvent e)
else
settingsPanel.remove(showHideVideoButton);
settingsPanel.revalidate();
settingsPanel.repaint();
showHideVideoButton.setEnabled(isVideoSelected);
showHideVideoButton.setSelected(isVideoSelected);
settingsPanel.revalidate();
settingsPanel.repaint();
}
});
@ -354,7 +354,6 @@ public void stateChanged(ChangeEvent e)
desktopSharingButton.setEnabled(false);
videoButton.setEnabled(false);
showHideVideoButton.setEnabled(false);
resizeVideoButton.setEnabled(false);
fullScreenButton.setEnabled(false);
addOneToOneSpecificComponents();
@ -1038,6 +1037,27 @@ public CallRenderer getCurrentCallRenderer()
return (CallRenderer) callPanel;
}
/**
* Adds remote video specific components.
*/
public void addRemoteVideoSpecificComponents()
{
settingsPanel.add(resizeVideoButton,
GuiUtils.getComponentIndex(showHideVideoButton, settingsPanel) + 1);
settingsPanel.revalidate();
settingsPanel.repaint();
}
/**
* Adds remote video specific components.
*/
public void removeRemoteVideoSpecificComponents()
{
settingsPanel.remove(resizeVideoButton);
settingsPanel.revalidate();
settingsPanel.repaint();
}
/**
* Replaces the current call panel with the given one.
* @param callPanel the <tt>JComponent</tt> to replace the current

@ -972,6 +972,14 @@ else if (isAncestor(videoContainer, visualComponent))
videoParent.remove(video);
videoContainer.add(video, VideoLayout.CENTER_REMOTE, 0);
callRenderer.getCallContainer()
.addRemoteVideoSpecificComponents();
}
else
{
callRenderer.getCallContainer()
.removeRemoteVideoSpecificComponents();
}
// LOCAL

@ -13,6 +13,7 @@
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.neomedia.QualityPreset;
import net.java.sip.communicator.service.protocol.*;
/**
@ -94,17 +95,26 @@ private JPopupMenu createResizeVideoMenu()
JMenuItem lowQuality = new JMenuItem(
GuiActivator.getResources()
.getI18NString("service.gui.LOW_QUALITY"),
.getI18NString("service.gui.LOW_QUALITY")
+ " ("
+ (int) QualityPreset.LO_QUALITY.getResolution().getHeight()
+ "p)",
GuiActivator.getResources()
.getImage("service.gui.icons.LO_VIDEO_ICON"));
JMenuItem normalQuality = new JMenuItem(GuiActivator.getResources()
.getI18NString("service.gui.SD_QUALITY"),
.getI18NString("service.gui.SD_QUALITY")
+ " ("
+ (int) QualityPreset.SD_QUALITY.getResolution().getHeight()
+ "p)",
GuiActivator.getResources()
.getImage("service.gui.icons.SD_VIDEO_ICON"));
JMenuItem hdQuality = new JMenuItem(GuiActivator.getResources()
.getI18NString("service.gui.HD_QUALITY"),
.getI18NString("service.gui.HD_QUALITY")
+ " ("
+ (int) QualityPreset.HD_QUALITY.getResolution().getHeight()
+ "p)",
GuiActivator.getResources()
.getImage("service.gui.icons.HD_VIDEO_ICON"));
@ -127,7 +137,10 @@ public void actionPerformed(ActionEvent e)
popupMenu.setVisible(false);
setIconImageID(ImageLoader.LO_VIDEO_BUTTON);
// TODO: set low quality.
CallManager.setVideoQualityPreset(
call.getCallPeers().next(),
QualityPreset.LO_QUALITY);
}
});
@ -138,7 +151,9 @@ public void actionPerformed(ActionEvent e)
popupMenu.setVisible(false);
setIconImageID(ImageLoader.SD_VIDEO_BUTTON);
// TODO: set normal quality.
CallManager.setVideoQualityPreset(
call.getCallPeers().next(), QualityPreset.SD_QUALITY);
}
});
@ -149,7 +164,9 @@ public void actionPerformed(ActionEvent e)
popupMenu.setVisible(false);
setIconImageID(ImageLoader.HD_VIDEO_BUTTON);
// TODO: set hd quality.
CallManager.setVideoQualityPreset(
call.getCallPeers().next(), QualityPreset.HD_QUALITY);
}
});

Loading…
Cancel
Save