Contents

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?>) -> OSStatus

Parameters

  • allocator:

    The CFAllocator for creating the format description, or pass nil to 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 parameterSetCount pointers 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 NALUnitLength field in an AVC video sample or an AVC parameter set sample. Pass 1, 2, or 4.

  • 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