CMVideoFormatDescriptionCopyAsBigEndianImageDescriptionBlockBuffer
and
CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionBlockBuffer
seem like some useful utilities, but... they are not acting the way I expected. In my mind I should be able to pass the first a CMVideoFormatDescription then pass the created CMBlockBuffer to the second and get out a CMVideoFormatDescription that matches the first CMVideoFormatDescription. I don't. Am I misunderstanding what these utilities are for? Here are printouts of the original CMVideoFormatDescription:
<CMVideoFormatDescription 0x600000ca7330 [0x7fff8d24f7d0]> {
mediaType:'vide'
mediaSubType:'avc1'
mediaSpecific: {
codecType: 'avc1' dimensions: 1280 x 720
}
extensions: {{
CVImageBufferColorPrimaries = "ITU_R_709_2";
CVImageBufferTransferFunction = "ITU_R_709_2";
CVImageBufferYCbCrMatrix = "ITU_R_709_2";
CVPixelAspectRatio = {
HorizontalSpacing = 1;
VerticalSpacing = 1;
};
FormatName = "H.264";
SampleDescriptionExtensionAtoms = {
avcC = {length = 42, bytes = 0x014d0020 ffe1001b 274d0020 898b6028 ... 40010004 28ee1f20 };
};
}}
}
and the copy via the utilities:
<CMVideoFormatDescription 0x600000cb40c0 [0x7fff8d24f7d0]> {
mediaType:'vide'
mediaSubType:'avc1'
mediaSpecific: {
codecType: 'avc1' dimensions: 1280 x 720
}
extensions: {{
CVFieldCount = 1;
CVImageBufferChromaLocationBottomField = Left;
CVImageBufferChromaLocationTopField = Left;
CVImageBufferColorPrimaries = "ITU_R_709_2";
CVImageBufferTransferFunction = "ITU_R_709_2";
CVImageBufferYCbCrMatrix = "ITU_R_709_2";
CVPixelAspectRatio = {
HorizontalSpacing = 1;
VerticalSpacing = 1;
};
Depth = 24;
FormatName = "'avc1'";
FullRangeVideo = 0;
RevisionLevel = 0;
SampleDescriptionExtensionAtoms = {
avcC = {length = 42, bytes = 0x014d0020 ffe1001b 274d0020 898b6028 ... 40010004 28ee1f20 };
};
SpatialQuality = 0;
TemporalQuality = 0;
VerbatimISOSampleEntry = {length = 171, bytes = 0x000000ab 61766331 00000000 0000ffff ... 00000001 00000001 };
Version = 0;
}}
}