---
title: "CMFormatDescriptionGetExtension(_:extensionKey:)"
framework: coremedia
role: symbol
role_heading: Function
path: "coremedia/cmformatdescriptiongetextension(_:extensionkey:)"
---

# CMFormatDescriptionGetExtension(_:extensionKey:)

Returns an extension from the format description by using an extension key.

## Declaration

```swift
func CMFormatDescriptionGetExtension(_ desc: CMFormatDescription, extensionKey: CFString) -> CFPropertyList?
```

## Parameters

- `desc`: The CMFormatDescription to examine.
- `extensionKey`: The key of the extension to return. May not be NULL.

## Return Value

Return Value An extension, or NULL if it doesn’t exist.

## Discussion

Discussion The extension is always a valid property list object. This means that it will be either a CFNumber, CFString, CFBoolean, CFArray, CFDictionary, CFDate, or CFData. If it’s a CFDictionary, the keys will all be CFStrings. The extension this function returns is not retained by this call, so it’s only valid as long as the CMFormatDescription is valid — retain it to keep it longer.

## See Also

### Inspecting Format Descriptions

- [CMFormatDescriptionGetMediaType(_:)](coremedia/cmformatdescriptiongetmediatype(_:).md)
- [CMFormatDescriptionGetMediaSubType(_:)](coremedia/cmformatdescriptiongetmediasubtype(_:).md)
- [CMFormatDescriptionGetExtensions(_:)](coremedia/cmformatdescriptiongetextensions(_:).md)
- [CMFormatDescriptionGetTypeID()](coremedia/cmformatdescriptiongettypeid().md)
