I have submitted a TSI with apple and found the answer. I hope this saves someone time in the future.
The CMSampleBuffers have associated with them a CMFormatDescription, which contains a description of the data in the sample buffer.
The function prototype for creating the format description is as follows:
OSStatus CMVideoFormatDescriptionCreate (
CFAllocatorRef allocator,
CMVideoCodecType codecType,
int32_t width,
int32_t height,
CFDictionaryRef extensions,
CMVideoFormatDescriptionRef *outDesc
);
I learned, from the Apple technician, that I can use the extensions argument to pass in a dictionary containing the avcC atom data.
The extensions dictionary should be of the following form:
[kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms ---> ["avcC" ---> <avcC Data>]]
The []'s represent dictionaries. This dictionary can potentially be used to pass in data for arbitrary atoms aside from avcC.
Here is the code I used to create the extensions
dictionary that I pass into CMVideoFormatDescriptionCreate
:
const char *avcC = "avcC";
const CFStringRef avcCKey = CFStringCreateWithCString(kCFAllocatorDefault, avcC, kCFStringEncodingUTF8);
const CFDataRef avcCValue = CFDataCreate(kCFAllocatorDefault, [_avccData bytes], [_avccData length]);
const void *atomDictKeys[] = { avcCKey };
const void *atomDictValues[] = { avcCValue };
CFDictionaryRef atomsDict = CFDictionaryCreate(kCFAllocatorDefault, atomDictKeys, atomDictValues, 1, nil, nil);
const void *extensionDictKeys[] = { kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms };
const void *extensionDictValues[] = { atomsDict };
CFDictionaryRef extensionDict = CFDictionaryCreate(kCFAllocatorDefault, extensionDictKeys, extensionDictValues, 1, nil, nil);