fm.liveswitch.VideoFormat Class Reference

A video format. More...

Public Member Functions

fm.liveswitch.VideoFormat clone ()
 Clones this instance. More...
 
String fourCCToFormatName (int fourcc)
 Converts a FourCC value to its format name. More...
 
int getFourCC ()
 Gets the FourCC value for this format. More...
 
fm.liveswitch.FormatInfo getInfo ()
 Gets this format as an info object. More...
 
boolean getIsAbgr ()
 Gets a value indicating whether this format is ABGR. More...
 
boolean getIsArgb ()
 Gets a value indicating whether this format is ARGB. More...
 
boolean getIsBgr ()
 Gets a value indicating whether this format is BGR. More...
 
boolean getIsBgra ()
 Gets a value indicating whether this format is BGRA. More...
 
boolean getIsCompressed ()
 Gets whether this is a compressed format. More...
 
boolean getIsH264 ()
 Gets a value indicating whether this format is H.264. More...
 
boolean getIsH265 ()
 Gets a value indicating whether this format is H.265. More...
 
boolean getIsI420 ()
 Gets a value indicating whether this format is I420. More...
 
boolean getIsNv12 ()
 Gets a value indicating whether this format is NV12. More...
 
boolean getIsNv21 ()
 Gets a value indicating whether this format is NV21. More...
 
boolean getIsRaw ()
 Gets a value indicating whether this format is RGB, BGR, I420, YV12, NV12, NV21, RGBA, BGRA, ARGB, or ABGR. More...
 
boolean getIsRgb ()
 Gets a value indicating whether this format is RGB. More...
 
boolean getIsRgba ()
 Gets a value indicating whether this format is RGBA. More...
 
boolean getIsRgbaType ()
 Gets a value indicating whether this format is RGBA, BGRA, ARGB, or ABGR. More...
 
boolean getIsRgbType ()
 Gets a value indicating whether this format is RGB or BGR. More...
 
boolean getIsVp8 ()
 Gets a value indicating whether this format is VP8. More...
 
boolean getIsVp9 ()
 Gets a value indicating whether this format is VP9. More...
 
boolean getIsYuvType ()
 Gets a value indicating whether this format is I420, YV12, NV12, or NV21. More...
 
boolean getIsYv12 ()
 Gets a value indicating whether this format is YV12. More...
 
String getParameters ()
 Gets the parameters. More...
 
void setFourCC (int value)
 Sets the FourCC value for this format. More...
 
String toJson ()
 Serializes this instance to JSON. More...
 
 VideoFormat (String name)
 Initializes a new instance of the fm.liveswitch.VideoFormat class. More...
 
 VideoFormat (String name, int clockRate)
 Initializes a new instance of the fm.liveswitch.VideoFormat class. More...
 
 VideoFormat (String name, int clockRate, String packetizationMode)
 Initializes a new instance of the fm.liveswitch.VideoFormat class. More...
 
 VideoFormat (String name, int clockRate, String profile, String level)
 Initializes a new instance of the fm.liveswitch.VideoFormat class. More...
 
 VideoFormat (String name, int clockRate, String profile, String level, String packetizationMode)
 Initializes a new instance of the fm.liveswitch.VideoFormat class. More...
 
 VideoFormat (String name, int clockRate, String profile, String level, String packetizationMode, String tier)
 Initializes a new instance of the fm.liveswitch.VideoFormat class. More...
 

Static Public Member Functions

static int formatNameToFourCC (String formatName)
 Converts a format name to its FourCC value. More...
 
static fm.liveswitch.VideoFormat fromFormatInfo (fm.liveswitch.FormatInfo info)
 Transforms a FormatInfo into an VideoFormat. More...
 
static fm.liveswitch.VideoFormat fromJson (String videoFormatJson)
 Deserializes an instance from JSON. More...
 
static fm.liveswitch.VideoFormat getAbgr ()
 Gets an ABGR video format. More...
 
static String getAbgrName ()
 Gets the name of the ABGR video format ("ABGR"). More...
 
static fm.liveswitch.VideoFormat getArgb ()
 Gets an ARGB video format. More...
 
static String getArgbName ()
 Gets the name of the ARGB video format ("ARGB"). More...
 
static fm.liveswitch.VideoFormat getBgr ()
 Gets a BGR video format. More...
 
static fm.liveswitch.VideoFormat getBgra ()
 Gets an BGRA video format. More...
 
static String getBgraName ()
 Gets the name of the BGRA video format ("BGRA"). More...
 
