fm.liveswitch.VideoBuffer Class Reference

A video buffer. More...

Public Member Functions

fm.liveswitch.VideoBuffer clone ()
 Clones this instance. More...
 
fm.liveswitch.VideoBuffer convert (fm.liveswitch.VideoFormat format)
 Creates a new video buffer using the specified format. More...
 
fm.liveswitch.VideoBuffer convert (fm.liveswitch.VideoFormat format, fm.liveswitch.DataBuffer dataBuffer)
 Creates a new video buffer using the specified format. More...
 
fm.liveswitch.VideoBuffer convert (fm.liveswitch.VideoFormat format, boolean usePool)
 Creates a new video buffer using the specified format. More...
 
void copyTransformationAttributes (fm.liveswitch.VideoBuffer sourceBuffer)
 Copy the transformation attributes from another video buffer. More...
 
int getAValue (int index)
 Gets the A value at a given index. More...
 
int getBValue (int index)
 Gets the B value at a given index. More...
 
int getGValue (int index)
 Gets the G value at a given index. More...
 
int getHeight ()
 Gets the height. More...
 
boolean getHorizontallyMirrored ()
 Gets whether this buffer should be mirrored over the X axis. More...
 
boolean getInversionRequired ()
 Gets whether inversion is required to reset the mirroring of this buffer. More...
 
boolean getIsAbgr ()
 Gets a value indicating whether this buffer has ABGR video. More...
 
boolean getIsArgb ()
 Gets a value indicating whether this buffer has ARGB video. More...
 
boolean getIsBgr ()
 Gets a value indicating whether this buffer has BGR video. More...
 
boolean getIsBgra ()
 Gets a value indicating whether this buffer has BGRA video. More...
 
boolean getIsH264 ()
 Gets a value indicating whether this buffer has H.264 video. More...
 
boolean getIsH265 ()
 Gets a value indicating whether this buffer has H.265 video. More...
 
boolean getIsI420 ()
 Gets a value indicating whether this buffer has I420 video. More...
 
boolean getIsKeyFrame ()
 Gets a value indicating whether this buffer contains a keyframe. More...
 
boolean getIsMuted ()
 Gets a value indicating whether this instance has been muted. More...
 
boolean getIsNv12 ()
 Gets a value indicating whether this buffer has NV12 video. More...
 
boolean getIsNv21 ()
 Gets a value indicating whether this buffer has NV21 video. More...
 
boolean getIsPacked ()
 Gets a value indicating whether the data is packed into a single data buffer. More...
 
boolean getIsPlanar ()
 Gets a value indicating whether the data is spread across multiple data buffers (planes). More...
 
boolean getIsRaw ()
 Gets a value indicating whether this buffer has raw video. More...
 
boolean getIsRgb ()
 Gets a value indicating whether this buffer has RGB video. More...
 
boolean getIsRgba ()
 Gets a value indicating whether this buffer has RGBA video. More...
 
boolean getIsRgbaType ()
 Gets a value indicating whether this buffer has raw RGBA, BGRA, ARGB, or ABGR video. More...
 
boolean getIsRgbType ()
 Gets a value indicating whether this buffer has raw RGB or BGR video. More...
 
boolean getIsVp8 ()
 Gets a value indicating whether this buffer has VP8 video. More...
 
boolean getIsVp9 ()
 Gets a value indicating whether this buffer has VP9 video. More...
 
boolean getIsYuvType ()
 Gets a value indicating whether this buffer has raw I420, YV12, NV12, or NV21 video. More...
 
boolean getIsYv12 ()
 Gets a value indicating whether this buffer has YV12 video. More...
 
int getOrientation ()
 Gets the desired orientation of the buffer. More...
 
int getRotationRequired ()
 Gets whether rotation is required to reset the mirroring and orientation of this buffer. More...
 
int getRValue (int index)
 Gets the R value at a given index. More...
 
int getStride ()
 Gets the stride. More...
 
