FMLiveSwitchH264Nalu Class Reference

An H264 Network Abstraction Layer Unit. More...

Instance Methods

(int) - bottomFieldFlag
 Gets the bottom_field_flag. More...
 
(FMLiveSwitchDataBuffer *) - buffer
 Gets the backing DataBuffer. More...
 
(NSMutableArray *) - deltaPicOrderCnt
 Gets the pic_order_cnt_lsb. More...
 
(bool) - fBit
 Gets the forbidden Zero Bit. More...
 
(int) - fieldPicFlag
 Gets the field_pic_flag. More...
 
(int) - frameNum
 Gets the frame_num: The Frame Number is used as an identifier for pictures and shall be represented by log2_max_frame_num_minus4 + 4 bits in the bitstream. More...
 
(FMLiveSwitchDataBuffer *) - getBytes
 Gets the NAL Unit as a byte array that can be passed to an encoder (includes Start Code). More...
 
(int) - header
 Gets the NAL header. More...
 
(int) - idrPicFlag
 Gets the idr_pic_flag. More...
 
(int) - idrPicId
 Gets the idr_pic_id: The values of idr_pic_id in all the slices of an IDR picture shall remain unchanged. More...
 
(instancetype) - init
 Creates an empty NAL Unit. More...
 
(instancetype) - initWithNaluBytes:
 Creates a NAL Unit from a byte array. More...
 
(int) - nalRefIdc
 Gets the NRI: 2bits otherwise known as nal_ref_idc. More...
 
(FMLiveSwitchDataBuffer *) - payload
 Gets the NAL payload. More...
 
(int) - picOrderCntLsb
 Gets the pic_order_cnt_lsb. More...
 
(int) - picOrderCntType
 Gets the pic_order_cnt_type. More...
 
(int) - ppsId
 Gets the Picture Parameter Set specifies the picture parameter set in use. More...
 
(FMLiveSwitchDataBuffer *) - shortLength
 Gets the size of the NAL Unit (including NAL header) in two octets stored in the returned byte array. More...
 
(int) - sliceType
 Gets the type of Slice contained in this NAL. More...
 
(int) - spsId
 Gets the Sequence Parameter Set this NAL references. 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...
 
(FMLiveSwitchH264Nalu *) + getNaluWithEncodedData:
 Returns the first NAL unit after nalStart. More...
 
(FMLiveSwitchH264Nalu *) + getNaluWithEncodedData:nalStart:nextStartCodeLength:
 Returns the first NAL unit after nalStart. More...
 
(FMLiveSwitchH264Nalu *) + nalu
 Creates an empty NAL Unit. More...
 
(FMLiveSwitchH264Nalu *) + naluWithNaluBytes:
 Creates a NAL Unit from a byte array. More...
 
(int) + nriMask
 Gets the nal_ref_idc mask. More...
 
(FMLiveSwitchDataBuffer *) + startCode
 Gets the 4-byte NALU start code. More...
 
(int) + typeMask
 Gets the NAL Unit Type mask. More...
 

Detailed Description

An H264 Network Abstraction Layer Unit.

Method Documentation

◆ bottomFieldFlag

- (int) bottomFieldFlag

Gets the bottom_field_flag.

◆ buffer

Gets the backing DataBuffer.

◆ deltaPicOrderCnt

- (NSMutableArray*) deltaPicOrderCnt

Gets the pic_order_cnt_lsb.

◆ fBit

- (bool) fBit

Gets the forbidden Zero Bit.

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

◆ fBitMask

+ (int) fBitMask

Gets the forbidden zero bit mask.

◆ fieldPicFlag

- (int) fieldPicFlag

Gets the field_pic_flag.

◆ 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.

◆ frameNum

- (int) frameNum

Gets the frame_num: The Frame Number is used as an identifier for pictures and shall be represented by log2_max_frame_num_minus4 + 4 bits in the bitstream.

◆ getBytes

- (FMLiveSwitchDataBuffer*) getBytes

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

◆ getNaluWithEncodedData:

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

Returns the first NAL unit after nalStart.

Parameters
encodedDataThe byte array to search.

◆ getNaluWithEncodedData:nalStart:nextStartCodeLength:

+ (FMLiveSwitchH264Nalu*) 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.

◆ header

- (int) header

Gets the NAL header.

◆ idrPicFlag

- (int) idrPicFlag

Gets the idr_pic_flag.

◆ idrPicId

- (int) idrPicId

Gets the idr_pic_id: The values of idr_pic_id in all the slices of an IDR picture shall remain unchanged.

When two consecutive access units in decoding order are both IDR access units, the value of idr_pic_id in the slices of the first such IDR access unit shall differ from the idr_pic_id in the second such IDR access unit. The value of idr_pic_id shall be in the range of 0 to 65535, inclusive.

◆ 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.

◆ nalRefIdc

- (int) nalRefIdc

Gets the NRI: 2bits otherwise known as nal_ref_idc.

◆ nalu

Creates an empty NAL Unit.

◆ naluWithNaluBytes:

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

Creates a NAL Unit from a byte array.

Parameters
naluBytesThe NALU bytes.

◆ nriMask

+ (int) nriMask

Gets the nal_ref_idc mask.

◆ payload

- (FMLiveSwitchDataBuffer*) payload

Gets the NAL payload.

◆ picOrderCntLsb

- (int) picOrderCntLsb

Gets the pic_order_cnt_lsb.

◆ picOrderCntType

- (int) picOrderCntType

Gets the pic_order_cnt_type.

◆ ppsId

- (int) ppsId

Gets the Picture Parameter Set specifies the picture parameter set in use.

The value of pic_parameter_set_id shall be in the range of 0 to 255, inclusive.

◆ 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 certain types of H264 such as STAP.

◆ sliceType

- (int) sliceType

Gets the type of Slice contained in this NAL.

◆ spsId

- (int) spsId

Gets the Sequence Parameter Set this NAL references.

◆ startCode

+ (FMLiveSwitchDataBuffer*) startCode

Gets the 4-byte NALU start code.

◆ type

- (int) type

Gets the NAL Unit Type.

◆ typeMask

+ (int) typeMask

Gets the NAL Unit Type mask.