Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ MACCATALYST_NUGET_VERSION_FULL=$(MACCATALYST_NUGET_VERSION_NO_METADATA)$(NUGET_B

# Xcode version should have both a major and a minor version (even if the minor version is 0)
XCODE_VERSION=26.0
XCODE_URL=https://dl.internalx.com/internal-files/xcodes/Xcode_26_beta_7.xip
XCODE_DEVELOPER_ROOT=/Applications/Xcode_26.0.0-beta7.app/Contents/Developer
XCODE_URL=https://dl.internalx.com/internal-files/xcodes/Xcode_26_Release_Candidate.xip
XCODE_DEVELOPER_ROOT=/Applications/Xcode_26.0.0-rc.app/Contents/Developer
XCODE_PRODUCT_BUILD_VERSION:=$(shell /usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' $(XCODE_DEVELOPER_ROOT)/../version.plist 2>/dev/null || echo " $(shell tput setaf 1 2>/dev/null)The required Xcode ($(XCODE_VERSION)) is not installed in $(basename $(basename $(XCODE_DEVELOPER_ROOT)))$(shell tput sgr0 2>/dev/null)" >&2)

# We define stable Xcode as the Xcode app being named like "Xcode_#.#[.#].app"
Expand Down
171 changes: 171 additions & 0 deletions src/AVFoundation/AVTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#endif // !COREBUILD
using CoreGraphics;
using ObjCRuntime;
using CoreMedia;

#nullable enable

Expand Down Expand Up @@ -880,4 +881,174 @@ public static AVCaptionSize Create (AVCaptionDimension width, AVCaptionDimension
=> AVCaptionSizeMake (width, height);
}
#endif // __TVOS__

/// <summary>Represents a timecode structure adhering to SMPTE standards for precise time information and synchronization.</summary>
/// <remarks>This structure corresponds to the SMPTE 12M-1 Linear Timecode (LTC) format.</remarks>
[SupportedOSPlatform ("ios26.0")]
[SupportedOSPlatform ("maccatalyst26.0")]
[SupportedOSPlatform ("macos26.0")]
[SupportedOSPlatform ("tvos26.0")]
[StructLayout (LayoutKind.Sequential)]
public struct AVCaptureTimecode
#if !COREBUILD
: IEquatable<AVCaptureTimecode>
#endif
{
/* uint8_t */
byte hours;
/* uint8_t */
byte minutes;
/* uint8_t */
byte seconds;
/* uint8_t */
byte frames;
/* uint32_t */
uint userBits;
CMTime frameDuration;
nuint sourceType;

/// <summary>Gets or sets the hour component of the timecode.</summary>
/// <value>The hour value of the current timecode.</value>
public byte Hours {
get => hours;
set => hours = value;
}

/// <summary>Gets or sets the minute component of the timecode.</summary>
/// <value>The minute value of the current timecode.</value>
public byte Minutes {
get => minutes;
set => minutes = value;
}

/// <summary>Gets or sets the second component of the timecode.</summary>
/// <value>The second value of the current timecode.</value>
public byte Seconds {
get => seconds;
set => seconds = value;
}

/// <summary>Gets or sets the frame component of the timecode.</summary>
/// <value>The frame count within the current second.</value>
public byte Frames {
get => frames;
set => frames = value;
}

/// <summary>Gets or sets the SMPTE user bits field.</summary>
/// <value>A field carrying additional metadata such as scene-take information, reel numbers, or dates.</value>
/// <remarks>The exact usage of user bits is application-dependent and not strictly standardized by SMPTE.</remarks>
public uint UserBits {
get => userBits;
set => userBits = value;
}

/// <summary>Gets or sets the frame duration of the timecode.</summary>
/// <value>The duration of each frame. If unknown, the value is <see cref="CMTime.Invalid" />.</value>
public CMTime FrameDuration {
get => frameDuration;
set => frameDuration = value;
}

#if !COREBUILD
/// <summary>Gets or sets the source type of the timecode.</summary>
/// <value>The type indicating the emitter, carriage, or transport mechanism of the timecode.</value>
public AVCaptureTimecodeSourceType SourceType {
get => (AVCaptureTimecodeSourceType) (long) sourceType;
set => sourceType = (nuint) (long) value;
}

/// <summary>Initializes a new instance of the AVCaptureTimecode structure.</summary>
/// <param name="hours">The hour component of the timecode.</param>
/// <param name="minutes">The minute component of the timecode.</param>
/// <param name="seconds">The second component of the timecode.</param>
/// <param name="frames">The frame component of the timecode.</param>
/// <param name="userBits">The SMPTE user bits for additional metadata.</param>
/// <param name="frameDuration">The duration of each frame.</param>
/// <param name="sourceType">The source type of the timecode.</param>
public AVCaptureTimecode (byte hours, byte minutes, byte seconds, byte frames, uint userBits, CMTime frameDuration, AVCaptureTimecodeSourceType sourceType)
{
Hours = hours;
Minutes = minutes;
Seconds = seconds;
Frames = frames;
UserBits = userBits;
FrameDuration = frameDuration;
SourceType = sourceType;
}

// CMSampleBufferRef _Nullable AVCaptureTimecodeCreateMetadataSampleBufferAssociatedWithPresentationTimeStamp(AVCaptureTimecode timecode, CMTime presentationTimeStamp)
[DllImport (Constants.AVFoundationLibrary)]
static extern IntPtr /* CMSampleBufferRef */ AVCaptureTimecodeCreateMetadataSampleBufferAssociatedWithPresentationTimeStamp (AVCaptureTimecode timecode, CMTime presentationTimeStamp);

/// <summary>Creates a sample buffer containing timecode metadata associated with a presentation timestamp.</summary>
/// <param name="presentationTimeStamp">The presentation time stamp that determines when the metadata should be applied in the media timeline.</param>
/// <returns>A sample buffer with encoded timecode metadata for video synchronization, or <see langword="null" /> if creation fails.</returns>
/// <remarks>This method creates a <see cref="CMSampleBuffer" /> with metadata for integration with a video track at a specific moment in time.</remarks>
public CMSampleBuffer? CreateMetadataSampleBufferAssociatedWithPresentationTimeStamp (CMTime presentationTimeStamp)
{
var ptr = AVCaptureTimecodeCreateMetadataSampleBufferAssociatedWithPresentationTimeStamp (this, presentationTimeStamp);
return CMSampleBuffer.Create (ptr, owns: true);
}

// CMSampleBufferRef _Nullable AVCaptureTimecodeCreateMetadataSampleBufferForDuration(AVCaptureTimecode timecode, CMTime duration)
[DllImport (Constants.AVFoundationLibrary)]
static extern IntPtr /* CMSampleBufferRef */ AVCaptureTimecodeCreateMetadataSampleBufferForDuration (AVCaptureTimecode timecode, CMTime duration);

/// <summary>Creates a sample buffer containing timecode metadata for a specified duration.</summary>
/// <param name="duration">The duration that the metadata sample buffer should represent.</param>
/// <returns>A sample buffer with encoded timecode metadata for the given duration, or <see langword="null" /> if creation fails.</returns>
/// <remarks>Use this method for scenarios where timecode metadata needs to span a custom interval rather than a single frame.</remarks>
public CMSampleBuffer? CreateMetadataSampleBufferForDuration (CMTime duration)
{
var ptr = AVCaptureTimecodeCreateMetadataSampleBufferForDuration (this, duration);
return CMSampleBuffer.Create (ptr, owns: true);
}

// AVCaptureTimecode AVCaptureTimecodeAdvancedByFrames(AVCaptureTimecode timecode, int64_t framesToAdd)
[DllImport (Constants.AVFoundationLibrary)]
static extern AVCaptureTimecode AVCaptureTimecodeAdvancedByFrames (AVCaptureTimecode timecode, long framesToAdd);

/// <summary>Generates a new timecode by adding a specified number of frames to this timecode.</summary>
/// <param name="framesToAdd">The number of frames to add to the timecode.</param>
/// <returns>A new timecode with the updated time values after adding the specified frames.</returns>
/// <remarks>This method handles overflow for seconds, minutes, and hours appropriately.</remarks>
public AVCaptureTimecode AddFrames (long framesToAdd) => AVCaptureTimecodeAdvancedByFrames (this, framesToAdd);

/// <summary>Determines whether two timecode instances are equal.</summary>
/// <param name="left">The first timecode to compare.</param>
/// <param name="right">The second timecode to compare.</param>
/// <returns>True if the timecodes are equal; otherwise, false.</returns>
public static bool operator == (AVCaptureTimecode left, AVCaptureTimecode right) => left.Equals (right);

/// <summary>Determines whether two timecode instances are not equal.</summary>
/// <param name="left">The first timecode to compare.</param>
/// <param name="right">The second timecode to compare.</param>
/// <returns>True if the timecodes are not equal; otherwise, false.</returns>
public static bool operator != (AVCaptureTimecode left, AVCaptureTimecode right) => !left.Equals (right);

/// <summary>Determines whether this timecode is equal to the specified object.</summary>
/// <param name="obj">The object to compare with this timecode.</param>
/// <returns>True if the specified object is equal to this timecode; otherwise, false.</returns>
public override bool Equals (object? obj) => obj is AVCaptureTimecode other && Equals (other);

/// <summary>Determines whether this timecode is equal to another timecode.</summary>
/// <param name="other">The other timecode to compare with this timecode.</param>
/// <returns>True if the timecodes are equal; otherwise, false.</returns>
public bool Equals (AVCaptureTimecode other)
{
return Hours == other.Hours
&& Minutes == other.Minutes
&& Seconds == other.Seconds
&& Frames == other.Frames
&& UserBits == other.UserBits
&& FrameDuration.Equals (other.FrameDuration)
&& SourceType == other.SourceType;
}

/// <summary>Returns the hash code for this timecode.</summary>
/// <returns>A hash code for the current timecode.</returns>
public override int GetHashCode () => HashCode.Combine (Hours, Minutes, Seconds, Frames, UserBits, FrameDuration, SourceType);
#endif
}
}
83 changes: 83 additions & 0 deletions src/AVFoundation/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,9 @@ public enum AVError : long {
MediaExtensionConflict = -11887,
ContentKeyRequestPlaybackDestinationDoesNotSupportDeviceIdentifierRandomization = -11888,
ContentKeyInvalid = -11889,
NoSmartFramingsEnabled = -11890,
AutoWhiteBalanceNotLocked = -11891,
FollowExternalSyncDeviceTimedOut = -11892,
}

/// <summary>An enumeration whose values specify the behavior of the player when it finishes playing.</summary>
Expand Down Expand Up @@ -965,6 +968,8 @@ public enum AVCaptureVideoStabilizationMode : long {
PreviewOptimized = 4,
[iOS (18, 0), MacCatalyst (18, 0), TV (18, 0), NoMac]
CinematicExtendedEnhanced = 5,
[iOS (26, 0), NoMacCatalyst, NoTV, NoMac]
LowLatency = 6,
/// <summary>The device determines the stabilization mode.</summary>
Auto = -1,
}
Expand Down Expand Up @@ -1144,6 +1149,8 @@ public enum AVCaptureColorSpace : long {
HlgBT2020 = 2,
[NoMac, NoiOS, NoMacCatalyst]
AppleLog = 3,
[NoMac, iOS (26, 0), MacCatalyst (26, 0), TV (26, 0)]
AppleLog2 = 4,
}

/// <summary>Enumerates loop count limits.</summary>
Expand Down Expand Up @@ -1663,6 +1670,14 @@ public enum AVVideoCodecType {
[TV (18, 0), MacCatalyst (18, 0), Mac (15, 0), iOS (18, 0)]
[Field ("AVVideoCodecTypeJPEGXL")]
JpegXl = 11,

[TV (26, 0), MacCatalyst (26, 0), Mac (26, 0), iOS (26, 0)]
[Field ("AVVideoCodecTypeAppleProResRAW")]
AppleProResRaw = 12,

[TV (26, 0), MacCatalyst (26, 0), Mac (26, 0), iOS (26, 0)]
[Field ("AVVideoCodecTypeAppleProResRAWHQ")]
AppleProResRawHQ = 13,
}

[Introduced (PlatformName.MacCatalyst, 14, 0)]
Expand Down Expand Up @@ -2307,4 +2322,72 @@ public enum AVAudioDynamicRangeControlConfiguration : long {
Movie = 3,
Capture = 4,
}

[NoTV, NoMacCatalyst, NoMac, iOS (26, 0)]
public enum AVCaptureAspectRatio {
[Field ("AVCaptureAspectRatio1x1")]
OneByOne1x1,

[Field ("AVCaptureAspectRatio16x9")]
SixteenByNine16x9,

[Field ("AVCaptureAspectRatio9x16")]
NineBySixteen9x16,

[Field ("AVCaptureAspectRatio4x3")]
FourByThree4x3,

[Field ("AVCaptureAspectRatio3x4")]
ThreeByFour3x4,
}

[TV (26, 0), NoMac, MacCatalyst (26, 0), iOS (26, 0)]
[BackingFieldType (typeof (AVCaptureWhiteBalanceTemperatureAndTintValues))]
public enum AVCaptureWhiteBalanceTemperatureAndTintValue {
[Field ("AVCaptureWhiteBalanceTemperatureAndTintValuesTungsten")]
Tungsten,

[Field ("AVCaptureWhiteBalanceTemperatureAndTintValuesFluorescent")]
Fluorescent,

[Field ("AVCaptureWhiteBalanceTemperatureAndTintValuesDaylight")]
Daylight,

[Field ("AVCaptureWhiteBalanceTemperatureAndTintValuesCloudy")]
Cloudy,

[Field ("AVCaptureWhiteBalanceTemperatureAndTintValuesShadow")]
Shadow,
}

[TV (26, 0), MacCatalyst (26, 0), Mac (26, 0), iOS (26, 0)]
[Native]
public enum AVExternalSyncDeviceStatus : long {
Unavailable = 0,
Ready = 1,
Calibrating = 2,
ActiveSync = 3,
FreeRunSync = 4,
}

[TV (26, 0), MacCatalyst (26, 0), Mac (26, 0), iOS (26, 0)]
[Native]
public enum AVCaptureTimecodeSourceType : long {
FrameCount = 0,
RealTimeClock = 1,
External = 2,
}

[TV (26, 0), MacCatalyst (26, 0), Mac (26, 0), iOS (26, 0)]
[Native]
public enum AVCaptureTimecodeGeneratorSynchronizationStatus : long {
Unknown = 0,
SourceSelected = 1,
Synchronizing = 2,
Synchronized = 3,
TimedOut = 4,
SourceUnavailable = 5,
SourceUnsupported = 6,
NotRequired = 7,
}
}
12 changes: 12 additions & 0 deletions src/Metal/MTLEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,8 @@ public enum MTLDataType : ulong {
[iOS (17, 0), TV (17, 0), Mac (14, 0), MacCatalyst (17, 0)]
BFloat4 = 124,
[Mac (26, 0), iOS (26, 0), MacCatalyst (26, 0), TV (26, 0)]
DepthStencilState = 139,
[Mac (26, 0), iOS (26, 0), MacCatalyst (26, 0), TV (26, 0)]
Tensor = 140,
}

