An H264 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 | getHeader () |
Gets the NAL header. More... | |
int | getNalRefIdc () |
Gets the NRI: 2bits otherwise known as nal_ref_idc. 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 | 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 fm.liveswitch.h264.Nalu | getNalu (fm.liveswitch.DataBuffer encodedData) |
Returns the first NAL unit after nalStart. More... | |
static fm.liveswitch.h264.Nalu | getNalu (fm.liveswitch.DataBuffer encodedData, int nalStart, fm.liveswitch.IntegerHolder nextStartCodeLength) |
Returns the first NAL unit after nalStart. More... | |
static int | getNriMask () |
Gets the nal_ref_idc mask. More... | |
static fm.liveswitch.DataBuffer | getStartCode () |
Gets the 4-byte NALU start code. More... | |
static int | getTypeMask () |
Gets the NAL Unit Type mask. More... | |
Protected Member Functions | |
int | getBottomFieldFlag () |
Gets the bottom_field_flag. More... | |
int[] | getDeltaPicOrderCnt () |
Gets the pic_order_cnt_lsb. More... | |
int | getFieldPicFlag () |
Gets the field_pic_flag. More... | |
int | getFirstMbInSlice () |
Gets the first_mb_in_slice specifies the address of the first macroblock in the slice. More... | |
int | getFrameNum () |
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... | |
int | getIdrPicFlag () |
Gets the idr_pic_flag. More... | |
int | getIdrPicId () |
Gets the idr_pic_id: The values of idr_pic_id in all the slices of an IDR picture shall remain unchanged. More... | |
int | getPicOrderCntLsb () |
Gets the pic_order_cnt_lsb. More... | |
int | getPicOrderCntType () |
Gets the pic_order_cnt_type. More... | |
int | getPpsId () |
Gets the Picture Parameter Set specifies the picture parameter set in use. More... | |
int | getSliceType () |
Gets the type of Slice contained in this NAL. More... | |
int | getSpsId () |
Gets the Sequence Parameter Set this NAL references. More... | |
An H264 Network Abstraction Layer Unit.
fm.liveswitch.h264.Nalu.Nalu | ( | ) |
Creates an empty NAL Unit.
fm.liveswitch.h264.Nalu.Nalu | ( | fm.liveswitch.DataBuffer | naluBytes | ) |
Creates a NAL Unit from a byte array.
naluBytes | The NALU bytes. |
|
static |
Scans for the index of the first NAL Unit after start.
encodedData | The stream to search. |
|
static |
Scans for the index of the first NAL Unit after start.
encodedData | The stream to search. |
start | The index to start searching from. |
|
protected |
Gets the bottom_field_flag.
fm.liveswitch.DataBuffer fm.liveswitch.h264.Nalu.getBuffer | ( | ) |
Gets the backing DataBuffer.
fm.liveswitch.DataBuffer fm.liveswitch.h264.Nalu.getBytes | ( | ) |
Gets the NAL Unit as a byte array that can be passed to an encoder (includes Start Code).
|
protected |
Gets the pic_order_cnt_lsb.
boolean fm.liveswitch.h264.Nalu.getFBit | ( | ) |
Gets the forbidden Zero Bit.
The H.264 specification declares a value of 1 as a syntax violation.
|
static |
Gets the forbidden zero bit mask.
|
protected |
Gets the field_pic_flag.
|
protected |
Gets the first_mb_in_slice specifies the address of the first macroblock in the slice.
When arbitrary slice order is not allowed as specified in Annex A, the value of first_mb_in_slice is constrained as follows: – If separate_colour_plane_flag is equal to 0, the value of first_mb_in_slice shall not be less than the value of first_mb_in_slice for any other slice of the current picture that precedes the current slice in decoding order. – Otherwise (separate_colour_plane_flag is equal to 1), the value of first_mb_in_slice shall not be less than the value of first_mb_in_slice for any other slice of the current picture that precedes the current slice in decoding order and has the same value of colour_plane_id.
|
protected |
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.
int fm.liveswitch.h264.Nalu.getHeader | ( | ) |
Gets the NAL header.
|
protected |
Gets the idr_pic_flag.
|
protected |
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.
int fm.liveswitch.h264.Nalu.getNalRefIdc | ( | ) |
Gets the NRI: 2bits otherwise known as nal_ref_idc.
|
static |
Returns the first NAL unit after nalStart.
encodedData | The byte array to search. |
|
static |
Returns the first NAL unit after nalStart.
encodedData | The byte array to search. |
nalStart | The start index of the NAL. |
nextStartCodeLength | OUT The length of the next the NAL startcode. |
|
static |
Gets the nal_ref_idc mask.
fm.liveswitch.DataBuffer fm.liveswitch.h264.Nalu.getPayload | ( | ) |
Gets the NAL payload.
|
protected |
Gets the pic_order_cnt_lsb.
|
protected |
Gets the pic_order_cnt_type.
|
protected |
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.
fm.liveswitch.DataBuffer fm.liveswitch.h264.Nalu.getShortLength | ( | ) |
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.
|
protected |
Gets the type of Slice contained in this NAL.
|
protected |
Gets the Sequence Parameter Set this NAL references.
|
static |
Gets the 4-byte NALU start code.
int fm.liveswitch.h264.Nalu.getType | ( | ) |
Gets the NAL Unit Type.
|
static |
Gets the NAL Unit Type mask.