Skip to content

Commit 4ddfd41

Browse files
committed
[VideoToolbox] Update to Xcode 26 beta 1-7.
TODO: * remove cwls in tests. * split out CG*Dictionaries. * split out DictionaryContainer upgrades. * review Fixes #17394.
1 parent ea1e31f commit 4ddfd41

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2461
-1306
lines changed

docs/api/VideoToolbox.VTCompressionSession/VTCompressionOutputCallback.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs/api/VideoToolbox/VTCompressionSession.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/api/VideoToolbox/VTDecompressionSession.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/CoreGraphics/CGPointDictionary.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ public class CGPointDictionary : DictionaryContainer {
1010
#if !COREBUILD
1111
/// <summary>Creates a new <see cref="CGPointDictionary" /> with default (empty) values.</summary>
1212
[Preserve (Conditional = true)]
13-
public CGPointDictionary () : base (new NSMutableDictionary ()) {}
13+
public CGPointDictionary () : base (new NSMutableDictionary ()) { }
1414

1515
/// <summary>Creates a new <see cref="CGPointDictionary" /> from the values that are specified in <paramref name="dictionary" />.</summary>
1616
/// <param name="dictionary">The dictionary to use to populate the properties of this type.</param>
1717
[Preserve (Conditional = true)]
18-
public CGPointDictionary (NSDictionary? dictionary) : base (dictionary) {}
18+
public CGPointDictionary (NSDictionary? dictionary) : base (dictionary) { }
1919

2020
/// <summary>The X component of the <see cref="CGPoint" />.</summary>
2121
public nfloat? X {

src/CoreGraphics/CGRectDictionary.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ public class CGRectDictionary : DictionaryContainer {
1010
#if !COREBUILD
1111
/// <summary>Creates a new <see cref="CGRectDictionary" /> with default (empty) values.</summary>
1212
[Preserve (Conditional = true)]
13-
public CGRectDictionary () : base (new NSMutableDictionary ()) {}
13+
public CGRectDictionary () : base (new NSMutableDictionary ()) { }
1414

1515
/// <summary>Creates a new <see cref="CGRectDictionary" /> from the values that are specified in <paramref name="dictionary" />.</summary>
1616
/// <param name="dictionary">The dictionary to use to populate the properties of this type.</param>
1717
[Preserve (Conditional = true)]
18-
public CGRectDictionary (NSDictionary? dictionary) : base (dictionary) {}
18+
public CGRectDictionary (NSDictionary? dictionary) : base (dictionary) { }
1919

2020
/// <summary>The X component of the <see cref="CGPoint" />.</summary>
2121
public nfloat? X {

src/CoreGraphics/CGSizeDictionary.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ public class CGSizeDictionary : DictionaryContainer {
1010
#if !COREBUILD
1111
/// <summary>Creates a new <see cref="CGSizeDictionary" /> with default (empty) values.</summary>
1212
[Preserve (Conditional = true)]
13-
public CGSizeDictionary () : base (new NSMutableDictionary ()) {}
13+
public CGSizeDictionary () : base (new NSMutableDictionary ()) { }
1414

1515
/// <summary>Creates a new <see cref="CGSizeDictionary" /> from the values that are specified in <paramref name="dictionary" />.</summary>
1616
/// <param name="dictionary">The dictionary to use to populate the properties of this type.</param>
1717
[Preserve (Conditional = true)]
18-
public CGSizeDictionary (NSDictionary? dictionary) : base (dictionary) {}
18+
public CGSizeDictionary (NSDictionary? dictionary) : base (dictionary) { }
1919

2020
/// <summary>The width component of the <see cref="CGSize" />.</summary>
2121
public nfloat? Width {

src/CoreMedia/CMFormatDescription.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,44 @@ public bool VideoMatchesImageBuffer (CVImageBuffer imageBuffer)
770770

771771
return arr;
772772
}
773+
774+
[SupportedOSPlatform ("ios17.0")]
775+
[SupportedOSPlatform ("macos14.0")]
776+
[SupportedOSPlatform ("tvos17.0")]
777+
[SupportedOSPlatform ("maccatalyst17.0")]
778+
[DllImport (Constants.CoreMediaLibrary)]
779+
unsafe static extern /* OSStatus */ CMFormatDescriptionError CMVideoFormatDescriptionCopyTagCollectionArray (
780+
IntPtr /* CMVideoFormatDescriptionRef CM_NONNULL */ formatDescription,
781+
IntPtr* /* CM_RETURNS_RETAINED_PARAMETER CFArrayRef CM_NULLABLE * */ tagCollectionsOut);
782+
783+
/// <summary>Get any multi-image properties as an array of <see cref="CMTagCollection" /> values.</summary>
784+
/// <param name="tagCollections">Upon output, and if successful, the format description's array of <see cref="CMTagCollection" /> values.</param>
785+
/// <returns><see cref="CMFormatDescriptionError.None" /> if succcessful, or an error code otherwise.</returns>
786+
public CMFormatDescriptionError GetTagCollections (out CMTagCollection []? tagCollections)
787+
{
788+
IntPtr array;
789+
CMFormatDescriptionError rv;
790+
791+
tagCollections = null;
792+
793+
unsafe {
794+
rv = CMVideoFormatDescriptionCopyTagCollectionArray (GetCheckedHandle (), &array);
795+
}
796+
797+
if (rv == CMFormatDescriptionError.None)
798+
tagCollections = CFArray.ArrayFromHandleFunc<CMTagCollection> (array, (h) => new CMTagCollection (h, false), releaseHandle: true)!;
799+
800+
return rv;
801+
}
802+
803+
/// <summary>Get any multi-image properties as an array of <see cref="CMTagCollection" /> values.</summary>
804+
public CMTagCollection []? TagCollections {
805+
get {
806+
GetTagCollections (out var tagCollections);
807+
return tagCollections;
808+
}
809+
}
810+
773811
#endif
774812
}
775813
}

src/CoreMedia/CoreMedia.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,5 +281,11 @@ public CMVideoDimensions (int width, int height)
281281
Width = width;
282282
Height = height;
283283
}
284+
285+
/// <inheritdoc />
286+
public override string ToString ()
287+
{
288+
return $"[{Width}, {Height}]";
289+
}
284290
}
285291
}

