fm.liveswitch.h265.Nalu Class Reference

An H265 Network Abstraction Layer Unit. More...

Public Member Functions

fm.liveswitch.DataBuffer getBuffer ()
 Gets the backing DataBuffer. More...
 
fm.liveswitch.DataBuffer getBytes ()
 Gets the NAL Unit as a byte array that can be passed to an encoder (includes Start Code). More...
 
boolean getFBit ()
 Gets the forbidden Zero Bit. More...
 
int getLayerId ()
 Gets the LayerId: 6bits otherwise known as nuh_layer_id. More...
 
fm.liveswitch.DataBuffer getPayload ()
 Gets the NAL payload. More...
 
fm.liveswitch.DataBuffer getShortLength ()
 Gets the size of the NAL Unit (including NAL header) in two octets stored in the returned byte array. More...
 
int getTid ()
 Gets the TID: 3bits otherwise known as nuh_temporal_plus1. More...
 
int getType ()
 Gets the NAL Unit Type. More...
 
 Nalu ()
 Creates an empty NAL Unit. More...
 
 Nalu (fm.liveswitch.DataBuffer naluBytes)
 Creates a NAL Unit from a byte array. More...
 

Static Public Member Functions

static int findNalu (fm.liveswitch.DataBuffer encodedData)
 Scans for the index of the first NAL Unit after start. More...
 
static int findNextNalu (fm.liveswitch.DataBuffer encodedData, int start)
 Scans for the index of the first NAL Unit after start. More...
 
static int getFBitMask ()
 Gets the forbidden zero bit mask. More...
 
static int getLayerIdMask ()
 Gets the Layer Id (nuh_layer_id) mask. More...
 
static fm.liveswitch.h265.Nalu getNalu (fm.liveswitch.DataBuffer encodedData)
 Returns the first NAL unit after nalStart. More...
 
static fm.liveswitch.h265.Nalu getNalu (fm.liveswitch.DataBuffer encodedData, int nalStart, fm.liveswitch.IntegerHolder nextStartCodeLength)
 Returns the first NAL unit after nalStart. More...
 
static fm.liveswitch.DataBuffer getStartCode ()
 Gets the 4-byte NALU start code. More...
 
static int getTidMask ()
 Gets the TID (nuh_temporal_id_plus1) mask. More...
 
static int getTypeMask ()
 Gets the NAL Unit Type (nal_unit_type) mask. More...
 

Protected Member Functions

boolean getFirstSliceSegmentInPicFlag ()
 Gets the first_slice_segment_in_pic_flag. More...
 

Detailed Description

An H265 Network Abstraction Layer Unit.

Constructor & Destructor Documentation

◆ Nalu() [1/2]

fm.liveswitch.h265.Nalu.Nalu ( )

Creates an empty NAL Unit.

◆ Nalu() [2/2]

fm.liveswitch.h265.Nalu.Nalu ( fm.liveswitch.DataBuffer  naluBytes)

Creates a NAL Unit from a byte array.

Parameters
naluBytesThe NALU bytes.

Member Function Documentation

◆ findNalu()

static int fm.liveswitch.h265.Nalu.findNalu ( fm.liveswitch.DataBuffer  encodedData)
static

Scans for the index of the first NAL Unit after start.

Parameters
encodedDataThe stream to search.

◆ findNextNalu()

static int fm.liveswitch.h265.Nalu.findNextNalu ( fm.liveswitch.DataBuffer  encodedData,
int  start 
)
static

Scans for the index of the first NAL Unit after start.

Parameters
encodedDataThe stream to search.
startThe index to start searching from.

◆ getBuffer()

fm.liveswitch.DataBuffer fm.liveswitch.h265.Nalu.getBuffer ( )

Gets the backing DataBuffer.

◆ getBytes()

fm.liveswitch.DataBuffer fm.liveswitch.h265.Nalu.getBytes ( )

Gets the NAL Unit as a byte array that can be passed to an encoder (includes Start Code).

◆ getFBit()

boolean fm.liveswitch.h265.Nalu.getFBit ( )

Gets the forbidden Zero Bit.

The H.265 specification declares a value of 1 as a syntax violation.

◆ getFBitMask()

static int fm.liveswitch.h265.Nalu.getFBitMask ( )
static

Gets the forbidden zero bit mask.

◆ getFirstSliceSegmentInPicFlag()

boolean fm.liveswitch.h265.Nalu.getFirstSliceSegmentInPicFlag ( )
protected

Gets the first_slice_segment_in_pic_flag.

◆ getLayerId()

int fm.liveswitch.h265.Nalu.getLayerId ( )

Gets the LayerId: 6bits otherwise known as nuh_layer_id.

◆ getLayerIdMask()

static int fm.liveswitch.h265.Nalu.getLayerIdMask ( )
static

Gets the Layer Id (nuh_layer_id) mask.

◆ getNalu() [1/2]

static fm.liveswitch.h265.Nalu fm.liveswitch.h265.Nalu.getNalu ( fm.liveswitch.DataBuffer  encodedData)
static

Returns the first NAL unit after nalStart.

Parameters
encodedDataThe byte array to search.

◆ getNalu() [2/2]

static fm.liveswitch.h265.Nalu fm.liveswitch.h265.Nalu.getNalu ( fm.liveswitch.DataBuffer  encodedData,
int  nalStart,
fm.liveswitch.IntegerHolder  nextStartCodeLength 
)
static

Returns the first NAL unit after nalStart.

Parameters
encodedDataThe byte array to search.
nalStartThe start index of the NAL.
nextStartCodeLengthOUT The length of the next the NAL startcode.

◆ getPayload()

fm.liveswitch.DataBuffer fm.liveswitch.h265.Nalu.getPayload ( )

Gets the NAL payload.

◆ getShortLength()

fm.liveswitch.DataBuffer fm.liveswitch.h265.Nalu.getShortLength ( )

Gets the size of the NAL Unit (including NAL header) in two octets stored in the returned byte array.

Useful for creating H265 aggregation packets.

◆ getStartCode()

static fm.liveswitch.DataBuffer fm.liveswitch.h265.Nalu.getStartCode ( )
static

Gets the 4-byte NALU start code.

◆ getTid()

int fm.liveswitch.h265.Nalu.getTid ( )

Gets the TID: 3bits otherwise known as nuh_temporal_plus1.

◆ getTidMask()

static int fm.liveswitch.h265.Nalu.getTidMask ( )
static

Gets the TID (nuh_temporal_id_plus1) mask.

◆ getType()

int fm.liveswitch.h265.Nalu.getType ( )

Gets the NAL Unit Type.

◆ getTypeMask()

static int fm.liveswitch.h265.Nalu.getTypeMask ( )
static

Gets the NAL Unit Type (nal_unit_type) mask.