Skip to content

AVFoundation macOS xcode15.3 b1

Alex Soto edited this page Jan 27, 2024 · 1 revision

#AVFoundation.framework

diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureFileOutput.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureFileOutput.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureFileOutput.h	2023-11-12 03:59:02
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureFileOutput.h	2024-01-19 03:19:03
@@ -395,7 +395,7 @@
  
     Changing the value of this property will not affect the movie fragment interval of the file currently being written, if there is one.
 
-    For best writing performance on external storage devices, set the movieFragmentInterval to 10 seconds or greater.
+    For best writing performance on external storage devices, set the movieFragmentInterval to 10 seconds or greater. If the size of a movie fragment is greater than or equal to 2GB, an interval is added at 2GB mark.
  */
 @property(nonatomic) CMTime movieFragmentInterval;
 
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCapturePhotoOutput.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCapturePhotoOutput.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCapturePhotoOutput.h	2023-10-28 17:19:09
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCapturePhotoOutput.h	2024-01-19 01:51:28
@@ -79,6 +79,7 @@
         - If rawPhotoPixelFormatType is non-zero, it must be present in the receiver's -availableRawPhotoPixelFormatTypes array.
         - If rawPhotoPixelFormatType is non-zero, your delegate must respond to -captureOutput:didFinishProcessingRawPhotoSampleBuffer:previewPhotoSampleBuffer:resolvedSettings:bracketSettings:error:.
         - If rawPhotoPixelFormatType is non-zero, highResolutionPhotoEnabled may be YES or NO, but the setting only applies to the processed image, if you've specified one.
+        - If rawPhotoPixelFormatType is non-zero, constantColorEnabled must be set to NO.
         - If rawFileType is specified, it must be present in -availableRawPhotoFileTypes and must support the rawPhotoPixelFormatType specified using -supportedRawPhotoPixelFormatTypesForFileType:.
         Bayer RAW rules (isBayerRAWPixelFormat: returns yes for rawPhotoPixelFormatType):
         - photoQualityPrioritization must be set to AVCapturePhotoQualityPrioritizationSpeed (deprecated autoStillImageStabilizationEnabled must be set to NO).
@@ -1756,7 +1757,7 @@
     Indicates whether the flash will fire when capturing the photo.
 
  @discussion
-    When you specify AVCaptureFlashModeAuto as you AVCapturePhotoSettings.flashMode, you don't know if flash capture will be chosen until you inspect the AVCaptureResolvedPhotoSettings flashEnabled property. If the device becomes too hot, the flash becomes temporarily unavailable. You can key-value observe AVCaptureDevice's flashAvailable property to know when this occurs. If the flash is unavailable due to thermal issues, and you specify a flashMode of AVCaptureFlashModeOn, flashEnabled still resolves to NO until the device has sufficiently cooled off.
+    When you specify AVCaptureFlashModeAuto as your AVCapturePhotoSettings.flashMode, you don't know if flash capture will be chosen until you inspect the AVCaptureResolvedPhotoSettings flashEnabled property. If the device becomes too hot, the flash becomes temporarily unavailable. You can key-value observe AVCaptureDevice's flashAvailable property to know when this occurs. If the flash is unavailable due to thermal issues, and you specify a flashMode of AVCaptureFlashModeOn, flashEnabled still resolves to NO until the device has sufficiently cooled off.
  */
 @property(readonly, getter=isFlashEnabled) BOOL flashEnabled API_UNAVAILABLE(macos);
 
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVContentKeySession.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVContentKeySession.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVContentKeySession.h	2023-10-28 17:25:43
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVContentKeySession.h	2024-01-10 01:09:29
@@ -406,6 +406,34 @@
 */
 @optional
 - (void)contentKeySessionDidGenerateExpiredSessionReport:(AVContentKeySession *)session API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(7.0));
