public abstract class EncodingConfiguration extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Integer> |
encodingPreferences
That's where we keep format preferences matching SDP formats to integers.
|
| Constructor and Description |
|---|
EncodingConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract int |
compareEncodingPreferences(MediaFormat enc1,
MediaFormat enc2)
Compares the two formats for order.
|
abstract MediaFormat[] |
getAllEncodings(org.jitsi.utils.MediaType type)
Returns all the available encodings for a specific MediaType.
|
MediaFormat[] |
getEnabledEncodings(org.jitsi.utils.MediaType type)
Returns the supported MediaFormats i.e.
|
protected String |
getEncodingPreferenceKey(MediaFormat encoding)
Gets the key in
encodingPreferences which is associated with the
priority of a specific MediaFormat. |
int |
getPriority(MediaFormat encoding)
Get the priority for a MediaFormat.
|
boolean |
hasEnabledFormat(org.jitsi.utils.MediaType mediaType)
Returns true if there is at least one enabled format for media
type type.
|
void |
loadEncodingConfiguration(EncodingConfiguration encodingConfiguration)
Load the preferences stored in encodingConfiguration
|
void |
loadProperties(Map<String,String> properties)
Parses a
Map and updates the format preferences
according to it. |
void |
loadProperties(Map<String,String> properties,
String prefix)
Parses a
Map and updates the format preferences
according to it. |
protected abstract void |
setEncodingPreference(String encoding,
double clockRate,
int pref)
Sets pref as the preference associated with encoding.
|
void |
setPriority(MediaFormat encoding,
int priority)
Sets priority as the preference associated with
encoding.
|
void |
storeProperties(Map<String,String> properties)
Stores the format preferences in this instance in the given Map.
|
void |
storeProperties(Map<String,String> properties,
String prefix)
Stores the format preferences in this instance in the given Map,
using prefix as a prefix to the key.
|
protected final Map<String,Integer> encodingPreferences
protected abstract void setEncodingPreference(String encoding, double clockRate, int pref)
encoding - the SDP int of the encoding whose pref we're setting.clockRate - clock ratepref - a positive int indicating the preference for that encoding.public void setPriority(MediaFormat encoding, int priority)
encoding - the MediaFormat specifying the encoding to set
the priority ofpriority - a positive int indicating the priority of
encoding to setpublic int getPriority(MediaFormat encoding)
encoding - the MediaFormatpublic abstract MediaFormat[] getAllEncodings(org.jitsi.utils.MediaType type)
type - the MediaType we would like to know the available
encodings ofpublic MediaFormat[] getEnabledEncodings(org.jitsi.utils.MediaType type)
type - the MediaType of the supported MediaFormats
to getprotected abstract int compareEncodingPreferences(MediaFormat enc1, MediaFormat enc2)
enc1 - the first format to compare for preference.enc2 - the second format to compare for preferenceprotected String getEncodingPreferenceKey(MediaFormat encoding)
encodingPreferences which is associated with the
priority of a specific MediaFormat.encoding - the MediaFormat to get the key in
encodingPreferences ofencodingPreferences which is associated with
the priority of the specified encodingpublic void storeProperties(Map<String,String> properties, String prefix)
properties - The Map where entries will be added.prefix - The prefix to use.public void storeProperties(Map<String,String> properties)
properties - The Map where entries will be added.public void loadProperties(Map<String,String> properties)
Map and updates the format preferences
according to it. Does not use a prefix.properties - The Map to parse.loadProperties(java.util.Map, String)public void loadProperties(Map<String,String> properties, String prefix)
Map and updates the format preferences
according to it. For each entry, if it's key does not begin with
prefix, its ignored. If the key begins with prefix,
look for an encoding name after the last ".", and interpret the key
value as preference.properties - The Map to parse.prefix - The prefix to use.public void loadEncodingConfiguration(EncodingConfiguration encodingConfiguration)
encodingConfiguration - the EncodingConfiguration to load
preferences from.public boolean hasEnabledFormat(org.jitsi.utils.MediaType mediaType)
mediaType - The media type, MediaType.AUDIO or MediaType.VIDEOCopyright © 2021 jitsi.org. All rights reserved.