int[] getStrides ()
 Gets the strides. More...
 
boolean getTransformRequired ()
 Gets a boolean value on whether the buffer needs to be transformed. More...
 
int getUValue (int index)
 Gets the U value at a given index. More...
 
boolean getVerticallyMirrored ()
 Gets whether this buffer should be mirrored over the Y axis. More...
 
int getVValue (int index)
 Gets the V value at a given index. More...
 
int getWidth ()
 Gets the width. More...
 
int getYValue (int index)
 Gets the Y value at a given index. More...
 
boolean mute ()
 Mutes this instance. More...
 
void resetTransformationAttributes ()
 Resets the transformation attributes back to default values. More...
 
boolean setAValue (int aValue, int index)
 Gets the A value at a given index. More...
 
boolean setBValue (int bValue, int index)
 Gets the B value at a given index. More...
 
boolean setGValue (int gValue, int index)
 Sets the G value at a given index. More...
 
void setHeight (int value)
 Sets the height. More...
 
void setHorizontallyMirrored (boolean value)
 Sets whether this buffer should be mirrored over the X axis. More...
 
void setOrientation (int value)
 Sets the desired orientation of the buffer. More...
 
boolean setRValue (int rValue, int index)
 Sets the R value at a given index. More...
 
void setStride (int value)
 Sets the stride. More...
 
void setStrides (int[] value)
 Sets the strides. More...
 
boolean setUValue (int uValue, int index)
 Sets the U value at a given index. More...
 
void setVerticallyMirrored (boolean value)
 Sets whether this buffer should be mirrored over the Y axis. More...
 
boolean setVValue (int vValue, int index)
 Sets the V value at a given index. More...
 
void setWidth (int value)
 Sets the width. More...
 
boolean setYValue (int yValue, int index)
 Sets the Y value at a given index. More...
 
String toJson ()
 Serializes this instance to JSON. More...
 
fm.liveswitch.VideoBuffer toPacked ()
 Creates a packed representation of this planar buffer, if in YUV-planar format. More...
 
fm.liveswitch.VideoBuffer toPacked (boolean usePool)
 Creates a packed representation of this planar buffer, if in YUV-planar format. More...
 
fm.liveswitch.VideoBuffer toPlanar ()
 Creates a planar representation of this packed buffer, if in YUV-packed format. More...
 
 VideoBuffer (int width, int height, fm.liveswitch.DataBuffer dataBuffer, fm.liveswitch.VideoFormat format)
 Initializes a new instance of the fm.liveswitch.VideoBuffer class. More...
 
 VideoBuffer (int width, int height, fm.liveswitch.DataBuffer[] dataBuffers, fm.liveswitch.VideoFormat format)
 Initializes a new instance of the fm.liveswitch.VideoBuffer class. More...
 
 VideoBuffer (int width, int height, int stride, fm.liveswitch.DataBuffer dataBuffer, fm.liveswitch.VideoFormat format)
 Initializes a new instance of the fm.liveswitch.VideoBuffer class. More...
 
 VideoBuffer (int width, int height, int[] strides, fm.liveswitch.DataBuffer[] dataBuffers, fm.liveswitch.VideoFormat format)
 Initializes a new instance of the fm.liveswitch.VideoBuffer class. More...
 
- Public Member Functions inherited from fm.liveswitch.Dynamic
java.util.HashMap< String, Object > getDynamicProperties ()
 Gets all dynamic properties on this instance. More...
 
Object getDynamicValue (String key)
 Gets a property value from the local cache. More...
 
void setDynamicValue (String key, Object value)
 Sets a property value in the local cache. More...
 
boolean unsetDynamicValue (String key)
 Removes a property value from the local cache. More...
 

Static Public Member Functions

static fm.liveswitch.VideoBuffer createBlack (int width, int height, String formatName)
 Creates a black (0, 0, 0) video buffer with the specified width/height. More...
 
static fm.liveswitch.VideoBuffer createBlue (int width, int height, String formatName)
 Creates a blue (0, 0, 255) video buffer with the specified width/height. More...
 
