CMVideoFormatDescriptionCreateFromH264ParameterSets(allocator:parameterSetCount:parameterSetPointers:parameterSetSizes:nalUnitHeaderLength:formatDescriptionOut:)
Creates a format description for a video media stream that the parameter set describes.
Declaration
func CMVideoFormatDescriptionCreateFromH264ParameterSets(allocator: CFAllocator?, parameterSetCount: Int, parameterSetPointers: UnsafePointer<UnsafePointer<UInt8>>, parameterSetSizes: UnsafePointer<Int>, nalUnitHeaderLength NALUnitHeaderLength: Int32, formatDescriptionOut: UnsafeMutablePointer<CMFormatDescription?>) -> OSStatusParameters
- allocator:
CFAllocator to be used when creating the CMFormatDescription. Pass NULL to use the default allocator.
- parameterSetCount:
The number of parameter sets to include in the format description. This parameter must be at least 2.
- parameterSetPointers:
Points to a C array containing parameterSetCount pointers to parameter sets.
- parameterSetSizes:
Points to a C array containing the size, in bytes, of each of the parameter sets.
- NALUnitHeaderLength:
Size, in bytes, of the NALUnitLength field in an AVC video sample or AVC parameter set sample. Pass 1, 2, or 4.
- formatDescriptionOut:
Returned newly created video CMFormatDescription.
Discussion
This function parses the dimensions provided by the parameter sets and creates a format description suitable for a raw H.264 stream. The parameter sets’ data can come from raw NAL units and must have any emulation prevention bytes needed.The supported NAL unit types to be included in the format description are 7 (sequence parameter set), 8 (picture parameter set) and 13 (sequence parameter set extension). At least one sequence parameter set and one picture parameter set must be provided.
See Also
Working with Video Descriptions
CMImageDescriptionFlavorCMVideoFormatDescriptionCreate(allocator:codecType:width:height:extensions:formatDescriptionOut:)CMVideoFormatDescriptionCreateForImageBuffer(allocator:imageBuffer:formatDescriptionOut:)CMVideoFormatDescriptionGetCleanAperture(_:originIsAtTopLeft:)CMVideoFormatDescriptionGetDimensions(_:)CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers()CMVideoFormatDescriptionGetPresentationDimensions(_:usePixelAspectRatio:useCleanAperture:)CMVideoFormatDescriptionMatchesImageBuffer(_:imageBuffer:)CMVideoFormatDescriptionCreateFromHEVCParameterSets(allocator:parameterSetCount:parameterSetPointers:parameterSetSizes:nalUnitHeaderLength:extensions:formatDescriptionOut:)CMVideoFormatDescriptionGetH264ParameterSetAtIndex(_:parameterSetIndex:parameterSetPointerOut:parameterSetSizeOut:parameterSetCountOut:nalUnitHeaderLengthOut:)CMVideoFormatDescriptionCopyAsBigEndianImageDescriptionBlockBuffer(allocator:videoFormatDescription:stringEncoding:flavor:blockBufferOut:)CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionBlockBuffer(allocator:bigEndianImageDescriptionBlockBuffer:stringEncoding:flavor:formatDescriptionOut:)CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionData(allocator:bigEndianImageDescriptionData:size:stringEncoding:flavor:formatDescriptionOut:)CMSwapBigEndianImageDescriptionToHost(_:_:)CMSwapHostEndianImageDescriptionToBig(_:_:)