+
+/*!
+ @method        contentKeySession:externalProtectionStatusDidChangeForContentKey:
+ @abstract      Informs the receiver when external protection state has changed.
+ @param         session
+				An instance of AVContentKeySession that loaded the content key.
+ @param         contentKey
+				The content key for which the external protection state changed.
+ @discussion    When externalProtectionStatusDidChangeForContentKey is received, externalContentProtectionStatus should be queried to obtain the latest state.
+*/
+@optional
+- (void)contentKeySession:(AVContentKeySession *)session externalProtectionStatusDidChangeForContentKey:(AVContentKey *)contentKey API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4)) API_UNAVAILABLE(watchos);
+
+/*!
+ @method        contentKeySession:didProvideContentKeyRequests:forInitializationData:
+ @abstract      Provides the receiver with a list of new content key requests.
+ @param         session
+				An instance of AVContentKeySession that's providing the list of new content key requests.
+ @param         keyRequests
+				An array with new AVContentKeyRequest instances.
+ @param         initializationData
+				InitializationData corresponding to the new AVContentKeyRequests. May be nil.
+ @discussion    Will be invoked by an AVContentKeySession as a result of a call to -processContentKeyRequestWithIdentifier:initializationData:options:.
+				The requests for all keys in an initializationData will be provided at once through contentKeySession:didProvideContentKeyRequests:forInitializationData: and it takes precedence over contentKeySession:didProvideContentKeyRequest:.
+*/
+@optional
+- (void)contentKeySession:(AVContentKeySession *)session didProvideContentKeyRequests:(NSArray<AVContentKeyRequest *> *)keyRequests forInitializationData:(nullable NSData *)initializationData API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), watchos(10.4));
+
 @end
 
 
@@ -724,6 +752,23 @@
 
 @end
 
+/*!
+ @enum             AVExternalContentProtectionStatus
+ @abstract        The constants can be used to derive whether or not we have established sufficient protection to display content protected by this AVContentKey on some set of attached displays.
+ 
+ @constant AVExternalContentProtectionStatusPending
+	Indicates that the current protection status has not yet been discovered for the attached display(s).
+ @constant AVExternalContentProtectionStatusSufficient
+	Indicates that sufficient protection with the attached display(s) has been established, content protected by the associated AVContentKey will be eligible to be displayed on the display(s).
+ @constant AVExternalContentProtectionStatusInsufficient
+	Indicates that sufficient protection with the attached display(s) has failed to be established, content protected by the associated AVContentKey will not be displayed.
+ */
+typedef NS_ENUM(NSInteger, AVExternalContentProtectionStatus) {
+	AVExternalContentProtectionStatusPending            = 0,
+	AVExternalContentProtectionStatusSufficient         = 1,
+	AVExternalContentProtectionStatusInsufficient       = 2,
+} API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4)) API_UNAVAILABLE(watchos);
+
 API_AVAILABLE(macos(11.3), ios(14.5), tvos(14.5), watchos(7.4))
 @interface AVContentKey : NSObject
 
@@ -732,6 +777,22 @@
  @abstract      Specifies the content key.
  */
 @property  (readonly) AVContentKeySpecifier *contentKeySpecifier;
+
+/*!
+	@property		externalContentProtectionStatus
+	@abstract		The external protection status for the AVContentKey based on all attached displays.
+	@discussion		This property is not key-value observable, instead the contentKeySession:externalProtectionStatusDidChangeForContentKey: delegate method should be used.
+*/
+@property  (readonly) AVExternalContentProtectionStatus externalContentProtectionStatus API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4)) API_UNAVAILABLE(watchos);
+
+/*!
+ @method        revoke
+ @abstract      Revokes the decryption context of the content key, and removes it from its associated AVContentKeySession.
+ @discussion    Once revoked, the AVContentKey is no longer eligible to be used with any media.
+				If the key is required again, or if the key is requested to be loaded by the application, a new AVContentKeyRequest will be dispatched to the delegate.
+				If there is media playback occurring which is dependent on the content key it will fail and may result in an error being generated with the playback halting.
+*/
+- (void)revoke API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), watchos(10.4));
 @end
 
 /*!
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFCore.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFCore.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFCore.h	2023-11-12 03:39:40
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFCore.h	2024-01-21 02:51:00
@@ -84,6 +84,7 @@
 #import <AVFoundation/AVUtilities.h>
 #import <AVFoundation/AVVideoCompositing.h>
 #import <AVFoundation/AVVideoComposition.h>
+#import <AVFoundation/AVVideoPerformanceMetrics.h>
 #import <AVFoundation/AVVideoSettings.h>
 #if TARGET_OS_IPHONE && ! TARGET_OS_MACCATALYST
 #import <AVFoundation/AVDisplayCriteria.h>
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes	2023-11-12 04:27:25
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes	2024-01-17 00:08:31
@@ -424,6 +424,9 @@
   - Selector: 'flushWithRemovalOfDisplayedImage:completionHandler:'
     SwiftName: 'flush(removingDisplayedImage:completionHandler:)'
     MethodKind: Instance
+  - Selector: 'copyDisplayedPixelBuffer'
+    SwiftName: displayedPixelBuffer()
+    MethodKind: Instance
 - Name: AVPlayerItem
   Methods:
   - Selector: 'selectMediaOption:inMediaSelectionGroup:'
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItem.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItem.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItem.h	2023-11-12 04:15:09
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItem.h	2024-01-10 00:15:13
@@ -1336,13 +1336,6 @@
  */
 @property (nonatomic, readonly, nullable) NSString *errorComment;
 
