Skip to content

Commit e748805

Browse files
authored
[CoreVideo] Remove !NET code. (#22158)
1 parent ddd5c54 commit e748805

17 files changed

+2
-438
lines changed

src/CoreVideo/CVDisplayLink.cs

Lines changed: 0 additions & 237 deletions
Large diffs are not rendered by default.

src/CoreVideo/CVImageBuffer.cs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,15 @@
3232
using Foundation;
3333
using CoreGraphics;
3434

35-
#if !NET
36-
using NativeHandle = System.IntPtr;
37-
#endif
38-
3935
#nullable enable
4036

4137
namespace CoreVideo {
4238

4339
// CVImageBuffer.h
44-
#if NET
4540
[SupportedOSPlatform ("ios")]
4641
[SupportedOSPlatform ("maccatalyst")]
4742
[SupportedOSPlatform ("macos")]
4843
[SupportedOSPlatform ("tvos")]
49-
#endif
5044
public partial class CVImageBuffer : CVBuffer {
5145
#if !COREBUILD
5246
[Preserve (Conditional = true)]
@@ -96,16 +90,11 @@ public bool IsFlipped {
9690
[DllImport (Constants.CoreVideoLibrary)]
9791
extern static /* CGColorSpaceRef */ IntPtr CVImageBufferGetColorSpace (/* CVImageBufferRef */ IntPtr imageBuffer);
9892

99-
#if NET
10093
[UnsupportedOSPlatform ("maccatalyst")]
10194
[UnsupportedOSPlatform ("tvos")]
10295
[UnsupportedOSPlatform ("ios")]
10396
[SupportedOSPlatform ("macos")]
10497
[ObsoletedOSPlatform ("macos10.4")]
105-
#else
106-
[Deprecated (PlatformName.MacOSX, 10, 4)]
107-
[Unavailable (PlatformName.iOS)]
108-
#endif
10998
public CGColorSpace? ColorSpace {
11099
get {
111100
var h = CVImageBufferGetColorSpace (Handle);
@@ -127,123 +116,99 @@ public CGColorSpace? ColorSpace {
127116
}
128117
#endif
129118

130-
#if NET
131119
[SupportedOSPlatform ("ios")]
132120
[SupportedOSPlatform ("macos")]
133121
[SupportedOSPlatform ("tvos")]
134122
[SupportedOSPlatform ("maccatalyst")]
135-
#endif
136123
[DllImport (Constants.CoreVideoLibrary)]
137124
extern static int CVYCbCrMatrixGetIntegerCodePointForString (IntPtr yCbCrMatrixString);
138125

139-
#if NET
140126
[SupportedOSPlatform ("ios")]
141127
[SupportedOSPlatform ("macos")]
142128
[SupportedOSPlatform ("tvos")]
143129
[SupportedOSPlatform ("maccatalyst")]
144-
#endif
145130
public static int GetCodePoint (CVImageBufferYCbCrMatrix yCbCrMatrix)
146131
{
147132
return CVYCbCrMatrixGetIntegerCodePointForString (yCbCrMatrix.GetConstant ()!.Handle);
148133
}
149134

150-
#if NET
151135
[SupportedOSPlatform ("ios")]
152136
[SupportedOSPlatform ("macos")]
153137
[SupportedOSPlatform ("tvos")]
154138
[SupportedOSPlatform ("maccatalyst")]
155-
#endif
156139
[DllImport (Constants.CoreVideoLibrary)]
157140
extern static int CVColorPrimariesGetIntegerCodePointForString (IntPtr colorPrimariesString);
158141

159-
#if NET
160142
[SupportedOSPlatform ("ios")]
161143
[SupportedOSPlatform ("macos")]
162144
[SupportedOSPlatform ("tvos")]
163145
[SupportedOSPlatform ("maccatalyst")]
164-
#endif
165146
public static int GetCodePoint (CVImageBufferColorPrimaries color)
166147
{
167148
return CVColorPrimariesGetIntegerCodePointForString (color.GetConstant ()!.Handle);
168149
}
169150

170-
#if NET
171151
[SupportedOSPlatform ("ios")]
172152
[SupportedOSPlatform ("macos")]
173153
[SupportedOSPlatform ("tvos")]
174154
[SupportedOSPlatform ("maccatalyst")]
175-
#endif
176155
[DllImport (Constants.CoreVideoLibrary)]
177156
extern static int CVTransferFunctionGetIntegerCodePointForString (IntPtr colorPrimariesString);
178157

179-
#if NET
180158
[SupportedOSPlatform ("ios")]
181159
[SupportedOSPlatform ("macos")]
182160
[SupportedOSPlatform ("tvos")]
183161
[SupportedOSPlatform ("maccatalyst")]
184-
#endif
185162
public static int GetCodePoint (CVImageBufferTransferFunction function)
186163
{
187164
return CVTransferFunctionGetIntegerCodePointForString (function.GetConstant ()!.Handle);
188165
}
189166

190-
#if NET
191167
[SupportedOSPlatform ("ios")]
192168
[SupportedOSPlatform ("macos")]
193169
[SupportedOSPlatform ("tvos")]
194170
[SupportedOSPlatform ("maccatalyst")]
195-
#endif
196171
[DllImport (Constants.CoreVideoLibrary)]
197172
extern static IntPtr CVYCbCrMatrixGetStringForIntegerCodePoint (int yCbCrMatrixCodePoint);
198173

199-
#if NET
200174
[SupportedOSPlatform ("ios")]
201175
[SupportedOSPlatform ("macos")]
202176
[SupportedOSPlatform ("tvos")]
203177
[SupportedOSPlatform ("maccatalyst")]
204-
#endif
205178
public static CVImageBufferYCbCrMatrix GetYCbCrMatrixOption (int yCbCrMatrixCodePoint)
206179
{
207180
var ret = Runtime.GetNSObject<NSString> (CVYCbCrMatrixGetStringForIntegerCodePoint (yCbCrMatrixCodePoint));
208181
return CVImageBufferYCbCrMatrixExtensions.GetValue (ret);
209182
}
210183

211-
#if NET
212184
[SupportedOSPlatform ("ios")]
213185
[SupportedOSPlatform ("macos")]
214186
[SupportedOSPlatform ("tvos")]
215187
[SupportedOSPlatform ("maccatalyst")]
216-
#endif
217188
[DllImport (Constants.CoreVideoLibrary)]
218189
extern static IntPtr CVColorPrimariesGetStringForIntegerCodePoint (int colorPrimariesCodePoint);
219190

220-
#if NET
221191
[SupportedOSPlatform ("ios")]
222192
[SupportedOSPlatform ("macos")]
223193
[SupportedOSPlatform ("tvos")]
224194
[SupportedOSPlatform ("maccatalyst")]
225-
#endif
226195
public static CVImageBufferColorPrimaries GetColorPrimariesOption (int colorPrimariesCodePoint)
227196
{
228197
var ret = Runtime.GetNSObject<NSString> (CVColorPrimariesGetStringForIntegerCodePoint (colorPrimariesCodePoint));
229198
return CVImageBufferColorPrimariesExtensions.GetValue (ret);
230199
}
231200

232-
#if NET
233201
[SupportedOSPlatform ("ios")]
234202
[SupportedOSPlatform ("macos")]
235203
[SupportedOSPlatform ("tvos")]
236204
[SupportedOSPlatform ("maccatalyst")]
237-
#endif
238205
[DllImport (Constants.CoreVideoLibrary)]
239206
extern static IntPtr CVTransferFunctionGetStringForIntegerCodePoint (int transferFunctionCodePoint);
240207

241-
#if NET
242208
[SupportedOSPlatform ("ios")]
243209
[SupportedOSPlatform ("macos")]
244210
[SupportedOSPlatform ("tvos")]
245211
[SupportedOSPlatform ("maccatalyst")]
246-
#endif
247212
public static CVImageBufferTransferFunction GetTransferFunctionOption (int transferFunctionCodePoint)
248213
{
249214
var ret = Runtime.GetNSObject<NSString> (CVTransferFunctionGetStringForIntegerCodePoint (transferFunctionCodePoint));

src/CoreVideo/CVMetalBuffer.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,16 @@
77
using Metal;
88
using ObjCRuntime;
99

10-
#if !NET
11-
using NativeHandle = System.IntPtr;
12-
#endif
13-
1410
#nullable enable
1511

1612
namespace CoreVideo {
1713

1814
/// <summary>A CVPixelBuffer wrapped in a Metal based buffer.</summary>
1915
/// <remarks>This type is used to provide buffers to Metal.</remarks>
20-
#if NET
2116
[SupportedOSPlatform ("ios18.0")]
2217
[SupportedOSPlatform ("maccatalyst18.0")]
2318
[SupportedOSPlatform ("macos15.0")]
2419
[SupportedOSPlatform ("tvos18.0")]
25-
#else
26-
[TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
27-
#endif
2820
public class CVMetalBuffer : CVBuffer {
2921
#if !COREBUILD
3022
[Preserve (Conditional = true)]

src/CoreVideo/CVMetalBufferCache.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,15 @@
1010
using Metal;
1111
using ObjCRuntime;
1212

13-
#if !NET
14-
using NativeHandle = System.IntPtr;
15-
#endif
16-
1713
#nullable enable
1814

1915
namespace CoreVideo {
2016

2117
/// <summary>A cache used to manage <see cref="CVMetalBuffer" /> instances.</summary>
22-
#if NET
2318
[SupportedOSPlatform ("ios18.0")]
2419
[SupportedOSPlatform ("maccatalyst18.0")]
2520
[SupportedOSPlatform ("macos15.0")]
2621
[SupportedOSPlatform ("tvos18.0")]
27-
#else
28-
[TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
29-
#endif
3022
public class CVMetalBufferCache : NativeObject {
3123
#if !COREBUILD
3224
[Preserve (Conditional = true)]

src/CoreVideo/CVMetalTexture.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,14 @@
1616
using Foundation;
1717
using Metal;
1818

19-
#if !NET
20-
using NativeHandle = System.IntPtr;
21-
#endif
22-
2319
#nullable enable
2420

2521
namespace CoreVideo {
2622

27-
#if NET
2823
[SupportedOSPlatform ("ios")]
2924
[SupportedOSPlatform ("macos")]
3025
[SupportedOSPlatform ("maccatalyst")]
3126
[SupportedOSPlatform ("tvos")]
32-
#else
33-
[MacCatalyst (15, 0)]
34-
#endif
3527
public class CVMetalTexture : NativeObject {
3628
[Preserve (Conditional = true)]
3729
internal CVMetalTexture (NativeHandle handle, bool owns)

src/CoreVideo/CVMetalTextureCache.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
using Foundation;
1616
using Metal;
1717

18-
#if !NET
19-
using NativeHandle = System.IntPtr;
20-
#endif
21-
2218
#nullable enable
2319

2420
namespace CoreVideo {

src/CoreVideo/CVOpenGLESTexture.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,10 @@
2727
namespace CoreVideo {
2828

2929
// CVOpenGLESTexture.h
30-
#if NET
3130
[SupportedOSPlatform ("tvos")]
3231
[SupportedOSPlatform ("ios")]
3332
[ObsoletedOSPlatform ("tvos12.0", "Use 'CVMetalTexture' instead.")]
3433
[ObsoletedOSPlatform ("ios12.0", "Use 'CVMetalTexture' instead.")]
35-
#else
36-
[Deprecated (PlatformName.iOS, 12,0, message: "Use 'CVMetalTexture' instead.")]
37-
[Deprecated (PlatformName.TvOS, 12,0, message: "Use 'CVMetalTexture' instead.")]
38-
#endif
3934
public class CVOpenGLESTexture : INativeObject, IDisposable {
4035

4136
internal IntPtr handle;

src/CoreVideo/CVOpenGLESTextureCache.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,10 @@
2626
namespace CoreVideo {
2727

2828
// CVOpenGLESTextureCache.h
29-
#if NET
3029
[SupportedOSPlatform ("tvos")]
3130
[SupportedOSPlatform ("ios")]
3231
[ObsoletedOSPlatform ("tvos12.0", "Use 'CVMetalTextureCache' instead.")]
3332
[ObsoletedOSPlatform ("ios12.0", "Use 'CVMetalTextureCache' instead.")]
34-
#else
35-
[Deprecated (PlatformName.iOS, 12,0, message: "Use 'CVMetalTextureCache' instead.")]
36-
[Deprecated (PlatformName.TvOS, 12,0, message: "Use 'CVMetalTextureCache' instead.")]
37-
#endif
3833
public class CVOpenGLESTextureCache : INativeObject, IDisposable {
3934
internal IntPtr handle;
4035

0 commit comments

Comments
 (0)