The attached patch (against r9809) adds support for configuring audio and video
encodings for individual (Jabber and SIP) accounts. The motivation for this
feature is that sometimes we want to disable a specific codec for a specific
account, or we want to make the SDP list of formats shorter (again for a
specific account only).
About the user interface:
An "Encodings" panel is added to the Jabber and SIP account registration
wizards. It contains two tables like the ones under the main "Audio" and
"Video" configuration. If the wizard is finished, the preferences in those
tables are written to the account properties. On account creation, or when
modifying an account without such properties set, the tables are populated with
the "global" preferences. There is a "Reset" button that does the same.
There is an "override encodings" checkbox, that specifies whether these local
preferences should be used instead of the "global" ones. At the moment the
tables are active even when the checkbox is unchecked, but maybe it would be
better to make them inactive. What do you think?
Even if the checkbox is not set, the preferences in the tables are saved/loaded
(this allows to quickly turn on/off the option without losing the preferences).
When a call is made or accepted, the "override encodings" setting is checked
for the account. If it's set, the account settings are used. If it's not set,
the "global" settings are used.
I encountered a bug in the current encodings configuration, which is somewhat
more exposed with this patch. When one of the disabled formats is re-enabled,
its place in the table does not change (but it's priority does). Once Jitsi is
restarted it is moved to a new spot in the table. The same now happens
in the account configuration, except it does not require a restart of Jitsi,
only finishing the wizard. I don't know how to fix this at the moment, but
I intend to work on it next.
I understand you might be reluctant to commit this, since it changes alot of
things, and in the least requires a careful overview by someone familiar with
the code. I'll be happy to answer any questions and make necessarry updates.
Here are some explanations about the changes:
Changes to libjitsi:
Split the EncodingConfiguration class into
impl.neomedia.codec.EncodingConfigurationImpl. The one in service
maintains a list of available MediaFormat's and their priorities. The
implementation takes care of registering codecs and packages with JMF and
initializing the default format preferences. It also knows how to load the
"global" configuration (be reading the properties under
There's an important semantic change: the EncodingConfigurationImpl constructor
does *not* load any configuration, it only sets the default values. This means
that the instance that the MediaService maintains now contains all available
formats, and not only the ones enabled in the "global" configuration as it
previously did. The MediaService now provides a getNewEncodingConfiguration()
method that returns a new instance.
Because of that change MediaDevice#getSupportedFormats() now returns all
supported formats (including those disabled in configuration). The
getSupportedFormats(QualityPreset, QualityPreset, EncodingConfiguration) method
allows a custom configuration to be used.
Changes to trunk:
The two lines changed in AccountManager allow for properties with a
"." in them to
be stored for an account (e.g.
The net.java.sip.communicator.util.plugin.wizard package was added to contain
utility classes shared between plugins, and the SecurityPanel and
SecurityAccountRegistration classes were moved there, since they are used in
both Jabber and SIP account registration wizards.
In service.protocol.media.CallPeerMediaHandler, a
getLocallySupportedFormats(MediaDevice) method was added. It is a wrapper
around MediaDevice.getSupportedFormats, that takes into account the encodings
configured for the account in use. Implementations were updated to use it
instead of directly calling MediaDevice.getSupportedFormats() (that now returns
all supported formats due to the changes explained above).
encodings-libjitsi.patch (73 KB)
encodings-trunk.patch (169 KB)