fm.liveswitch.FormatInfo Class Reference

Format information. More...

Public Member Functions

 FormatInfo ()
 Creates a new instance of a FormatInfo. More...
 
 FormatInfo (fm.liveswitch.AudioFormat audioFormat)
 Creates an instance of a FormatInfo from an AudioFormat. More...
 
 FormatInfo (String codecName, int clockRate)
 Creates a new instance of a FormatInfo. More...
 
 FormatInfo (String name, int clockRate, int channelCount)
 Creates a new instance of a FormatInfo. More...
 
 FormatInfo (fm.liveswitch.VideoFormat videoFormat)
 Creates an instance of a FormatInfo from a VideoFormat. More...
 
int getChannelCount ()
 Gets the channel count if available. More...
 
int getClockRate ()
 Gets the clock rate. More...
 
String getCodecName ()
 Gets the name. More...
 
String getName ()
 Gets the name. More...
 
boolean isEquivalent (fm.liveswitch.FormatInfo instance)
 Checks if an instance is equivalent to this one. More...
 
boolean isEquivalent (String name, int clockRate, int channelCount)
 Tests for equivalency. More...
 
void setChannelCount (int value)
 Sets the channel count if available. More...
 
void setClockRate (int value)
 Sets the clock rate. More...
 
void setCodecName (String value)
 Sets the name. More...
 
void setName (String value)
 Sets the name. More...
 
String toJson ()
 Serializes this instance to Json. More...
 
String toString ()
 Returns a string that represents this instance. More...
 
- Public Member Functions inherited from fm.liveswitch.IEquivalent< fm.liveswitch.FormatInfo >
abstract boolean isEquivalent (T instance)
 Checks if an instance is equivalent to this one. More...
 

Static Public Member Functions

static fm.liveswitch.FormatInfo fromJson (String formatInfoJson)
 Deserializes Json to a FormatInfo. More...
 
static fm.liveswitch.FormatInfo[] fromJsonArray (String formatInfosJson)
 Derializes an array of format infos from JSON. More...
 
static fm.liveswitch.FormatInfo[] fromSdpMediaDescription (fm.liveswitch.sdp.MediaDescription sdpMediaDescription)
 Converts the RTP map attributes in an SDP media description to an array of FormatInfo objects. More...
 
static String toJson (fm.liveswitch.FormatInfo formatInfo)
 Serializes an instance to Json. More...
 
static String toJsonArray (fm.liveswitch.FormatInfo[] formatInfos)
 Serializes an array of format infos to JSON. More...
 

Detailed Description

Format information.

Constructor & Destructor Documentation

◆ FormatInfo() [1/5]

fm.liveswitch.FormatInfo.FormatInfo ( )

Creates a new instance of a FormatInfo.

◆ FormatInfo() [2/5]

fm.liveswitch.FormatInfo.FormatInfo ( fm.liveswitch.AudioFormat  audioFormat)

Creates an instance of a FormatInfo from an AudioFormat.

Parameters
audioFormatThe audio format.

◆ FormatInfo() [3/5]

fm.liveswitch.FormatInfo.FormatInfo ( String  codecName,
int  clockRate 
)

Creates a new instance of a FormatInfo.

Parameters
codecNameThe codec name.
clockRateThe clock rate.

◆ FormatInfo() [4/5]

fm.liveswitch.FormatInfo.FormatInfo ( String  name,
int  clockRate,
int  channelCount 
)

Creates a new instance of a FormatInfo.

Parameters
nameThe name.
clockRateThe clock rate.
channelCountThe channel count.

◆ FormatInfo() [5/5]

fm.liveswitch.FormatInfo.FormatInfo ( fm.liveswitch.VideoFormat  videoFormat)

Creates an instance of a FormatInfo from a VideoFormat.

Parameters
videoFormatThe video format.

Member Function Documentation

◆ fromJson()

static fm.liveswitch.FormatInfo fm.liveswitch.FormatInfo.fromJson ( String  formatInfoJson)
static

Deserializes Json to a FormatInfo.

Parameters
formatInfoJsonThe serialized Json.
Returns
The deserialized FormatInfo.

◆ fromJsonArray()

static fm.liveswitch.FormatInfo [] fm.liveswitch.FormatInfo.fromJsonArray ( String  formatInfosJson)
static

Derializes an array of format infos from JSON.

Parameters
formatInfosJsonThe format infos in JSON format.

◆ fromSdpMediaDescription()

static fm.liveswitch.FormatInfo [] fm.liveswitch.FormatInfo.fromSdpMediaDescription ( fm.liveswitch.sdp.MediaDescription  sdpMediaDescription)
static

Converts the RTP map attributes in an SDP media description to an array of FormatInfo objects.

Parameters
sdpMediaDescriptionThe SDP media description.
Returns
An array of FormatInfo objects.

◆ getChannelCount()

int fm.liveswitch.FormatInfo.getChannelCount ( )

Gets the channel count if available.

Unused for video codecs.

◆ getClockRate()

int fm.liveswitch.FormatInfo.getClockRate ( )

Gets the clock rate.

◆ getCodecName()

String fm.liveswitch.FormatInfo.getCodecName ( )

Gets the name.

Deprecated:
Use Name instead.

◆ getName()

String fm.liveswitch.FormatInfo.getName ( )

Gets the name.

◆ isEquivalent() [1/2]

boolean fm.liveswitch.FormatInfo.isEquivalent ( fm.liveswitch.FormatInfo  instance)

Checks if an instance is equivalent to this one.

Parameters
instanceThe instance.

◆ isEquivalent() [2/2]

boolean fm.liveswitch.FormatInfo.isEquivalent ( String  name,
int  clockRate,
int  channelCount 
)

Tests for equivalency.

Parameters
channelCountThe channel count.
clockRateThe clock rate.
nameThe format name.
Returns
true
if equivalent; otherwise,
false
.

◆ setChannelCount()

void fm.liveswitch.FormatInfo.setChannelCount ( int  value)

Sets the channel count if available.

Unused for video codecs.

◆ setClockRate()

void fm.liveswitch.FormatInfo.setClockRate ( int  value)

Sets the clock rate.

◆ setCodecName()

void fm.liveswitch.FormatInfo.setCodecName ( String  value)

Sets the name.

Deprecated:
Use Name instead.

◆ setName()

void fm.liveswitch.FormatInfo.setName ( String  value)

Sets the name.

◆ toJson() [1/2]

String fm.liveswitch.FormatInfo.toJson ( )

Serializes this instance to Json.

◆ toJson() [2/2]

static String fm.liveswitch.FormatInfo.toJson ( fm.liveswitch.FormatInfo  formatInfo)
static

Serializes an instance to Json.

Parameters
formatInfoThe instance to serialize.
Returns
Serialized Json.

◆ toJsonArray()

static String fm.liveswitch.FormatInfo.toJsonArray ( fm.liveswitch.FormatInfo[]  formatInfos)
static

Serializes an array of format infos to JSON.

Parameters
formatInfosThe format infos.

◆ toString()

String fm.liveswitch.FormatInfo.toString ( )

Returns a string that represents this instance.