static String getBgrName ()
 Gets the name of the BGR video format ("BGR"). More...
 
static int getDefaultClockRate ()
 Gets the default clock rate. More...
 
static fm.liveswitch.VideoFormat getH264 ()
 Gets an H.264 video format. More...
 
static String getH264Name ()
 Gets the name of the H.264 video format ("H264"). More...
 
static fm.liveswitch.VideoFormat getH265 ()
 Gets an H.265 video format. More...
 
static String getH265Name ()
 Gets the name of the H.265 video format ("H265"). More...
 
static fm.liveswitch.VideoFormat getI420 ()
 Gets an I420 video format. More...
 
static String getI420Name ()
 Gets the name of the I420 video format ("I420"). More...
 
static fm.liveswitch.VideoFormat getNv12 ()
 Gets an NV12 video format. More...
 
static String getNv12Name ()
 Gets the name of the NV12 video format ("NV12"). More...
 
static fm.liveswitch.VideoFormat getNv21 ()
 Gets an NV21 video format. More...
 
static String getNv21Name ()
 Gets the name of the NV21 video format ("NV21"). More...
 
static fm.liveswitch.VideoFormat getRgb ()
 Gets an RGB video format. More...
 
static fm.liveswitch.VideoFormat getRgba ()
 Gets an RGBA video format. More...
 
static String getRgbaName ()
 Gets the name of the RGBA video format ("RGBA"). More...
 
static String getRgbName ()
 Gets the name of the RGB video format ("RGB"). More...
 
static fm.liveswitch.VideoFormat getVp8 ()
 Gets a VP8 video format. More...
 
static String getVp8Name ()
 Gets the name of the VP8 video format ("VP8"). More...
 
static fm.liveswitch.VideoFormat getVp9 ()
 Gets a VP9 video format. More...
 
static String getVp9Name ()
 Gets the name of the VP9 video format ("VP9"). More...
 
static fm.liveswitch.VideoFormat getYv12 ()
 Gets a YV12 video format. More...
 
static String getYv12Name ()
 Gets the name of the YV12 video format ("YV12"). More...
 
static int toFourCC (char a, char b, char c, char d)
 Converts 4 FourCC characters to an int. More...
 
static int toFourCC (String fourcc)
 Converts a FourCC string to a int. More...
 
static String toJson (final fm.liveswitch.VideoFormat videoFormat)
 Serializes an instance to JSON. More...
 

Protected Member Functions

fm.liveswitch.VideoFormat createInstance ()
 Creates a new instance. More...
 
String getMaxLevel (String level1, String level2)
 Gets the maximum level. More...
 
String getMinLevel (String level1, String level2)
 Gets the minimum level. More...
 
boolean isLevelCompatible (String level)
 Gets whether a level is compatible. More...
 
boolean isProfileCompatible (String profile)
 Gets whether a profile is compatible. More...
 
void updateProfileToCompatible (fm.liveswitch.VideoFormat format)
 Updates the profile to a compatible value. More...
 
 VideoFormat ()
 Initializes a new instance of the fm.liveswitch.VideoFormat class. More...
 

Detailed Description

A video format.

Constructor & Destructor Documentation

◆ VideoFormat() [1/7]

fm.liveswitch.VideoFormat.VideoFormat ( )
protected

Initializes a new instance of the fm.liveswitch.VideoFormat class.

◆ VideoFormat() [2/7]

fm.liveswitch.VideoFormat.VideoFormat ( String  name)

Initializes a new instance of the fm.liveswitch.VideoFormat class.

Parameters
nameThe name.

◆ VideoFormat() [3/7]

fm.liveswitch.VideoFormat.VideoFormat ( String  name,
int  clockRate 
)

Initializes a new instance of the fm.liveswitch.VideoFormat class.

Parameters
nameThe name.
clockRateThe clock rate.

◆ VideoFormat() [4/7]

fm.liveswitch.VideoFormat.VideoFormat ( String  name,
int  clockRate,
String  packetizationMode 
)

Initializes a new instance of the fm.liveswitch.VideoFormat class.

Parameters
nameThe name.
clockRateThe clock rate.
packetizationModeThe packetization mode.

◆ VideoFormat() [5/7]

fm.liveswitch.VideoFormat.VideoFormat ( String  name,
int  clockRate,
String  profile,
String  level 
)

Initializes a new instance of the fm.liveswitch.VideoFormat class.

Parameters
nameThe name.
clockRateThe clock rate.
profileThe media format profile.
levelThe media format level.

◆ VideoFormat() [6/7]