static fm.liveswitch.VideoBuffer createCustom (int width, int height, int red, int green, int blue, String formatName)
 Creates a custom video buffer with the specified width/height and red/green/blue values for the specified format name. More...
 
static fm.liveswitch.VideoBuffer createCustom (int width, int height, int red, int green, int blue, String formatName, fm.liveswitch.DataBuffer buffer)
 Creates a custom video buffer with the specified width/height and red/green/blue values for the specified format name. More...
 
static fm.liveswitch.VideoBuffer createCyan (int width, int height, String formatName)
 Creates a cyan (0, 255, 255) video buffer with the specified width/height. More...
 
static fm.liveswitch.VideoBuffer createDarkBlue (int width, int height, String formatName)
 Creates a dark blue (0, 0, 128) video buffer with the specified width/height. More...
 
static fm.liveswitch.VideoBuffer createDarkGreen (int width, int height, String formatName)
 Creates a dark green (0, 128, 0) video buffer with the specified width/height. More...
 
static fm.liveswitch.VideoBuffer createDarkRed (int width, int height, String formatName)
 Creates a dark red (128, 0, 0) video buffer with the specified width/height. More...
 
static fm.liveswitch.VideoBuffer createGray (int width, int height, String formatName)
 Creates a gray (255, 255, 255) video buffer with the specified width/height. More...
 
static fm.liveswitch.VideoBuffer createGreen (int width, int height, String formatName)
 Creates a green (0, 255, 0) video buffer with the specified width/height. More...
 
static fm.liveswitch.VideoBuffer createMagenta (int width, int height, String formatName)
 Creates a magenta (255, 0, 255) video buffer with the specified width/height. More...
 
static fm.liveswitch.VideoBuffer createOlive (int width, int height, String formatName)
 Creates an olive (128, 128, 0) video buffer with the specified width/height. More...
 
static fm.liveswitch.VideoBuffer createPurple (int width, int height, String formatName)
 Creates a purple (128, 0, 128) video buffer with the specified width/height. More...
 
static fm.liveswitch.VideoBuffer createRed (int width, int height, String formatName)
 Creates a red (255, 0, 0) video buffer with the specified width/height. More...
 
static fm.liveswitch.VideoBuffer createTeal (int width, int height, String formatName)
 Creates a teal (0, 128, 128) video buffer with the specified width/height. More...
 
static fm.liveswitch.VideoBuffer createWhite (int width, int height, String formatName)
 Creates a white (255, 255, 255) video buffer with the specified width/height. More...
 
static fm.liveswitch.VideoBuffer createYellow (int width, int height, String formatName)
 Creates a yellow (255, 255, 0) video buffer with the specified width/height. More...
 
static fm.liveswitch.VideoBuffer fromJson (String videoBufferJson)
 Deserializes an instance from JSON. More...
 
static fm.liveswitch.VideoBuffer[] fromJsonArray (String videoBuffersJson)
 Deserializes an array of instances from JSON. More...
 
static int getMinimumBufferLength (int width, int height, String formatName)
 Gets the minimum data buffer length for a given width, height, and format. More...
 
static String toJson (final fm.liveswitch.VideoBuffer videoBuffer)
 Serializes an instance to JSON. More...
 
static String toJsonArray (fm.liveswitch.VideoBuffer[] videoBuffers)
 Serializes an array of instances to JSON. More...
 

Protected Member Functions

fm.liveswitch.VideoBuffer createInstance ()
 Creates a new instance. More...
 
 VideoBuffer ()
 Initializes a new instance of the fm.liveswitch.VideoBuffer class. More...
 
- Protected Member Functions inherited from fm.liveswitch.Dynamic
 Dynamic ()
 
- Protected Member Functions inherited from fm.liveswitch.Serializable
boolean getIsDirty ()
 Gets a value indicating whether this instance is dirty. More...
 
 Serializable ()
 Initializes a new instance of the fm.liveswitch.Serializable class. More...
 