- /*
- @property		allHTTPResponseHeaderFields
- @abstract		The HTTP header fields returned by the server, if an HTTP response was received as part of this error.
- @discussion	See -[NSHTTPURLResponse allHeaderFields] for more information.
- */
- @property (nonatomic, readonly, nullable) NSDictionary <NSString *, NSString *> *allHTTPResponseHeaderFields API_AVAILABLE(macos(14.2), ios(17.2), tvos(17.2), watchos(10.2));
-
 @end
 
 NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSampleBufferDisplayLayer.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSampleBufferDisplayLayer.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSampleBufferDisplayLayer.h	2023-11-12 04:15:10
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSampleBufferDisplayLayer.h	2024-01-17 00:09:41
@@ -34,6 +34,8 @@
 AVF_EXPORT NSNotificationName const AVSampleBufferDisplayLayerRequiresFlushToResumeDecodingDidChangeNotification API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0)) API_UNAVAILABLE(watchos); // see requiresFlushToResumeDecoding property
 AVF_EXPORT NSNotificationName const AVSampleBufferDisplayLayerOutputObscuredDueToInsufficientExternalProtectionDidChangeNotification API_AVAILABLE(macos(11.3), ios(14.5), tvos(14.5), watchos(7.4)); // see outputObscuredDueToInsufficientExternalProtection property
 
+AVF_EXPORT NSNotificationName const AVSampleBufferDisplayLayerReadyForDisplayDidChangeNotification API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), visionos(1.1)) API_UNAVAILABLE(watchos); // see readyForDisplay property
+
 API_AVAILABLE(macos(10.8), ios(8.0), tvos(10.2)) API_UNAVAILABLE(watchos)
 @interface AVSampleBufferDisplayLayer : CALayer
 
@@ -64,6 +66,16 @@
 					See <AVFoundation/AVAnimation.h> for a description of these options.
  */
 @property(copy) AVLayerVideoGravity videoGravity;
+
+/*!
+	 @property		readyForDisplay
+	 @abstract		Boolean indicating that the first video frame has been made ready for display.
+	 @discusssion		Use this property as an indicator of when best to show or animate-in an AVSampleBufferDisplayLayer into view.
+					An AVSampleBufferDisplayLayer may be displayed, or made visible, while this property is NO, however the layer will not have any user-visible content until the value becomes YES. Note that if an animation is added to an AVSampleBufferDisplayLayer before it becomes readyForDisplay the video image displayed inside might not animate with the receiver.
+					readyForDisplay will change to NO when the layer can no longer display frames. readyForDisplay will be YES when the first video frame has been made ready for display.
+					This property is not key-value observable.  AVSampleBufferDisplayLayerReadyForDisplayDidChangeNotification is posted when this value changes.
+ */
+@property (nonatomic, readonly, getter=isReadyForDisplay) BOOL readyForDisplay API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), visionos(1.1)) API_UNAVAILABLE(watchos);
 
 @end
 
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSampleBufferVideoRenderer.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSampleBufferVideoRenderer.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSampleBufferVideoRenderer.h	2023-11-12 03:13:11
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSampleBufferVideoRenderer.h	2024-01-10 01:09:31
@@ -17,6 +17,8 @@
 #import <AVFoundation/AVBase.h>
 #import <AVFoundation/AVQueuedSampleBufferRendering.h>
 
+@class AVVideoPerformanceMetrics;
+
 NS_ASSUME_NONNULL_BEGIN
 
 AVF_EXPORT NSNotificationName const AVSampleBufferVideoRendererDidFailToDecodeNotification API_AVAILABLE(macos(14.0), ios(17.0), tvos(17.0)) API_UNAVAILABLE(watchos); // decode failed, see NSError in notification payload
@@ -63,6 +65,69 @@
 */
 
 - (void)flushWithRemovalOfDisplayedImage:(BOOL)removeDisplayedImage completionHandler:(nullable void (^)(void))handler;