fm.liveswitch.VideoFormat.VideoFormat ( String  name,
int  clockRate,
String  profile,
String  level,
String  packetizationMode 
)

Initializes a new instance of the fm.liveswitch.VideoFormat class.

Parameters
nameThe name.
clockRateThe clock rate.
packetizationModeThe packetization mode.
levelThe media format level.
profileThe media format profile.

◆ VideoFormat() [7/7]

fm.liveswitch.VideoFormat.VideoFormat ( String  name,
int  clockRate,
String  profile,
String  level,
String  packetizationMode,
String  tier 
)

Initializes a new instance of the fm.liveswitch.VideoFormat class.

Parameters
nameThe name.
clockRateThe clock rate.
packetizationModeThe packetization mode.
levelThe media format level.
profileThe media format profile.
tierThe media format tier.

Member Function Documentation

◆ clone()

fm.liveswitch.VideoFormat fm.liveswitch.VideoFormat.clone ( )

Clones this instance.

◆ createInstance()

fm.liveswitch.VideoFormat fm.liveswitch.VideoFormat.createInstance ( )
protected

Creates a new instance.

Reimplemented in fm.liveswitch.vp9.Format, fm.liveswitch.vp8.Format, and fm.liveswitch.h264.Format.

◆ formatNameToFourCC()

static int fm.liveswitch.VideoFormat.formatNameToFourCC ( String  formatName)
static

Converts a format name to its FourCC value.

Parameters
formatNameThe format name.
Returns
The FourCC value, or 0 if the format name is not recognized.

◆ fourCCToFormatName()

String fm.liveswitch.VideoFormat.fourCCToFormatName ( int  fourcc)

Converts a FourCC value to its format name.

Parameters
fourccThe FourCC value.
Returns
The format name, or an empty string if the FourCC value is not recognized.

◆ fromFormatInfo()

static fm.liveswitch.VideoFormat fm.liveswitch.VideoFormat.fromFormatInfo ( fm.liveswitch.FormatInfo  info)
static

Transforms a FormatInfo into an VideoFormat.

Parameters
infoThe format info.

◆ fromJson()

static fm.liveswitch.VideoFormat fm.liveswitch.VideoFormat.fromJson ( String  videoFormatJson)
static

Deserializes an instance from JSON.

Parameters
videoFormatJsonThe video format JSON.

◆ getAbgr()

static fm.liveswitch.VideoFormat fm.liveswitch.VideoFormat.getAbgr ( )
static

Gets an ABGR video format.

◆ getAbgrName()

static String fm.liveswitch.VideoFormat.getAbgrName ( )
static

Gets the name of the ABGR video format ("ABGR").

Indicates that each pixel occupies 32 bits (8 bits for alpha, then 8 bits for blue, then8 bits for green, then 8 bits for red).

◆ getArgb()

static fm.liveswitch.VideoFormat fm.liveswitch.VideoFormat.getArgb ( )
static

Gets an ARGB video format.

◆ getArgbName()

static String fm.liveswitch.VideoFormat.getArgbName ( )
static

Gets the name of the ARGB video format ("ARGB").

Indicates that each pixel occupies 32 bits (8 bits for alpha, then 8 bits for red, then 8 bits for green, then 8 bits for blue).

◆ getBgr()

static fm.liveswitch.VideoFormat fm.liveswitch.VideoFormat.getBgr ( )
static

Gets a BGR video format.

◆ getBgra()

static fm.liveswitch.VideoFormat fm.liveswitch.VideoFormat.getBgra ( )
static

Gets an BGRA video format.

◆ getBgraName()

static String fm.liveswitch.VideoFormat.getBgraName ( )
static

Gets the name of the BGRA video format ("BGRA").

Indicates that each pixel occupies 32 bits (8 bits for blue, then8 bits for green, then 8 bits for red, then 8 bits for alpha).

◆ getBgrName()

static String fm.liveswitch.VideoFormat.getBgrName ( )
static

Gets the name of the BGR video format ("BGR").

Indicates that each pixel occupies 24 bits (8 bits for blue, then8 bits for green, then 8 bits for red).

◆ getDefaultClockRate()

static int fm.liveswitch.VideoFormat.getDefaultClockRate ( )
static

Gets the default clock rate.

◆ getFourCC()

int fm.liveswitch.VideoFormat.getFourCC ( )

Gets the FourCC value for this format.

◆ getH264()

static fm.liveswitch.VideoFormat fm.liveswitch.VideoFormat.getH264 ( )
static

Gets an H.264 video format.