src/Foundation/DictionaryContainer.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ protected DictionaryContainer (NSDictionary? dictionary)
109109
/// <value>The wrapped <see cref="NSDictionary" />.</value>
110110
public NSDictionary Dictionary { get; private set; }
111111

112-
static T? Create<T> (NativeHandle handle) where T: DictionaryContainer, new()
112+
static T? Create<T> (NativeHandle handle) where T : DictionaryContainer, new()
113113
{
114114
if (handle == NativeHandle.Zero)
115115
return null;
@@ -155,7 +155,7 @@ protected bool TryGetNSObject<T> (NSString key, [NotNullWhen (true)] out T? @obj
155155
return true;
156156
}
157157

158-
T? GetNSObject<T> (NSString key) where T: NSObject
158+
T? GetNSObject<T> (NSString key) where T : NSObject
159159
{
160160
if (!TryGetNSObject<T> (key, out var value))
161161
return null;
@@ -227,7 +227,7 @@ bool TryGetNativeValue (NativeHandle key, out NativeHandle value)
227227
/// <summary>Retrieves the <see cref="DictionaryContainer" /> array associeted with <paramref name="key" />.</summary>
228228
/// <param name="key">The identifier of the value to get.</param>
229229
/// <returns>The <see cref="DictionaryContainer" /> array associeted with <paramref name="key" />.</returns>
230-
protected T []? GetArrayOfDictionariesValue<T> (NSString key) where T: DictionaryContainer, new()
230+
protected T []? GetArrayOfDictionariesValue<T> (NSString key) where T : DictionaryContainer, new()
231231
{
232232
if (!TryGetNativeValue (key, out var value))
233233
return null;
@@ -464,7 +464,7 @@ bool TryGetNativeValue (NativeHandle key, out NativeHandle value)
464464
/// <typeparam name="T">The value type stored in the type <see cref="NSData" />.</typeparam>
465465
/// <param name="key">The identifier of the value to get.</param>
466466
/// <returns>The value type initialized from the data in the <see cref="NSData" />, or <see langword="null" /> if the specified <paramref name="key" /> is not present in this dictionary.</returns>
467-
protected T? GetNSDataAsValueType<T> (NSString key) where T: unmanaged
467+
protected T? GetNSDataAsValueType<T> (NSString key) where T : unmanaged
468468
{
469469
if (!TryGetNSObject<NSData> (key, out var data))
470470
return null;
@@ -475,11 +475,11 @@ bool TryGetNativeValue (NativeHandle key, out NativeHandle value)
475475
/// <typeparam name="T">The value type stored in the type <see cref="NSData" />.</typeparam>
476476
/// <param name="key">The identifier of the value to get.</param>
477477
/// <param name="value">The value to store in the <see cref="NSData" />.</param>
478-
protected void SetValueTypeAsNSData<T> (NSString key, T? value) where T: unmanaged
478+
protected void SetValueTypeAsNSData<T> (NSString key, T? value) where T : unmanaged
479479
{
480480
if (key is null)
481481
throw new ArgumentNullException (nameof (key));
482-
482+
483483
var data = NSData.CreateFromValueType<T> (value);
484484
SetNativeValue (key, data);
485485
}
@@ -600,7 +600,7 @@ protected void SetValueTypeAsNSData<T> (NSString key, T? value) where T: unmanag
600600
}
601601
#endif
602602

603-
bool NullCheckValueTypeAndRemoveKey<T> ([NotNullWhen (true)] NSString key, [NotNullWhen (true)] T? valueType) where T: struct
603+
bool NullCheckValueTypeAndRemoveKey<T> ([NotNullWhen (true)] NSString key, [NotNullWhen (true)] T? valueType) where T : struct
604604
{
605605
if (key is null)
606606
throw new ArgumentNullException (nameof (key));

src/Foundation/NSIndexSet.cs

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2323
//
2424

25-
#if MONOMAC
26-
2725
using System;
2826
using System.Reflection;
2927
using System.Collections;
@@ -35,10 +33,6 @@
3533
namespace Foundation {
3634

3735
public partial class NSIndexSet : IEnumerable, IEnumerable<nuint> {
38-
39-
/// <summary>To be added.</summary>
40-
/// <returns>To be added.</returns>
41-
/// <remarks>To be added.</remarks>
4236
IEnumerator IEnumerable.GetEnumerator ()
4337
{
4438
if (this.Count == 0)
@@ -63,9 +57,8 @@ public IEnumerator<nuint> GetEnumerator ()
6357
}
6458
}
6559

66-
/// <summary>To be added.</summary>
67-
/// <returns>To be added.</returns>
68-
/// <remarks>To be added.</remarks>
60+
/// <summary>Get all the indices in this index set as an array.</summary>
61+
/// <returns>An array of all the indices in this index set.</returns>
6962
public nuint [] ToArray ()
7063
{
7164
nuint [] indexes = new nuint [Count];
@@ -81,7 +74,7 @@ public nuint [] ToArray ()
8174
return indexes;
8275
}
8376

84-
internal T [] ToInt64EnumArray<T> () where T: System.Enum
77+
internal T [] ToInt64EnumArray<T> () where T : System.Enum
8578
{
8679
var array = ToArray ();
8780
var rv = new T [array.Length];
@@ -90,7 +83,7 @@ internal T [] ToInt64EnumArray<T> () where T: System.Enum
9083
return rv;
9184
}
9285

93-
internal HashSet<T> ToInt64EnumHashSet<T> () where T: System.Enum
86+
internal HashSet<T> ToInt64EnumHashSet<T> () where T : System.Enum
9487
{
9588
var array = ToArray ();
9689
var rv = new HashSet<T> ();
@@ -99,10 +92,9 @@ internal HashSet<T> ToInt64EnumHashSet<T> () where T: System.Enum
9992
return rv;
10093
}
10194

102-
/// <param name="items">To be added.</param>
103-
/// <summary>To be added.</summary>
104-
/// <returns>To be added.</returns>
105-
/// <remarks>To be added.</remarks>
95+
/// <summary>Create a new <see cref="NSIndexSet" /> instance from an array of indices.</summary>
96+
/// <param name="items">The indices to add to the new <see cref="NSIndexSet" />.</param>
97+
/// <returns>A new <see cref="NSIndexSet" /> with the specified indices.</returns>
10698
public static NSIndexSet FromArray (nuint [] items)
10799
{
108100
if (items is null)
@@ -114,10 +106,9 @@ public static NSIndexSet FromArray (nuint [] items)
114106
return indexSet;
115107
}
116108

117-
/// <param name="items">To be added.</param>
118-
/// <summary>To be added.</summary>
119-
/// <returns>To be added.</returns>
120-
/// <remarks>To be added.</remarks>
109+
/// <summary>Create a new <see cref="NSIndexSet" /> instance from an array of indices.</summary>
110+
/// <param name="items">The indices to add to the new <see cref="NSIndexSet" />.</param>
111+
/// <returns>A new <see cref="NSIndexSet" /> with the specified indices.</returns>
121112
public static NSIndexSet FromArray (uint [] items)
122113
{
123114
if (items is null)
@@ -129,10 +120,9 @@ public static NSIndexSet FromArray (uint [] items)
129120
return indexSet;
130121
}
131122

132-
/// <param name="items">To be added.</param>
133-
/// <summary>To be added.</summary>
134-
/// <returns>To be added.</returns>
135-
/// <remarks>To be added.</remarks>
123+
/// <summary>Create a new <see cref="NSIndexSet" /> instance from an array of indices.</summary>
124+
/// <param name="items">The indices to add to the new <see cref="NSIndexSet" />.</param>
125+
/// <returns>A new <see cref="NSIndexSet" /> with the specified indices.</returns>
136126
public static NSIndexSet FromArray (int [] items)
137127
{
138128
if (items is null)
@@ -147,23 +137,26 @@ public static NSIndexSet FromArray (int [] items)
147137
return indexSet;
148138
}
149139

150-
/// <param name="value">To be added.</param>
151-
/// <summary>To be added.</summary>
152-
/// <remarks>To be added.</remarks>
140+
/// <summary>Create a new <see cref="NSIndexSet" /> instance with the specified index.</summary>
141+
/// <param name="value">The index to add to the new <see cref="NSIndexSet" />.</param>
142+
/// <returns>A new <see cref="NSIndexSet" /> with the specified index.</returns>
153143
public NSIndexSet (uint value) : this ((nuint) value)
154144
{
155145
}
156146

147+
/// <summary>Create a new <see cref="NSIndexSet" /> instance with the specified index.</summary>
148+
/// <param name="value">The index to add to the new <see cref="NSIndexSet" />.</param>
149+
/// <returns>A new <see cref="NSIndexSet" /> with the specified index.</returns>
157150
public NSIndexSet (nint value) : this ((nuint) value)
158151
{
159152
if (value < 0)
160153
throw new ArgumentException ("value must be positive");
161154
// init done by the base ctor
162155
}
163156

164-
/// <param name="value">To be added.</param>
165-
/// <summary>To be added.</summary>
166-
/// <remarks>To be added.</remarks>
157+
/// <summary>Create a new <see cref="NSIndexSet" /> instance with the specified index.</summary>
158+
/// <param name="value">The index to add to the new <see cref="NSIndexSet" />.</param>
159+
/// <returns>A new <see cref="NSIndexSet" /> with the specified index.</returns>
167160
public NSIndexSet (int value) : this ((nuint) (uint) value)
168161
{
169162
if (value < 0)
@@ -172,5 +165,3 @@ public NSIndexSet (int value) : this ((nuint) (uint) value)
172165
}
173166
}
174167
}
175-
176-
#endif

0 commit comments

Comments
 (0)