Contents

CMVideoFormatDescriptionGetH264ParameterSetAtIndex(_:parameterSetIndex:parameterSetPointerOut:parameterSetSizeOut:parameterSetCountOut:nalUnitHeaderLengthOut:)

Returns a parameter set that an H.264 format description contains.

Declaration

func CMVideoFormatDescriptionGetH264ParameterSetAtIndex(_ videoDesc: CMFormatDescription, parameterSetIndex: Int, parameterSetPointerOut: UnsafeMutablePointer<UnsafePointer<UInt8>?>?, parameterSetSizeOut: UnsafeMutablePointer<Int>?, parameterSetCountOut: UnsafeMutablePointer<Int>?, nalUnitHeaderLengthOut NALUnitHeaderLengthOut: UnsafeMutablePointer<Int32>?) -> OSStatus

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

Working with Video Descriptions