◆ getH264Name()

static String fm.liveswitch.VideoFormat.getH264Name ( )
static

Gets the name of the H.264 video format ("H264").

◆ getH265()

static fm.liveswitch.VideoFormat fm.liveswitch.VideoFormat.getH265 ( )
static

Gets an H.265 video format.

◆ getH265Name()

static String fm.liveswitch.VideoFormat.getH265Name ( )
static

Gets the name of the H.265 video format ("H265").

◆ getI420()

static fm.liveswitch.VideoFormat fm.liveswitch.VideoFormat.getI420 ( )
static

Gets an I420 video format.

◆ getI420Name()

static String fm.liveswitch.VideoFormat.getI420Name ( )
static

Gets the name of the I420 video format ("I420").

Indicates that each pixel occupies 12 bits (8 bits for Y, 2 bits for U, and 2 bits for V). Y plane is followed by U plane and then V plane.

◆ getInfo()

fm.liveswitch.FormatInfo fm.liveswitch.VideoFormat.getInfo ( )

Gets this format as an info object.

◆ getIsAbgr()

boolean fm.liveswitch.VideoFormat.getIsAbgr ( )

Gets a value indicating whether this format is ABGR.

◆ getIsArgb()

boolean fm.liveswitch.VideoFormat.getIsArgb ( )

Gets a value indicating whether this format is ARGB.

◆ getIsBgr()

boolean fm.liveswitch.VideoFormat.getIsBgr ( )

Gets a value indicating whether this format is BGR.

◆ getIsBgra()

boolean fm.liveswitch.VideoFormat.getIsBgra ( )

Gets a value indicating whether this format is BGRA.

◆ getIsCompressed()

boolean fm.liveswitch.VideoFormat.getIsCompressed ( )

Gets whether this is a compressed format.

◆ getIsH264()

boolean fm.liveswitch.VideoFormat.getIsH264 ( )

Gets a value indicating whether this format is H.264.

◆ getIsH265()

boolean fm.liveswitch.VideoFormat.getIsH265 ( )

Gets a value indicating whether this format is H.265.

◆ getIsI420()

boolean fm.liveswitch.VideoFormat.getIsI420 ( )

Gets a value indicating whether this format is I420.

◆ getIsNv12()

boolean fm.liveswitch.VideoFormat.getIsNv12 ( )

Gets a value indicating whether this format is NV12.

◆ getIsNv21()

boolean fm.liveswitch.VideoFormat.getIsNv21 ( )

Gets a value indicating whether this format is NV21.

◆ getIsRaw()

boolean fm.liveswitch.VideoFormat.getIsRaw ( )

Gets a value indicating whether this format is RGB, BGR, I420, YV12, NV12, NV21, RGBA, BGRA, ARGB, or ABGR.

◆ getIsRgb()

boolean fm.liveswitch.VideoFormat.getIsRgb ( )

Gets a value indicating whether this format is RGB.

◆ getIsRgba()

boolean fm.liveswitch.VideoFormat.getIsRgba ( )

Gets a value indicating whether this format is RGBA.

◆ getIsRgbaType()

boolean fm.liveswitch.VideoFormat.getIsRgbaType ( )

Gets a value indicating whether this format is RGBA, BGRA, ARGB, or ABGR.

◆ getIsRgbType()

boolean fm.liveswitch.VideoFormat.getIsRgbType ( )

Gets a value indicating whether this format is RGB or BGR.

◆ getIsVp8()

boolean fm.liveswitch.VideoFormat.getIsVp8 ( )

Gets a value indicating whether this format is VP8.

◆ getIsVp9()

boolean fm.liveswitch.VideoFormat.getIsVp9 ( )

Gets a value indicating whether this format is VP9.

◆ getIsYuvType()

boolean fm.liveswitch.VideoFormat.getIsYuvType ( )

Gets a value indicating whether this format is I420, YV12, NV12, or NV21.

◆ getIsYv12()

boolean fm.liveswitch.VideoFormat.getIsYv12 ( )

Gets a value indicating whether this format is YV12.

◆ getMaxLevel()

String fm.liveswitch.VideoFormat.getMaxLevel ( String  level1,
String  level2 
)
protected

Gets the maximum level.

Parameters
level1The first level.
level2The second level.
Returns
The maximum level.

◆ getMinLevel()

String fm.liveswitch.VideoFormat.getMinLevel ( String  level1,
String  level2 
)
protected

Gets the minimum level.

Parameters
level1The first level.
level2The second level.
Returns
The minimum level.