void setIsDirty (boolean value)
 Sets a value indicating whether this instance is dirty. More...
 

Detailed Description

A video buffer.

Constructor & Destructor Documentation

◆ VideoBuffer() [1/5]

fm.liveswitch.VideoBuffer.VideoBuffer ( )
protected

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

◆ VideoBuffer() [2/5]

fm.liveswitch.VideoBuffer.VideoBuffer ( int  width,
int  height,
fm.liveswitch.DataBuffer  dataBuffer,
fm.liveswitch.VideoFormat  format 
)

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

Parameters
widthThe width.
heightThe height.
dataBufferThe data buffer.
formatThe format.

◆ VideoBuffer() [3/5]

fm.liveswitch.VideoBuffer.VideoBuffer ( int  width,
int  height,
fm.liveswitch.DataBuffer[]  dataBuffers,
fm.liveswitch.VideoFormat  format 
)

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

Parameters
widthThe width.
heightThe height.
dataBuffersThe data buffers.
formatThe format.

◆ VideoBuffer() [4/5]

fm.liveswitch.VideoBuffer.VideoBuffer ( int  width,
int  height,
int  stride,
fm.liveswitch.DataBuffer  dataBuffer,
fm.liveswitch.VideoFormat  format 
)

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

Parameters
widthThe width.
heightThe height.
strideThe stride.
dataBufferThe data buffer.
formatThe format.

◆ VideoBuffer() [5/5]

fm.liveswitch.VideoBuffer.VideoBuffer ( int  width,
int  height,
int[]  strides,
fm.liveswitch.DataBuffer[]  dataBuffers,
fm.liveswitch.VideoFormat  format 
)

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

Parameters
widthThe width.
heightThe height.
stridesThe strides.
dataBuffersThe data buffers.
formatThe format.

Member Function Documentation

◆ clone()

fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.clone ( )

Clones this instance.

◆ convert() [1/3]

fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.convert ( fm.liveswitch.VideoFormat  format)

Creates a new video buffer using the specified format.

Parameters
formatThe format.

◆ convert() [2/3]

fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.convert ( fm.liveswitch.VideoFormat  format,
boolean  usePool 
)

Creates a new video buffer using the specified format.

Parameters
formatThe format.
usePoolWhether to use the DataBufferPool.

◆ convert() [3/3]

fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.convert ( fm.liveswitch.VideoFormat  format,
fm.liveswitch.DataBuffer  dataBuffer 
)

Creates a new video buffer using the specified format.

Parameters
formatThe format.
dataBufferThe data buffer.

◆ copyTransformationAttributes()

void fm.liveswitch.VideoBuffer.copyTransformationAttributes ( fm.liveswitch.VideoBuffer  sourceBuffer)

Copy the transformation attributes from another video buffer.

◆ createBlack()

static fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.createBlack ( int  width,
int  height,
String  formatName 
)
static

Creates a black (0, 0, 0) video buffer with the specified width/height.

Parameters
widthThe width.
heightThe height.
formatNameName of the format.

◆ createBlue()

static fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.createBlue ( int  width,
int  height,
String  formatName 
)
static

Creates a blue (0, 0, 255) video buffer with the specified width/height.

Parameters
widthThe width.
heightThe height.
formatNameName of the format.

◆ createCustom() [1/2]

static fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.createCustom ( int  width,
int  height,
int  red,
int  green,
int  blue,
String  formatName 
)
static

Creates a custom video buffer with the specified width/height and red/green/blue values for the specified format name.

If the format is not supported, returns null.

Parameters
widthThe width.
heightThe height.
redThe red value.
greenThe green value.
blueThe blue value.
formatNameName of the format.

◆ createCustom() [2/2]

static fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.createCustom ( int  width,
int  height,
int  red,
int  green,
int  blue,
String  formatName,
fm.liveswitch.DataBuffer  buffer 
)
static

