Function

CMVideoFormatDescriptionGetH264ParameterSetAtIndex

Returns a parameter set contained in a H.264 format description.

Declaration

OSStatus CMVideoFormatDescriptionGetH264ParameterSetAtIndex(CMFormatDescriptionRef videoDesc, size_t parameterSetIndex, const uint8_t * _Nullable *parameterSetPointerOut, size_t *parameterSetSizeOut, size_t *parameterSetCountOut, int *NALUnitHeaderLengthOut);

Parameters

videoDesc

The format description being interrogated.

parameterSetIndex

Index of the parameter set to be returned in parameterSetPointerOut and parameterSetSizeOut. This parameter is ignored if both parameterSetPointerOut and parameterSetSizeOut are NULL.

parameterSetPointerOut

Points to a pointer to receive the parameter set. Pass NULL if you do not want this information.

parameterSetSizeOut

Points to a size_t to receive the size in bytes of the parameter set. Pass NULL if you do not want this information.

parameterSetCountOut

Number of parameter sets in the AVC decoder configuration record contained in videoDesc. Pass NULL if you do not want this information.

NALUnitHeaderLengthOut

Points to an int to receive the size, in bytes, of the NALUnitLength field in an AVC video sample or AVC parameter set sample. Pass NULL if you do not want this information.

Discussion

This function parses the AVC decoder configuration record contained in a H.264 video format description and returns the parameter set NAL unit at the given index from it.Both parameterSetPointerOut and parameterSetSizeOut may be NULL, parameterSetCountOut will return the total number of parameter set NAL units contained in the AVC decoder configuration record.The parameter set NAL units returned will already have any emulation prevention bytes needed.The pointer returned in parameterSetPointerOut points to internal memory of videoDesc, and may only be accessed as long as a retain on videoDesc is held.

See Also

Video-Specific Functions

CMVideoFormatDescriptionCreate

Creates a format description for a video media stream.

CMVideoFormatDescriptionCreateForImageBuffer

Creates a format description for a video media stream contained in CVImageBuffers of the type provided.

CMVideoFormatDescriptionGetCleanAperture

Returns the clean aperture.

CMVideoFormatDescriptionGetDimensions

Returns the video dimensions (in encoded pixels).

CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers

Returns an array of the keys that are used both as CMVideoFormatDescription extensions and CVImageBuffer attachments and attributes.

CMVideoFormatDescriptionGetPresentationDimensions

Returns the dimensions, adjusted to take pixel aspect ratio and/or clean aperture into account.

CMVideoFormatDescriptionMatchesImageBuffer

Checks to see if a given format description matches an image buffer.

CMVideoFormatDescriptionCreateFromH264ParameterSets

Creates a format description for a video media stream described by H.264 parameter set NAL units.

CMVideoFormatDescriptionCopyAsBigEndianImageDescriptionBlockBuffer

Copies the contents of a CMVideoFormatDescription to a CMBlockBuffer in big-endian byte ordering.

CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionBlockBuffer

Creates a CMVideoFormatDescription from a big-endian ImageDescription data structure in a CMBlockBuffer.

CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionData

Creates a CMVideoFormatDescription from a big-endian ImageDescription data structure.

CMSwapBigEndianImageDescriptionToHost

Converts an ImageDescription data structure from big-endian to host-endian in place.

CMSwapHostEndianImageDescriptionToBig

Converts an ImageDescription data structure from host-endian to big-endian in place.