FMLiveSwitchH265Nalu Class Reference

An H265 Network Abstraction Layer Unit. More...

Instance Methods

(FMLiveSwitchDataBuffer *) - buffer
 Gets the backing DataBuffer. More...
 
(bool) - fBit
 Gets the forbidden Zero Bit. More...
 
(FMLiveSwitchDataBuffer *) - getBytes
 Gets the NAL Unit as a byte array that can be passed to an encoder (includes Start Code). More...
 
(instancetype) - init
 Creates an empty NAL Unit. More...
 
(instancetype) - initWithNaluBytes:
 Creates a NAL Unit from a byte array. More...
 
(int) - layerId
 Gets the LayerId: 6bits otherwise known as nuh_layer_id. More...
 
(FMLiveSwitchDataBuffer *) - payload
 Gets the NAL payload. More...
 
(FMLiveSwitchDataBuffer *) - shortLength
 Gets the size of the NAL Unit (including NAL header) in two octets stored in the returned byte array. More...
 
(int) - tid
 Gets the TID: 3bits otherwise known as nuh_temporal_plus1. More...
 
(int) - type
 Gets the NAL Unit Type. More...
 

Class Methods

(int) + fBitMask
 Gets the forbidden zero bit mask. More...
 
(int) + findNaluWithEncodedData:
 Scans for the index of the first NAL Unit after start. More...
 
(int) + findNextNaluWithEncodedData:start:
 Scans for the index of the first NAL Unit after start. More...
 
(FMLiveSwitchH265Nalu *) + getNaluWithEncodedData:
 Returns the first NAL unit after nalStart. More...
 
(FMLiveSwitchH265Nalu *) + getNaluWithEncodedData:nalStart:nextStartCodeLength:
 Returns the first NAL unit after nalStart. More...
 
(int) + layerIdMask
 Gets the Layer Id (nuh_layer_id) mask. More...
 
(FMLiveSwitchH265Nalu *) + nalu
 Creates an empty NAL Unit. More...
 
(FMLiveSwitchH265Nalu *) + naluWithNaluBytes:
 Creates a NAL Unit from a byte array. More...
 
(FMLiveSwitchDataBuffer *) + startCode
 Gets the 4-byte NALU start code. More...
 
(int) + tidMask
 Gets the TID (nuh_temporal_id_plus1) mask. More...
 
(int) + typeMask
 Gets the NAL Unit Type (nal_unit_type) mask. More...
 

Detailed Description

An H265 Network Abstraction Layer Unit.

Method Documentation

◆ buffer

Gets the backing DataBuffer.

◆ fBit

- (bool) fBit

Gets the forbidden Zero Bit.

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

◆ fBitMask

+ (int) fBitMask

Gets the forbidden zero bit mask.

◆ findNaluWithEncodedData:

+ (int) findNaluWithEncodedData: (FMLiveSwitchDataBuffer *)  encodedData

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

Parameters
encodedDataThe stream to search.

◆ findNextNaluWithEncodedData:start:

+ (int) findNextNaluWithEncodedData: (FMLiveSwitchDataBuffer *)  encodedData
start: (int)  start 

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

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

◆ getBytes

- (FMLiveSwitchDataBuffer*) getBytes

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

◆ getNaluWithEncodedData:

+ (FMLiveSwitchH265Nalu*) getNaluWithEncodedData: (FMLiveSwitchDataBuffer *)  encodedData

Returns the first NAL unit after nalStart.

Parameters
encodedDataThe byte array to search.

◆ getNaluWithEncodedData:nalStart:nextStartCodeLength:

+ (FMLiveSwitchH265Nalu*) getNaluWithEncodedData: (FMLiveSwitchDataBuffer *)  encodedData
nalStart: (int)  nalStart
nextStartCodeLength: (int *)  nextStartCodeLength 

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.

◆ init

- (instancetype) init

Creates an empty NAL Unit.

◆ initWithNaluBytes:

- (instancetype) initWithNaluBytes: (FMLiveSwitchDataBuffer *)  naluBytes

Creates a NAL Unit from a byte array.

Parameters
naluBytesThe NALU bytes.

◆ layerId

- (int) layerId

Gets the LayerId: 6bits otherwise known as nuh_layer_id.

◆ layerIdMask

+ (int) layerIdMask

Gets the Layer Id (nuh_layer_id) mask.

◆ nalu

Creates an empty NAL Unit.

◆ naluWithNaluBytes:

+ (FMLiveSwitchH265Nalu*) naluWithNaluBytes: (FMLiveSwitchDataBuffer *)  naluBytes

Creates a NAL Unit from a byte array.

Parameters
naluBytesThe NALU bytes.

◆ payload

- (FMLiveSwitchDataBuffer*) payload

Gets the NAL payload.

◆ shortLength

- (FMLiveSwitchDataBuffer*) shortLength

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.

◆ startCode

+ (FMLiveSwitchDataBuffer*) startCode

Gets the 4-byte NALU start code.

◆ tid

- (int) tid

Gets the TID: 3bits otherwise known as nuh_temporal_plus1.

◆ tidMask

+ (int) tidMask

Gets the TID (nuh_temporal_id_plus1) mask.

◆ type

- (int) type

Gets the NAL Unit Type.

◆ typeMask

+ (int) typeMask

Gets the NAL Unit Type (nal_unit_type) mask.