Creates a custom video buffer with the specified width/height and red/green/blue values for the specified format name.

If the format is not supported, returns null.

Parameters
widthThe width.
heightThe height.
redThe red value.
greenThe green value.
blueThe blue value.
formatNameName of the format.
bufferThe output data buffer.

◆ createCyan()

static fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.createCyan ( int  width,
int  height,
String  formatName 
)
static

Creates a cyan (0, 255, 255) video buffer with the specified width/height.

Parameters
widthThe width.
heightThe height.
formatNameName of the format.

◆ createDarkBlue()

static fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.createDarkBlue ( int  width,
int  height,
String  formatName 
)
static

Creates a dark blue (0, 0, 128) video buffer with the specified width/height.

Parameters
widthThe width.
heightThe height.
formatNameName of the format.

◆ createDarkGreen()

static fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.createDarkGreen ( int  width,
int  height,
String  formatName 
)
static

Creates a dark green (0, 128, 0) video buffer with the specified width/height.

Parameters
widthThe width.
heightThe height.
formatNameName of the format.

◆ createDarkRed()

static fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.createDarkRed ( int  width,
int  height,
String  formatName 
)
static

Creates a dark red (128, 0, 0) video buffer with the specified width/height.

Parameters
widthThe width.
heightThe height.
formatNameName of the format.

◆ createGray()

static fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.createGray ( int  width,
int  height,
String  formatName 
)
static

Creates a gray (255, 255, 255) video buffer with the specified width/height.

Parameters
widthThe width.
heightThe height.
formatNameName of the format.

◆ createGreen()

static fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.createGreen ( int  width,
int  height,
String  formatName 
)
static

Creates a green (0, 255, 0) video buffer with the specified width/height.

Parameters
widthThe width.
heightThe height.
formatNameName of the format.

◆ createInstance()

fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.createInstance ( )
protected

Creates a new instance.

Reimplemented in fm.liveswitch.PacketizedVideoBuffer.

◆ createMagenta()

static fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.createMagenta ( int  width,
int  height,
String  formatName 
)
static

Creates a magenta (255, 0, 255) video buffer with the specified width/height.

Parameters
widthThe width.
heightThe height.
formatNameName of the format.

◆ createOlive()

static fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.createOlive ( int  width,
int  height,
String  formatName 
)
static

Creates an olive (128, 128, 0) video buffer with the specified width/height.

Parameters
widthThe width.
heightThe height.
formatNameName of the format.

◆ createPurple()

static fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.createPurple ( int  width,
int  height,
String  formatName 
)
static

Creates a purple (128, 0, 128) video buffer with the specified width/height.

Parameters
widthThe width.
heightThe height.
formatNameName of the format.

◆ createRed()

static fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.createRed ( int  width,
int  height,
String  formatName 
)
static

Creates a red (255, 0, 0) video buffer with the specified width/height.

Parameters
widthThe width.
heightThe height.
formatNameName of the format.

◆ createTeal()

static fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.createTeal ( int  width,
int  height,
String  formatName 
)
static

Creates a teal (0, 128, 128) video buffer with the specified width/height.

Parameters
widthThe width.
heightThe height.
formatNameName of the format.

◆ createWhite()

static fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.createWhite ( int  width,
int  height,
String  formatName 
)
static

Creates a white (255, 255, 255) video buffer with the specified width/height.

Parameters
widthThe width.
heightThe height.
formatNameName of the format.

◆ createYellow()

static fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.createYellow ( int  width,
int  height,
String  formatName 
)
static

Creates a yellow (255, 255, 0) video buffer with the specified width/height.

Parameters
widthThe width.
heightThe height.
formatNameName of the format.

◆ fromJson()

static fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.fromJson ( String  videoBufferJson)
static

Deserializes an instance from JSON.

Parameters
videoBufferJsonThe video buffer JSON.

◆ fromJsonArray()

static fm.liveswitch.VideoBuffer [] fm.liveswitch.VideoBuffer.fromJsonArray ( String  videoBuffersJson)
static