+
+@end
+
+API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), visionos(1.1)) API_UNAVAILABLE(watchos)
+@interface AVSampleBufferVideoRenderer (AVSampleBufferVideoRendererPixelBufferOutput)
+/*!
+	@method			copyDisplayedPixelBuffer
+	@abstract		Returns a retained reference to the pixel buffer currently displayed in the AVSampleBufferVideoRenderer's target. This will return NULL if the displayed pixel buffer is protected, no image is currently being displayed, or if the image is unavailable.
+	@discussion		This will return NULL if the rate is non-zero.  Clients must release the pixel buffer after use.
+			
+					Do not write to the returned CVPixelBuffer's attachments or pixel data.
+ */
+- (nullable CVPixelBufferRef)copyDisplayedPixelBuffer CF_RETURNS_RETAINED API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), visionos(1.1)) API_UNAVAILABLE(watchos);
+
+@end
+
+API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), visionos(1.1)) API_UNAVAILABLE(watchos)
+@interface AVSampleBufferVideoRenderer (AVSampleBufferVideoRendererPowerOptimization)
+
+/*!
+	@method			expectMinimumUpcomingSampleBufferPresentationTime:
+	@abstract		Promises, for the purpose of enabling power optimizations, that future sample buffers will have PTS values no less than a specified lower-bound PTS.
+	@discussion		Only applicable for forward playback.
+					Sending this message and later calling -enqueueSampleBuffer: with a buffer with a lower PTS has the potential to lead to dropping that later buffer.
+					For best results, call -expectMinimumUpcomingSampleBufferPresentationTime: regularly, in between calls to -enqueueSampleBuffer:, to advance the lower-bound PTS.
+					Messaging -flush resets such expectations.
+					(For example, it's OK to make this expectation, then in response to a seek back, flush and then enqueue buffers with lower PTS values.)
+	@param			minimumUpcomingPresentationTime
+					A lower bound on PTS values for buffers that will be passed to -enqueueSampleBuffer: in the future.
+*/
+- (void)expectMinimumUpcomingSampleBufferPresentationTime:(CMTime)minimumUpcomingPresentationTime NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), visionos(1.1)) API_UNAVAILABLE(watchos);
+
+
+/*!
+	@method			expectMonotonicallyIncreasingUpcomingSampleBufferPresentationTimes
+	@abstract		Promises, for the purpose of enabling power optimizations, that future sample buffers will have monotonically increasing PTS values.
+	@discussion		Only applicable for forward playback.
+					Sending this message and later calling -enqueueSampleBuffer: with a buffer with a lower PTS than any previously enqueued PTS has the potential to lead to dropped buffers.
+					Messaging -flush resets such expectations.
+*/
+- (void)expectMonotonicallyIncreasingUpcomingSampleBufferPresentationTimes NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), visionos(1.1)) API_UNAVAILABLE(watchos);
+
+/*!
+	@method			resetUpcomingSampleBufferPresentationTimeExpectations:
+	@abstract		Resets previously-promised expectations about upcoming sample buffer PTSs.
+	@discussion		This undoes the state set by messaging -expectMinimumUpcomingSampleBufferPresentationTime: or -expectMonotonicallyIncreasingUpcomingSampleBufferPresentationTimes.
+					If you didn't use either of those, you don't have to use this.
+*/
+- (void)resetUpcomingSampleBufferPresentationTimeExpectations NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), visionos(1.1)) API_UNAVAILABLE(watchos);
+
+@end
+
+API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), visionos(1.1)) API_UNAVAILABLE(watchos)
+@interface AVSampleBufferVideoRenderer (AVSampleBufferVideoRendererVideoPerformanceMetrics)
+
+/*!
+	@method			loadVideoPerformanceMetricsWithCompletionHandler:
+	@abstract		Gathers a snapshot of the video performance metrics and calls the completion handler with the results.
+	@param			completionHandler
+					The handler to invoke with the video performance metrics.
+	@discussion		If there are no performance metrics available, the completion handler will be called with nil videoPerformanceMetrics.
+*/
+- (void)loadVideoPerformanceMetricsWithCompletionHandler:(void (^)(AVVideoPerformanceMetrics * _Nullable_result videoPerformanceMetrics))completionHandler NS_SWIFT_ASYNC_NAME(getter:videoPerformanceMetrics()) API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), visionos(1.1)) API_UNAVAILABLE(watchos);
 
 @end
 
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVVideoPerformanceMetrics.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVVideoPerformanceMetrics.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVVideoPerformanceMetrics.h	1969-12-31 19:00:00
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVVideoPerformanceMetrics.h	2024-01-10 01:34:49
@@ -0,0 +1,107 @@
+#if !__has_include(<AVFCore/AVVideoPerformanceMetrics.h>)
+/*
+ 	File:  AVVideoPerformanceMetrics.h
+ 
+ 	Framework:  AVFoundation
+ 
+ 	Copyright 2014-2023 Apple Inc. All rights reserved.
+ 
+ */
+
+#import <AVFoundation/AVBase.h>
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class AVVideoPerformanceMetricsInternal;
+
+/*!
+ @class			AVVideoPerformanceMetrics
+ @abstract		An instance of AVVideoPerformanceMetrics provides current performance metrics.
+ @discussion	An instance of AVVideoPerformanceMetrics provides named properties for accessing the video playback quality metrics.
+ */
+
+NS_SWIFT_SENDABLE
+API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), visionos(1.1)) API_UNAVAILABLE(watchos)
+@interface AVVideoPerformanceMetrics : NSObject
+{
+@private
+	AVVideoPerformanceMetricsInternal *_performanceMetricsInternal;
+}
+AV_INIT_UNAVAILABLE
+
+/*!
+ @property		totalNumberOfFrames
+ @abstract		The total number of frames that would have been displayed if no frames are dropped.
+ */
+@property (nonatomic, readonly) NSInteger totalNumberOfFrames;
+
+/*!
+ @property		numberOfDroppedFrames
+ @abstract		The total number of frames dropped prior to decoding or dropped because a frame missed its display deadline.
+ */
+@property (nonatomic, readonly) NSInteger numberOfDroppedFrames;
+
+/*!
+ @property		numberOfCorruptedFrames
+ @abstract		The total number of corrupted frames that have been detected.
+ */
+@property (nonatomic, readonly) NSInteger numberOfCorruptedFrames;
+
+/*!
+ @property		numberOfFramesDisplayedUsingOptimizedCompositing
+ @abstract		The total number of full screen frames that were rendered in a special power-efficient mode that didn't require the frame to be composited with other UI elements.
+ */
+@property (nonatomic, readonly) NSInteger numberOfFramesDisplayedUsingOptimizedCompositing;
+
+/*!
+ @property		totalAccumulatedFrameDelay
+ @abstract		The accumulated amount of time between the prescribed presentation times of displayed video frames and the actual time at which they were displayed.
+ @discussion	This delay is always greater than or equal to zero since frames must never be displayed before their presentation time. Non-zero delays are a sign of playback jitter and possible loss of A/V sync.
+ */
+@property (nonatomic, readonly) NSTimeInterval totalAccumulatedFrameDelay;
+
+/*!
+ @property		totalNumberOfVideoFrames
+ @abstract		The total number of frames that would have been displayed if no frames are dropped. Same as totalNumberOfFrames.
+ */
+@property (nonatomic, readonly) unsigned long totalNumberOfVideoFrames API_UNAVAILABLE(macos, ios, tvos, visionos) API_UNAVAILABLE(watchos);
+
+/*!
+ @property		numberOfDroppedVideoFrames
+ @abstract		The total number of frames dropped prior to decoding or dropped because a frame missed its display deadline. Same as numberOfDroppedFrames.
+ */
+@property (nonatomic, readonly) unsigned long numberOfDroppedVideoFrames API_UNAVAILABLE(macos, ios, tvos, visionos) API_UNAVAILABLE(watchos);
+
+/*!
+ @property		numberOfCorruptedVideoFrames
+ @abstract		The total number of corrupted frames that have been detected. Same as numberOfCorruptedFrames.
+ */
+@property (nonatomic, readonly) unsigned long numberOfCorruptedVideoFrames API_UNAVAILABLE(macos, ios, tvos, visionos) API_UNAVAILABLE(watchos);
+
+/*!
+ @property		numberOfDisplayCompositedFrames
+ @abstract		The total number of frames that were composited in detached mode.  Same as numberOfFramesDisplayedUsingOptimizedCompositing.
+ */
+@property (nonatomic, readonly) unsigned long numberOfDisplayCompositedVideoFrames API_UNAVAILABLE(macos, ios, tvos, visionos) API_UNAVAILABLE(watchos);
+
+/*!
+ @property		numberOfNonDisplayCompositedFrames
+ @abstract		The total number of frames that were composited in undetached mode.
+ */
+@property (nonatomic, readonly) unsigned long numberOfNonDisplayCompositedVideoFrames API_UNAVAILABLE(macos, ios, tvos, visionos) API_UNAVAILABLE(watchos);
+
+/*!
+ @property		totalFrameDelay
+ @abstract		The accumulated amount of time, in microseconds, between the prescribed presentation times of displayed video frames and the actual time at which they were displayed.
+ @discussion	This delay is always greater than or equal to zero since frames must never be displayed before their presentation time. Non-zero delays are a sign of playback jitter and possible loss of A/V sync. Same as totalAccumulatedFrameDelay.
+ */
+@property (nonatomic, readonly) double totalFrameDelay API_UNAVAILABLE(macos, ios, tvos, visionos) API_UNAVAILABLE(watchos);
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+#else
+#import <AVFCore/AVVideoPerformanceMetrics.h>
+#endif
Clone this wiki locally