public abstract class EncodingConfiguration
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.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(MediaType type)
Returns all the available encodings for a specific MediaType.
|
MediaFormat[] |
getEnabledEncodings(MediaType type)
Returns the supported MediaFormats i.e.
|
protected java.lang.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(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(java.util.Map<java.lang.String,java.lang.String> properties)
Parses a Map
|
void |
loadProperties(java.util.Map<java.lang.String,java.lang.String> properties,
java.lang.String prefix)
Parses a Map
|
protected abstract void |
setEncodingPreference(java.lang.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(java.util.Map<java.lang.String,java.lang.String> properties)
Stores the format preferences in this instance in the given Map.
|
void |
storeProperties(java.util.Map<java.lang.String,java.lang.String> properties,
java.lang.String prefix)
Stores the format preferences in this instance in the given Map,
using prefix as a prefix to the key.
|
protected final java.util.Map<java.lang.String,java.lang.Integer> encodingPreferences
protected abstract void setEncodingPreference(java.lang.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(MediaType type)
type
- the MediaType we would like to know the available
encodings ofpublic MediaFormat[] getEnabledEncodings(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 java.lang.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(java.util.Map<java.lang.String,java.lang.String> properties, java.lang.String prefix)
properties
- The Map where entries will be added.prefix
- The prefix to use.public void storeProperties(java.util.Map<java.lang.String,java.lang.String> properties)
properties
- The Map where entries will be added.public void loadProperties(java.util.Map<java.lang.String,java.lang.String> properties)
properties
- The Map to parse.loadProperties(java.util.Map, String)
public void loadProperties(java.util.Map<java.lang.String,java.lang.String> properties, java.lang.String prefix)
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(MediaType mediaType)
mediaType
- The media type, MediaType.AUDIO or MediaType.VIDEO
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.