Deserializes an array of instances from JSON.

Parameters
videoBuffersJsonThe video buffers JSON.

◆ getAValue()

int fm.liveswitch.VideoBuffer.getAValue ( int  index)

Gets the A value at a given index.

If the video buffer is not RGBA-type, then this will return 255.

Parameters
indexThe index.
Returns
The A value.

◆ getBValue()

int fm.liveswitch.VideoBuffer.getBValue ( int  index)

Gets the B value at a given index.

Parameters
indexThe index.
Returns
The B value, or -1 if the video buffer is not RGB/RGBA-type.

◆ getGValue()

int fm.liveswitch.VideoBuffer.getGValue ( int  index)

Gets the G value at a given index.

Parameters
indexThe index.
Returns
The G value, or -1 if the video buffer is not RGB/RGBA-type.

◆ getHeight()

int fm.liveswitch.VideoBuffer.getHeight ( )

Gets the height.

◆ getHorizontallyMirrored()

boolean fm.liveswitch.VideoBuffer.getHorizontallyMirrored ( )

Gets whether this buffer should be mirrored over the X axis.

◆ getInversionRequired()

boolean fm.liveswitch.VideoBuffer.getInversionRequired ( )

Gets whether inversion is required to reset the mirroring of this buffer.

◆ getIsAbgr()

boolean fm.liveswitch.VideoBuffer.getIsAbgr ( )

Gets a value indicating whether this buffer has ABGR video.

◆ getIsArgb()

boolean fm.liveswitch.VideoBuffer.getIsArgb ( )

Gets a value indicating whether this buffer has ARGB video.

◆ getIsBgr()

boolean fm.liveswitch.VideoBuffer.getIsBgr ( )

Gets a value indicating whether this buffer has BGR video.

◆ getIsBgra()

boolean fm.liveswitch.VideoBuffer.getIsBgra ( )

Gets a value indicating whether this buffer has BGRA video.

◆ getIsH264()

boolean fm.liveswitch.VideoBuffer.getIsH264 ( )

Gets a value indicating whether this buffer has H.264 video.

◆ getIsH265()

boolean fm.liveswitch.VideoBuffer.getIsH265 ( )

Gets a value indicating whether this buffer has H.265 video.

◆ getIsI420()

boolean fm.liveswitch.VideoBuffer.getIsI420 ( )

Gets a value indicating whether this buffer has I420 video.

◆ getIsKeyFrame()

boolean fm.liveswitch.VideoBuffer.getIsKeyFrame ( )

Gets a value indicating whether this buffer contains a keyframe.

◆ getIsMuted()

boolean fm.liveswitch.VideoBuffer.getIsMuted ( )

Gets a value indicating whether this instance has been muted.

◆ getIsNv12()

boolean fm.liveswitch.VideoBuffer.getIsNv12 ( )

Gets a value indicating whether this buffer has NV12 video.

◆ getIsNv21()

boolean fm.liveswitch.VideoBuffer.getIsNv21 ( )

Gets a value indicating whether this buffer has NV21 video.

◆ getIsPacked()

boolean fm.liveswitch.VideoBuffer.getIsPacked ( )

Gets a value indicating whether the data is packed into a single data buffer.

◆ getIsPlanar()

boolean fm.liveswitch.VideoBuffer.getIsPlanar ( )

Gets a value indicating whether the data is spread across multiple data buffers (planes).

◆ getIsRaw()

boolean fm.liveswitch.VideoBuffer.getIsRaw ( )

Gets a value indicating whether this buffer has raw video.

◆ getIsRgb()

boolean fm.liveswitch.VideoBuffer.getIsRgb ( )

Gets a value indicating whether this buffer has RGB video.

◆ getIsRgba()

boolean fm.liveswitch.VideoBuffer.getIsRgba ( )

Gets a value indicating whether this buffer has RGBA video.

◆ getIsRgbaType()

