diff options
author | Boris Grozev <boris@jitsi.org> | 2012-10-05 11:58:37 +0000 |
---|---|---|
committer | Boris Grozev <boris@jitsi.org> | 2012-10-05 11:58:37 +0000 |
commit | 19d2276dd4ff5e3458b9aafd876aa38391feeac5 (patch) | |
tree | 414285d3de7fb0495e4590a846576e1d4044be54 | |
parent | 4247259805b7abf2d575185b69bc3de46a0b7dcf (diff) | |
download | jitsi-19d2276dd4ff5e3458b9aafd876aa38391feeac5.zip jitsi-19d2276dd4ff5e3458b9aafd876aa38391feeac5.tar.gz jitsi-19d2276dd4ff5e3458b9aafd876aa38391feeac5.tar.bz2 |
Adds FEC support for the SILK codec. Minor clean-ups in EncodingConfiguration and MediaConfigurationImpl.
-rw-r--r-- | lib/installer-exclude/libjitsi.jar | bin | 986465 -> 990445 bytes | |||
-rw-r--r-- | resources/languages/resources.properties | 11 | ||||
-rw-r--r-- | src/net/java/sip/communicator/impl/neomedia/MediaConfigurationImpl.java | 13 | ||||
-rw-r--r-- | src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java | 11 | ||||
-rw-r--r-- | src/net/java/sip/communicator/plugin/generalconfig/SilkConfigForm.java | 189 |
5 files changed, 223 insertions, 1 deletions
diff --git a/lib/installer-exclude/libjitsi.jar b/lib/installer-exclude/libjitsi.jar Binary files differindex aff8795..479c46c 100644 --- a/lib/installer-exclude/libjitsi.jar +++ b/lib/installer-exclude/libjitsi.jar diff --git a/resources/languages/resources.properties b/resources/languages/resources.properties index 9eac3c1..7b89228 100644 --- a/resources/languages/resources.properties +++ b/resources/languages/resources.properties @@ -885,6 +885,17 @@ plugin.generalconfig.REMOVE_SPECIAL_PHONE_SYMBOLS=Remove special symbols before plugin.generalconfig.ACCEPT_PHONE_NUMBER_WITH_ALPHA_CHARS=Convert letters in phone numbers plugin.generalconfig.ACCEPT_PHONE_NUMBER_WITH_ALPHA_CHARS_EXAMPLE=e.g. +1-800-MYPHONE -> +1-800-694663 plugin.generalconfig.SIP_CALL_CONFIG=SIP +plugin.generalconfig.OPUS_CONFIG=Opus +plugin.generalconfig.OPUS_AUDIO_BANDWIDTH=Audio bandwidth: +plugin.generalconfig.OPUS_BITRATE=Maximun average bitrate: +plugin.generalconfig.OPUS_USE_DTX=Use DTX: +plugin.generalconfig.OPUS_USE_CBR=Use CBR: +plugin.generalconfig.OPUS_USE_FEC=Use inband FEC: +plugin.generalconfig.SILK_CONFIG=Silk +plugin.generalconfig.SILK_USE_FEC=Use inband FEC: +plugin.generalconfig.SILK_FORCE_FEC_PACKET_LOSS=Force the encoder to expect packet loss: +plugin.generalconfig.SILK_SAT=Speech activity threshold (0-1): +plugin.generalconfig.RESTORE=Restore defaults # gibberish accregwizz plugin.gibberishaccregwizz.PROTOCOL_NAME=Gibberish diff --git a/src/net/java/sip/communicator/impl/neomedia/MediaConfigurationImpl.java b/src/net/java/sip/communicator/impl/neomedia/MediaConfigurationImpl.java index 8df883b..a0f8a3f 100644 --- a/src/net/java/sip/communicator/impl/neomedia/MediaConfigurationImpl.java +++ b/src/net/java/sip/communicator/impl/neomedia/MediaConfigurationImpl.java @@ -581,6 +581,7 @@ public class MediaConfigurationImpl implements MediaConfigurationService /** * Creates all the controls (including encoding) for a type(AUDIO or VIDEO) + * * @param type the type. * @return the build Component. */ @@ -627,8 +628,12 @@ public class MediaConfigurationImpl implements MediaConfigurationService /** * Returns a component for encodings configuration for the given * <tt>mediaType</tt> + * * @param mediaType Either <tt>MediaType.AUDIO</tt> or * <tt>MediaType.VIDEO</tt> + * @param encodingConfiguration The <tt>EncodingConfiguration</tt> instance + * to use. If null, it will use the current encoding configuration from + * the media service. * @return The component for encodings configuration. */ public Component createEncodingControls( @@ -665,7 +670,12 @@ public class MediaConfigurationImpl implements MediaConfigurationService /** * Creates Component for the encodings of type(AUDIO or VIDEO). - * @param type the type + * + * @param type the type, either DeviceConfigurationComboBoxModel.AUDIO or + * DeviceConfigurationComboBoxModel.AUDIO + * @param encodingConfiguration The <tt>EncodingConfiguration</tt> instance + * to use. If null, it will use the current encoding configuration from + * the media service. * @return the component. */ private Component createEncodingControls(int type, @@ -946,6 +956,7 @@ public class MediaConfigurationImpl implements MediaConfigurationService /** * Used to move encoding options. + * * @param table the table with encodings * @param up move direction. */ diff --git a/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java b/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java index ca7b592..2767400 100644 --- a/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java +++ b/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java @@ -145,6 +145,17 @@ public class GeneralConfigPluginActivator 52, true), properties); } + properties.put( ConfigurationForm.FORM_TYPE, + ConfigurationForm.ADVANCED_TYPE); + bundleContext.registerService( + ConfigurationForm.class.getName(), + new LazyConfigurationForm( + SilkConfigForm.class.getName(), + getClass().getClassLoader(), + null, + "plugin.generalconfig.SILK_CONFIG", + 52, true), + properties); /* * Wait for the first ProtocolProviderService to register in order to diff --git a/src/net/java/sip/communicator/plugin/generalconfig/SilkConfigForm.java b/src/net/java/sip/communicator/plugin/generalconfig/SilkConfigForm.java new file mode 100644 index 0000000..5ebac66 --- /dev/null +++ b/src/net/java/sip/communicator/plugin/generalconfig/SilkConfigForm.java @@ -0,0 +1,189 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package net.java.sip.communicator.plugin.generalconfig; + + +import net.java.sip.communicator.util.swing.*; +import org.jitsi.service.configuration.ConfigurationService; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; + + +/** + * Implements the Silk configuration panel. + * + * @author Boris Grozev + */ +public class SilkConfigForm + extends TransparentPanel +{ + /** + * The property name associated with the 'use fec' setting + */ + private static final String FEC_PROP + = "net.java.sip.communicator.impl.neomedia.codec.audio.silk." + + "encoder.usefec"; + + /** + * The property name associated with the 'force packet loss' setting + */ + private static final String FEC_FORCE_PL_PROP + = "net.java.sip.communicator.impl.neomedia.codec.audio.silk." + + "encoder.forcepacketloss"; + + /** + * The property name associated with the 'speech activity threshold' setting + */ + private static final String FEC_SAT_PROP + = "net.java.sip.communicator.impl.neomedia.codec.audio.silk." + + "encoder.sat"; + + /** + * The default value for the SAT setting + */ + private static final String FEC_SAT_DEFAULT = "0.5"; + + /** + * The default value for the FEC setting + */ + private static final boolean FEC_DEFAULT = true; + + /** + * The default value for the FEC force packet loss setting + */ + private static final boolean FEC_FORCE_PL_DEFAULT = true; + + /** + * The "restore defaults" button + */ + private final JButton restoreButton = new JButton(Resources.getString( + "plugin.generalconfig.RESTORE")); + + /** + * The "use fec" checkbox + */ + private final JCheckBox fecCheckbox = new JCheckBox(); + + /** + * The "force packet loss" checkbox + */ + private final JCheckBox fecForcePLCheckbox = new JCheckBox(); + + /** + * The "speech activity threshold" field + */ + private final JTextField SATField = new JTextField(6); + + /** + * The <tt>ConfigurationService</tt> to be used to access configuration + */ + ConfigurationService configurationService + = GeneralConfigPluginActivator.getConfigurationService(); + + + /** + * Initialize a new <tt>OpusConfigForm</tt> instance. + */ + public SilkConfigForm() + { + super(new BorderLayout()); + Box box = Box.createVerticalBox(); + add(box, BorderLayout.NORTH); + + TransparentPanel contentPanel = new TransparentPanel(); + contentPanel.setLayout(new BorderLayout(10, 10)); + + box.add(contentPanel); + + TransparentPanel labelPanel + = new TransparentPanel(new GridLayout(0, 1, 2, 2)); + TransparentPanel valuePanel + = new TransparentPanel(new GridLayout(0, 1, 2, 2)); + TransparentPanel southPanel + = new TransparentPanel(new GridLayout(0, 1, 2, 2)); + + contentPanel.add(labelPanel, BorderLayout.WEST); + contentPanel.add(valuePanel, BorderLayout.CENTER); + contentPanel.add(southPanel, BorderLayout.SOUTH); + + labelPanel.add(new JLabel(Resources.getString( + "plugin.generalconfig.SILK_USE_FEC"))); + labelPanel.add(new JLabel(Resources.getString( + "plugin.generalconfig.SILK_FORCE_FEC_PACKET_LOSS"))); + labelPanel.add(new JLabel(Resources.getString( + "plugin.generalconfig.SILK_SAT"))); + + + fecCheckbox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent actionEvent) { + configurationService.setProperty(FEC_PROP, + fecCheckbox.isSelected()); + } + }); + fecCheckbox.setSelected(configurationService.getBoolean( + FEC_PROP, FEC_DEFAULT)); + valuePanel.add(fecCheckbox); + + fecForcePLCheckbox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent actionEvent) { + configurationService.setProperty(FEC_PROP, + fecForcePLCheckbox.isSelected()); + } + }); + fecForcePLCheckbox.setSelected(configurationService.getBoolean( + FEC_FORCE_PL_PROP, FEC_FORCE_PL_DEFAULT)); + valuePanel.add(fecForcePLCheckbox); + + SATField.addFocusListener(new FocusListener() { + @Override + public void focusGained(FocusEvent focusEvent){} + + @Override + public void focusLost(FocusEvent focusEvent) + { + configurationService.setProperty(FEC_SAT_PROP, + SATField.getText()); + } + }); + SATField.setText(configurationService.getString( + FEC_SAT_PROP, FEC_SAT_DEFAULT)); + valuePanel.add(SATField); + + + southPanel.add(restoreButton); + restoreButton.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e) + { + restoreDefaults(); + } + }); + + } + + /** + * Restores the UI components and the configuration to their default state + */ + private void restoreDefaults() + { + fecCheckbox.setSelected(FEC_DEFAULT); + configurationService.setProperty(FEC_PROP, FEC_DEFAULT); + + fecForcePLCheckbox.setSelected(FEC_FORCE_PL_DEFAULT); + configurationService.setProperty( + FEC_FORCE_PL_PROP, FEC_FORCE_PL_DEFAULT); + + SATField.setText(FEC_SAT_DEFAULT); + configurationService.setProperty(FEC_SAT_PROP, FEC_SAT_DEFAULT); + } +}
\ No newline at end of file |