Skip to content

Commit 22ededc

Browse files
authored
[CoreMedia] Improve CMFormatDescription.SubType properties. Fixes #23217. (#23262)
Any CMPixelFormat value is also a valid CMVideoCodecType value, so duplicate the values in CMPixelFormat into CMVideoCodecType. This helps discovery/intellisense. Also add a CMMediaSubType enum that mirrors the Swift type with the same name, which can be used to improve discovery/intellisense as well. Additionally, fix a few other issues as well. Fixes #23217.
1 parent 9d442a1 commit 22ededc

File tree

4 files changed

+362
-45
lines changed

4 files changed

+362
-45
lines changed

src/AudioToolbox/AudioType.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,14 @@ public enum AudioFormatType : uint { // UInt32 in AudioStreamBasicDescription --
4848
LinearPCM = 0x6c70636d,
4949
/// <summary>AC-3 codec.</summary>
5050
AC3 = 0x61632d33,
51+
#if !XAMCORE_5_0
5152
/// <summary>CAC-3 codec.</summary>
53+
[Obsolete ("Use 'AC3_60958' instead.")]
54+
[EditorBrowsable (EditorBrowsableState.Never)]
5255
CAC3 = 0x63616333,
56+
#endif
57+
/// <summary>The AC-3 codec, packaged to be compliant with an IEC 60958-compliant digital audio interface.</summary>
58+
AC3_60958 = 0x63616333, // 'cac3'
5359
/// <summary>Apple's IMA 4:1 ADPCM codec.</summary>
5460
AppleIMA4 = 0x696d6134,
5561
/// <summary>MPEG-4 AAC codec.</summary>
@@ -140,6 +146,8 @@ public enum AudioFormatType : uint { // UInt32 in AudioStreamBasicDescription --
140146
[SupportedOSPlatform ("tvos18.0")]
141147
[SupportedOSPlatform ("maccatalyst18.0")]
142148
Apac = 0x61706163, // 'apac'
149+
150+
// any new entries here might need new entries in the CMMediaSubType enum as well
143151
}
144152

145153
/// <summary>Flags describing the stream in the <see cref="AudioToolbox.AudioStreamBasicDescription" />.</summary>

0 commit comments

Comments
 (0)