boolean fm.liveswitch.VideoBuffer.getIsRgbaType ( )

Gets a value indicating whether this buffer has raw RGBA, BGRA, ARGB, or ABGR video.

◆ getIsRgbType()

boolean fm.liveswitch.VideoBuffer.getIsRgbType ( )

Gets a value indicating whether this buffer has raw RGB or BGR video.

◆ getIsVp8()

boolean fm.liveswitch.VideoBuffer.getIsVp8 ( )

Gets a value indicating whether this buffer has VP8 video.

◆ getIsVp9()

boolean fm.liveswitch.VideoBuffer.getIsVp9 ( )

Gets a value indicating whether this buffer has VP9 video.

◆ getIsYuvType()

boolean fm.liveswitch.VideoBuffer.getIsYuvType ( )

Gets a value indicating whether this buffer has raw I420, YV12, NV12, or NV21 video.

◆ getIsYv12()

boolean fm.liveswitch.VideoBuffer.getIsYv12 ( )

Gets a value indicating whether this buffer has YV12 video.

◆ getMinimumBufferLength()

static int fm.liveswitch.VideoBuffer.getMinimumBufferLength ( int  width,
int  height,
String  formatName 
)
static

Gets the minimum data buffer length for a given width, height, and format.

Parameters
widthThe width.
heightThe height.
formatNameName of the format.

◆ getOrientation()

int fm.liveswitch.VideoBuffer.getOrientation ( )

Gets the desired orientation of the buffer.

◆ getRotationRequired()

int fm.liveswitch.VideoBuffer.getRotationRequired ( )

Gets whether rotation is required to reset the mirroring and orientation of this buffer.

◆ getRValue()

int fm.liveswitch.VideoBuffer.getRValue ( int  index)

Gets the R value at a given index.

Parameters
indexThe index.
Returns
The R value, or -1 if the video buffer is not RGB/RGBA-type.

◆ getStride()

int fm.liveswitch.VideoBuffer.getStride ( )

Gets the stride.

◆ getStrides()

int [] fm.liveswitch.VideoBuffer.getStrides ( )

Gets the strides.

◆ getTransformRequired()

boolean fm.liveswitch.VideoBuffer.getTransformRequired ( )

Gets a boolean value on whether the buffer needs to be transformed.

◆ getUValue()

int fm.liveswitch.VideoBuffer.getUValue ( int  index)

Gets the U value at a given index.

Parameters
indexThe index.
Returns
The U value, or -1 if the video buffer is not YUV-type.

◆ getVerticallyMirrored()

boolean fm.liveswitch.VideoBuffer.getVerticallyMirrored ( )

Gets whether this buffer should be mirrored over the Y axis.

◆ getVValue()

int fm.liveswitch.VideoBuffer.getVValue ( int  index)

Gets the V value at a given index.

Parameters
indexThe index.
Returns
The V value, or -1 if the video buffer is not YUV-type.

◆ getWidth()

int fm.liveswitch.VideoBuffer.getWidth ( )

Gets the width.

◆ getYValue()

int fm.liveswitch.VideoBuffer.getYValue ( int  index)

Gets the Y value at a given index.

Parameters
indexThe index.
Returns
The Y value, or -1 if the video buffer is not YUV-type.

◆ mute()

boolean fm.liveswitch.VideoBuffer.mute ( )

Mutes this instance.

This is a one-way operation that clears the underlying data buffer.

◆ resetTransformationAttributes()

void fm.liveswitch.VideoBuffer.resetTransformationAttributes ( )

Resets the transformation attributes back to default values.

◆ setAValue()

boolean fm.liveswitch.VideoBuffer.setAValue ( int  aValue,
int  index 
)

Gets the A value at a given index.

If the video buffer is not RGBA-type, then this will return false.

Parameters
aValueThe A value.
indexThe index.
Returns
true
if the video buffer is RGBA-type.

◆ setBValue()

boolean fm.liveswitch.VideoBuffer.setBValue ( int  bValue,
int  index 
)

