Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/mediaaccessibility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using ObjCRuntime;
using Foundation;
using Surface = IOSurface.IOSurface;

namespace MediaAccessibility {

Expand Down Expand Up @@ -45,4 +46,27 @@ interface MAVideoAccommodations {
[Field ("kMADimFlashingLightsChangedNotification")]
NSString DimFlashingLightsChangedNotification { get; }
}

[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSObject))]
interface MAFlashingLightsProcessorResult {
[Export ("surfaceProcessed")]
bool SurfaceProcessed { get; }

[Export ("mitigationLevel")]
float MitigationLevel { get; }

[Export ("intensityLevel")]
float IntensityLevel { get; }
}

[TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSObject))]
interface MAFlashingLightsProcessor {
[Export ("canProcessSurface:")]
bool CanProcess (Surface surface);

[Export ("processSurface:outSurface:timestamp:options:")]
MAFlashingLightsProcessorResult Process (Surface inSurface, Surface outSurface, double timestamp, [NullAllowed] NSDictionary<NSString, NSObject> options);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the options be a strong dictionary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI - I also looked at the Swift doc'n and the key, oddly enough, is not an NSString, which is an inner struct called MAFlashingLightsProcessor.OptionKey which has initializers from String - it feels like they're keeping their options open for the future, but the values of the options are also untyped there and undocumented.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did notice the same, we should leave it as open as possible.

Comment thread
mandel-macaque marked this conversation as resolved.
Outdated
}
}

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions tests/xtro-sharpie/iOS-MediaAccessibility.todo

This file was deleted.

7 changes: 0 additions & 7 deletions tests/xtro-sharpie/macOS-MediaAccessibility.todo

This file was deleted.

7 changes: 0 additions & 7 deletions tests/xtro-sharpie/tvOS-MediaAccessibility.todo

This file was deleted.