Function

CMVideoFormatDescriptionCreateFromH264ParameterSets

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

Declaration

OSStatus CMVideoFormatDescriptionCreateFromH264ParameterSets(CFAllocatorRef allocator, size_t parameterSetCount, const uint8_t *const  _Nonnull *parameterSetPointers, const size_t *parameterSetSizes, int NALUnitHeaderLength, CMFormatDescriptionRef  _Nullable *formatDescriptionOut);

Parameters

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

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.

CMVideoFormatDescriptionGetH264ParameterSetAtIndex

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

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.