CMVideoFormatDescriptionCreateFromHEVCParameterSets(allocator:parameterSetCount:parameterSetPointers:parameterSetSizes:nalUnitHeaderLength:extensions:formatDescriptionOut:)
Creates a format description for a video media stream using HEVC (H.265) parameter set NAL units.
Declaration
func CMVideoFormatDescriptionCreateFromHEVCParameterSets(allocator: CFAllocator?, parameterSetCount: Int, parameterSetPointers: UnsafePointer<UnsafePointer<UInt8>>, parameterSetSizes: UnsafePointer<Int>, nalUnitHeaderLength NALUnitHeaderLength: Int32, extensions: CFDictionary?, formatDescriptionOut: UnsafeMutablePointer<CMFormatDescription?>) -> OSStatusParameters
- allocator:
The
CFAllocatorfor creating the format description, or passnilto use the default allocator. - parameterSetCount:
The number of parameter sets to include in the format description, which needs to be at least
2. - parameterSetPointers:
Points to a C array containing
parameterSetCountpointers to parameter sets. - parameterSetSizes:
Points to a C array containing the size, in bytes, of each of the parameter sets.
- NALUnitHeaderLength:
The size, in bytes, of the
NALUnitLengthfield in an AVC video sample or an AVC parameter set sample. Pass1,2, or4. - extensions:
An optional dictionary of extension key-value pairs. Keys are Cfstring and values are property list objects, such as Cfdata, Cfboolean, Cfnumber, Cfstring, Cfdate, Cfarray, and Cfdictionary.
- formatDescriptionOut:
The newly created video format description.
Discussion
This method parses the dimensions from the parameter sets and creates a format description suitable for an HEVC (H.265) stream. The parameter sets’ data can come from raw NAL units and needs to include emulation prevention bytes as necessary.
The supported NAL unit types to include in the format description are:
7 | Sequence parameter set |
|---|---|
8 | Picture parameter set |
13 | Sequence parameter set extension |
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:)CMVideoFormatDescriptionCreateFromH264ParameterSets(allocator:parameterSetCount:parameterSetPointers:parameterSetSizes:nalUnitHeaderLength: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(_:_:)