◆ getNv12()

static fm.liveswitch.VideoFormat fm.liveswitch.VideoFormat.getNv12 ( )
static

Gets an NV12 video format.

◆ getNv12Name()

static String fm.liveswitch.VideoFormat.getNv12Name ( )
static

Gets the name of the NV12 video format ("NV12").

Indicates that each pixel occupies 12 bits (8 bits for Y, 2 bits for U, and 2 bits for V). Y plane is followed by interleaved U/V plane.

◆ getNv21()

static fm.liveswitch.VideoFormat fm.liveswitch.VideoFormat.getNv21 ( )
static

Gets an NV21 video format.

◆ getNv21Name()

static String fm.liveswitch.VideoFormat.getNv21Name ( )
static

Gets the name of the NV21 video format ("NV21").

Indicates that each pixel occupies 12 bits (8 bits for Y, 2 bits for U, and 2 bits for V). Y plane is followed by interleaved V/U plane.

◆ getParameters()

String fm.liveswitch.VideoFormat.getParameters ( )

Gets the parameters.

◆ getRgb()

static fm.liveswitch.VideoFormat fm.liveswitch.VideoFormat.getRgb ( )
static

Gets an RGB video format.

◆ getRgba()

static fm.liveswitch.VideoFormat fm.liveswitch.VideoFormat.getRgba ( )
static

Gets an RGBA video format.

◆ getRgbaName()

static String fm.liveswitch.VideoFormat.getRgbaName ( )
static

Gets the name of the RGBA video format ("RGBA").

Indicates that each pixel occupies 32 bits (8 bits for red, then 8 bits for green, then 8 bits for blue, then 8 bits for alpha).

◆ getRgbName()

static String fm.liveswitch.VideoFormat.getRgbName ( )
static

Gets the name of the RGB video format ("RGB").

Indicates that each pixel occupies 24 bits (8 bits for red, then 8 bits for green, then 8 bits for blue).

◆ getVp8()

static fm.liveswitch.VideoFormat fm.liveswitch.VideoFormat.getVp8 ( )
static

Gets a VP8 video format.

◆ getVp8Name()

static String fm.liveswitch.VideoFormat.getVp8Name ( )
static

Gets the name of the VP8 video format ("VP8").

◆ getVp9()

static fm.liveswitch.VideoFormat fm.liveswitch.VideoFormat.getVp9 ( )
static

Gets a VP9 video format.

◆ getVp9Name()

static String fm.liveswitch.VideoFormat.getVp9Name ( )
static

Gets the name of the VP9 video format ("VP9").

◆ getYv12()

static fm.liveswitch.VideoFormat fm.liveswitch.VideoFormat.getYv12 ( )
static

Gets a YV12 video format.

◆ getYv12Name()

static String fm.liveswitch.VideoFormat.getYv12Name ( )
static

Gets the name of the YV12 video format ("YV12").

Indicates that each pixel occupies 12 bits (8 bits for Y, 2 bits for U, and 2 bits for V). Y plane is followed by V plane and then U plane.

◆ isLevelCompatible()

boolean fm.liveswitch.VideoFormat.isLevelCompatible ( String  level)
protected

Gets whether a level is compatible.

Parameters
levelThe level.

◆ isProfileCompatible()

boolean fm.liveswitch.VideoFormat.isProfileCompatible ( String  profile)
protected

Gets whether a profile is compatible.

Parameters
profileThe profile.

◆ setFourCC()

void fm.liveswitch.VideoFormat.setFourCC ( int  value)

Sets the FourCC value for this format.

◆ toFourCC() [1/2]

static int fm.liveswitch.VideoFormat.toFourCC ( char  a,
char  b,
char  c,
char  d 
)
static

Converts 4 FourCC characters to an int.

◆ toFourCC() [2/2]

static int fm.liveswitch.VideoFormat.toFourCC ( String  fourcc)
static

Converts a FourCC string to a int.

Parameters
fourccThe fourcc.

◆ toJson() [1/2]

String fm.liveswitch.VideoFormat.toJson ( )

Serializes this instance to JSON.

◆ toJson() [2/2]

static String fm.liveswitch.VideoFormat.toJson ( final fm.liveswitch.VideoFormat  videoFormat)
static

Serializes an instance to JSON.

Parameters
videoFormatThe video format.

◆ updateProfileToCompatible()

void fm.liveswitch.VideoFormat.updateProfileToCompatible ( fm.liveswitch.VideoFormat  format)
protected

Updates the profile to a compatible value.

Parameters
formatThe format.