Gets the B value at a given index.

Parameters
bValueThe B value.
indexThe index.
Returns
true
if the video buffer is RGB/RGBA-type.

◆ setGValue()

boolean fm.liveswitch.VideoBuffer.setGValue ( int  gValue,
int  index 
)

Sets the G value at a given index.

Parameters
gValueThe G value.
indexThe index.
Returns
true
if the video buffer is RGB/RGBA-type.

◆ setHeight()

void fm.liveswitch.VideoBuffer.setHeight ( int  value)

Sets the height.

◆ setHorizontallyMirrored()

void fm.liveswitch.VideoBuffer.setHorizontallyMirrored ( boolean  value)

Sets whether this buffer should be mirrored over the X axis.

◆ setOrientation()

void fm.liveswitch.VideoBuffer.setOrientation ( int  value)

Sets the desired orientation of the buffer.

◆ setRValue()

boolean fm.liveswitch.VideoBuffer.setRValue ( int  rValue,
int  index 
)

Sets the R value at a given index.

Parameters
rValueThe R value.
indexThe index.
Returns
true
if the video buffer is RGB/RGBA-type.

◆ setStride()

void fm.liveswitch.VideoBuffer.setStride ( int  value)

Sets the stride.

◆ setStrides()

void fm.liveswitch.VideoBuffer.setStrides ( int[]  value)

Sets the strides.

◆ setUValue()

boolean fm.liveswitch.VideoBuffer.setUValue ( int  uValue,
int  index 
)

Sets the U value at a given index.

Parameters
uValueThe U value.
indexThe index.
Returns
true
if the video buffer is YUV-type.

◆ setVerticallyMirrored()

void fm.liveswitch.VideoBuffer.setVerticallyMirrored ( boolean  value)

Sets whether this buffer should be mirrored over the Y axis.

◆ setVValue()

boolean fm.liveswitch.VideoBuffer.setVValue ( int  vValue,
int  index 
)

Sets the V value at a given index.

Parameters
vValueThe V value.
indexThe index.
Returns
true
if the video buffer is YUV-type.

◆ setWidth()

void fm.liveswitch.VideoBuffer.setWidth ( int  value)

Sets the width.

◆ setYValue()

boolean fm.liveswitch.VideoBuffer.setYValue ( int  yValue,
int  index 
)

Sets the Y value at a given index.

Parameters
yValueThe Y value.
indexThe index.
Returns
true
if the video buffer is YUV-type.

◆ toJson() [1/2]

String fm.liveswitch.VideoBuffer.toJson ( )

Serializes this instance to JSON.

◆ toJson() [2/2]

static String fm.liveswitch.VideoBuffer.toJson ( final fm.liveswitch.VideoBuffer  videoBuffer)
static

Serializes an instance to JSON.

Parameters
videoBufferThe video buffer.

◆ toJsonArray()

static String fm.liveswitch.VideoBuffer.toJsonArray ( fm.liveswitch.VideoBuffer[]  videoBuffers)
static

Serializes an array of instances to JSON.

Parameters
videoBuffersThe video buffers.

◆ toPacked() [1/2]

fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.toPacked ( )

Creates a packed representation of this planar buffer, if in YUV-planar format.

Otherwise, returns the current buffer. If the planar data is not contiguous in memory, new memory will be allocated for the packed representation.

◆ toPacked() [2/2]

fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.toPacked ( boolean  usePool)

Creates a packed representation of this planar buffer, if in YUV-planar format.

Otherwise, returns the current buffer. If the planar data is not contiguous in memory, new memory will be allocated or taken from the data buffer pool for the packed representation.

Parameters
usePoolWhether to use the data buffer pool for any required memory allocations.

◆ toPlanar()

fm.liveswitch.VideoBuffer fm.liveswitch.VideoBuffer.toPlanar ( )

Creates a planar representation of this packed buffer, if in YUV-packed format.

Otherwise, returns the current buffer.