Expand Down Expand Up @@ -2016,6 +2018,8 @@ public enum MTLGpuFamily : long {
Apple8 = 1008,
[NoTV]
Apple9 = 1009,
[Mac (26, 0), iOS (26, 0), MacCatalyst (26, 0), TV (26, 0)]
Apple10 = 1010,
Mac1 = 2001,
Mac2 = 2002,
Common1 = 3001,
Expand Down Expand Up @@ -2616,4 +2620,12 @@ public enum MTLVisibilityResultType : long {
Reset = 0,
Accumulate = 1,
}

[Mac (26, 0), iOS (26, 0), MacCatalyst (26, 0), TV (26, 0)]
[Native]
public enum MTLSamplerReductionMode : ulong {
WeightedAverage = 0,
Minimum = 1,
Maximum = 2,
}
}
2 changes: 1 addition & 1 deletion src/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@
</data>

<data name="BI1088" xml:space="preserve">
<value>The backing field type '{0}' is invalid. Valid backing field types are: "NSString", "NSNumber", "nint" and "nuint".</value>
<value>The backing field type '{0}' is invalid. Valid backing field types are: "NSString", "NSNumber", and blittable value types.</value>
</data>

<data name="BI1101" xml:space="preserve">
Expand Down
1 change: 1 addition & 0 deletions src/VideoToolbox/VTDefs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public enum VTStatus {
CouldNotOutputTaggedBufferGroupErr = -17699,
CouldNotFindExtensionErr = -19510,
ExtensionConflictErr = -19511,
VideoEncoderAutoWhiteBalanceNotLockedErr = -19512,
}

// uint32_t -> VTErrors.h
Expand Down
Loading
Loading