import type { NobjcObject } from "objc-js";
import type { _NSArray } from "../Foundation/NSArray.js";
import type { _NSCopying } from "../Foundation/NSCopying.js";
import type { _NSError } from "../Foundation/NSError.js";
import type { _NSMutableCopying } from "../Foundation/NSMutableCopying.js";
import type { _NSObject } from "../Foundation/NSObject.js";
import type { _NSString } from "../Foundation/NSString.js";
import type { _AVAsset } from "./AVAsset.js";
import type { _AVAsynchronousCIImageFilteringRequest } from "./AVAsynchronousCIImageFilteringRequest.js";
import type { _AVVideoCompositionCoreAnimationTool } from "./AVVideoCompositionCoreAnimationTool.js";
import type { _AVVideoCompositionValidationHandling } from "./AVVideoCompositionValidationHandling.js";
import type { CGSize } from "../structs/CGSize.js";
import type { CMTime } from "../structs/CMTime.js";
import type { CMTimeRange } from "../structs/CMTimeRange.js";
import type { AVVideoCompositionPerFrameHDRDisplayMetadataPolicy } from "./AVVideoCompositionPerFrameHDRDisplayMetadataPolicy.js";
export declare class _AVVideoComposition extends _NSObject {
    static alloc(): _AVVideoComposition;
    static new(): _AVVideoComposition;
    init(): _AVVideoComposition;
    /**
     * Returns a new instance of AVVideoComposition with values and instructions suitable for presenting the video tracks of the specified asset according to its temporal and geometric properties and those of its tracks. The returned AVVideoComposition will have instructions that respect the spatial properties and timeRanges of the specified asset's video tracks. It will also have the following values for its properties: - If the asset has exactly one video track, the original timing of the source video track will be used. If the asset has more than one video track, and the nominal frame rate of any of video tracks is known, the reciprocal of the greatest known nominalFrameRate will be used as the value of frameDuration. Otherwise, a default framerate of 30fps is used. - If the specified asset is an instance of AVComposition, the renderSize will be set to the naturalSize of the AVComposition; otherwise the renderSize will be set to a value that encompasses all of the asset's video tracks. - A renderScale of 1.0. - A nil animationTool. If the specified asset has no video tracks, this method will return an AVVideoComposition instance with an empty collection of instructions. - Parameter asset: An instance of AVAsset. Ensure that the duration and tracks properties of the asset are already loaded before invoking this method. - Returns: An instance of AVVideoComposition.
     * @deprecated Use videoCompositionWithPropertiesOfAsset:completionHandler: instead
     */
    static videoCompositionWithPropertiesOfAsset$(asset: _AVAsset): _AVVideoComposition;
    /**
     * Vends a new instance of AVVideoComposition with values and instructions suitable for presenting the video tracks of the specified asset according to its temporal and geometric properties and those of its tracks. The new AVVideoComposition will have instructions that respect the spatial properties and timeRanges of the specified asset's video tracks. It will also have the following values for its properties: - If the asset has exactly one video track, the original timing of the source video track will be used. If the asset has more than one video track, and the nominal frame rate of any of video tracks is known, the reciprocal of the greatest known nominalFrameRate will be used as the value of frameDuration. Otherwise, a default framerate of 30fps is used. - If the specified asset is an instance of AVComposition, the renderSize will be set to the naturalSize of the AVComposition; otherwise the renderSize will be set to a value that encompasses all of the asset's video tracks. - A renderScale of 1.0. - A nil animationTool. If the specified asset has no video tracks, this method will return an AVVideoComposition instance with an empty collection of instructions. - Parameter asset: An instance of AVAsset. - Parameter completionHandler: A block that is invoked when the new video composition has finished being created. If the `videoComposition` parameter is nil, the `error` parameter describes the failure that occurred.
     */
    static videoCompositionWithPropertiesOfAsset$completionHandler$(asset: _AVAsset, completionHandler: ((videoComposition: _AVVideoComposition, error: _NSError) => void) | null): void;
    /** Pass-through initializer, for internal use in AVFoundation only */
    static videoCompositionWithVideoComposition$(videoComposition: _AVVideoComposition): _AVVideoComposition;
    /**
     * Returns a new instance of AVVideoComposition with values and instructions that will apply the specified handler block to video frames represented as instances of CIImage. The returned AVVideoComposition will cause the specified handler block to be called to filter each frame of the asset's first enabled video track. The handler block should use the properties of the provided AVAsynchronousCIImageFilteringRequest and respond using finishWithImage:context: with a "filtered" new CIImage (or the provided source image for no affect). In the event of an error, respond to the request using finishWithError:. The error can be observed via AVPlayerItemFailedToPlayToEndTimeNotification, see AVPlayerItemFailedToPlayToEndTimeErrorKey in notification payload. NOTE: The returned AVVideoComposition's properties are private and support only CIFilter-based operations. Mutations are not supported, either in the values of properties of the AVVideoComposition itself or in its private instructions. If rotations or other transformations are desired, they must be accomplished via the application of CIFilters during the execution of your specified handler. The video composition will also have the following values for its properties: - The original timing of the asset's first enabled video track will be used. - A renderSize that encompasses the asset's first enabled video track respecting the track's preferredTransform. - A renderScale of 1.0. The default CIContext has the following properties: - iOS: Device RGB color space - macOS: sRGB color space Example usage: ```objc playerItem.videoComposition = [AVVideoComposition videoCompositionWithAsset:srcAsset applyingCIFiltersWithHandler: ^(AVAsynchronousCIImageFilteringRequest *request) { NSError *err = nil; CIImage *filtered = myRenderer(request, &err); if (filtered) [request finishWithImage:filtered context:nil]; else [request finishWithError:err]; }]; ``` - Parameter asset: An instance of AVAsset. For best performance, ensure that the duration and tracks properties of the asset are already loaded before invoking this method. - Returns: An instance of AVVideoComposition.
     * @deprecated Use videoCompositionWithAsset:applyingCIFiltersWithHandler:completionHandler: instead
     */
    static videoCompositionWithAsset$applyingCIFiltersWithHandler$(asset: _AVAsset, applier: (request: _AVAsynchronousCIImageFilteringRequest) => void): _AVVideoComposition;
    /**
     * Vends a new instance of AVVideoComposition with values and instructions that will apply the specified handler block to video frames represented as instances of CIImage. The new AVVideoComposition will cause the specified handler block to be called to filter each frame of the asset's first enabled video track. The handler block should use the properties of the provided AVAsynchronousCIImageFilteringRequest and respond using finishWithImage:context: with a "filtered" new CIImage (or the provided source image for no affect). In the event of an error, respond to the request using finishWithError:. The error can be observed via AVPlayerItemFailedToPlayToEndTimeNotification, see AVPlayerItemFailedToPlayToEndTimeErrorKey in notification payload. NOTE: The returned AVVideoComposition's properties are private and support only CIFilter-based operations. Mutations are not supported, either in the values of properties of the AVVideoComposition itself or in its private instructions. If rotations or other transformations are desired, they must be accomplished via the application of CIFilters during the execution of your specified handler. The video composition will also have the following values for its properties: - The original timing of the asset's first enabled video track will be used. - A renderSize that encompasses the asset's first enabled video track respecting the track's preferredTransform. - A renderScale of 1.0. The default CIContext has the following properties: - iOS: Device RGB color space - macOS: sRGB color space Example usage: ```objc [AVVideoComposition videoCompositionWithAsset:srcAsset applyingCIFiltersWithHandler: ^(AVAsynchronousCIImageFilteringRequest *request) { NSError *err = nil; CIImage *filtered = myRenderer(request, &err); if (filtered) [request finishWithImage:filtered context:nil]; else [request finishWithError:err]; } completionHandler: ^(AVVideoComposition * _Nullable videoComposition, NSError * _Nullable error) { if (videoComposition != nil) { playerItem.videoComposition = videoComposition else { // handle error }]; ``` - Parameter asset: An instance of AVAsset. - Parameter completionHandler: A block that is invoked when the new video composition has finished being created. If the `videoComposition` parameter is nil, the `error` parameter describes the failure that occurred.
     * @deprecated Use init(applyingFiltersTo:applier:)
     */
    static videoCompositionWithAsset$applyingCIFiltersWithHandler$completionHandler$(asset: _AVAsset, applier: (request: _AVAsynchronousCIImageFilteringRequest) => void, completionHandler: ((videoComposition: _AVVideoComposition, error: _NSError) => void) | null): void;
    /**
     * Indicates whether the timeRanges of the receiver's instructions conform to the requirements described for them immediately above (in connection with the instructions property) and also whether all of the layer instructions have a value for trackID that corresponds either to a track of the specified asset or to the receiver's animationTool. In the course of validation, the receiver will invoke its validationDelegate with reference to any trouble spots in the video composition. An exception will be raised if the delegate modifies the receiver's array of instructions or the array of layerInstructions of any AVVideoCompositionInstruction contained therein during validation. - Parameter asset: Pass a reference to an AVAsset if you wish to validate the timeRanges of the instructions against the duration of the asset and the trackIDs of the layer instructions against the asset's tracks. Pass nil to skip that validation. Clients should ensure that the keys @"tracks" and @"duration" are already loaded on the AVAsset before validation is attempted. - Parameter timeRange: A CMTimeRange. Only those instructions with timeRanges that overlap with the specified timeRange will be validated. To validate all instructions that may be used for playback or other processing, regardless of timeRange, pass CMTimeRangeMake(kCMTimeZero, kCMTimePositiveInfinity). - Parameter validationDelegate: Indicates an object implementing the AVVideoCompositionValidationHandling protocol to receive information about troublesome portions of a video composition during processing of -isValidForAsset:. May be nil.
     * @deprecated Use isValidForTracks:assetDuration:timeRange:validationDelegate: instead
     */
    isValidForAsset$timeRange$validationDelegate$(asset: _AVAsset | null, timeRange: CMTimeRange, validationDelegate: _AVVideoCompositionValidationHandling | null): boolean;
    /**
     * Determines whether the timeRanges of the receiver's instructions conform to the requirements described for them immediately above (in connection with the instructions property) and also whether all of the layer instructions have a value for trackID that corresponds either to a track of the specified asset or to the receiver's animationTool. In the course of validation, the receiver will invoke its validationDelegate with reference to any trouble spots in the video composition. An exception will be raised if the delegate modifies the receiver's array of instructions or the array of layerInstructions of any AVVideoCompositionInstruction contained therein during validation. - Parameter asset: Pass a reference to an AVAsset if you wish to validate the timeRanges of the instructions against the duration of the asset and the trackIDs of the layer instructions against the asset's tracks. Pass nil to skip that validation. - Parameter timeRange: A CMTimeRange. Only those instructions with timeRanges that overlap with the specified timeRange will be validated. To validate all instructions that may be used for playback or other processing, regardless of timeRange, pass CMTimeRangeMake(kCMTimeZero, kCMTimePositiveInfinity). - Parameter validationDelegate: Indicates an object implementing the AVVideoCompositionValidationHandling protocol to receive information about troublesome portions of a video composition during processing of -determineValidityForAsset:. May be nil. - Parameter completionHandler: A block that is invoked when a determination is made about whether the video composition is valid. If the `isValid` parameter is NO, either the video composition is not valid, in which case the `error` parameter will be nil, or the answer could not be determined, in which case the `error` parameter will be non-nil and describe the failure that occurred.
     * @deprecated isValidForTracks:assetDuration:timeRange:validationDelegate:
     */
    determineValidityForAsset$timeRange$validationDelegate$completionHandler$(asset: _AVAsset | null, timeRange: CMTimeRange, validationDelegate: _AVVideoCompositionValidationHandling | null, completionHandler: ((isValid: boolean, error: _NSError) => void) | null): void;
    /**
     * Indicates whether the timeRanges of the receiver's instructions conform to the requirements described for them immediately above (in connection with the instructions property) and also whether all of the layer instructions have a value for trackID that corresponds either to a track of the specified asset or to the receiver's animationTool. In the course of validation, the receiver will invoke its validationDelegate with reference to any trouble spots in the video composition. An exception will be raised if the delegate modifies the receiver's array of instructions or the array of layerInstructions of any AVVideoCompositionInstruction contained therein during validation. - Parameter tracks: Pass a reference to an AVAsset's tracks if you wish to validate the trackIDs of the layer instructions against the asset's tracks. Pass nil to skip that validation. This method throws an exception if the tracks are not all from the same asset. - Parameter duration: Pass an AVAsset if you wish to validate the timeRanges of the instructions against the duration of the asset. Pass kCMTimeInvalid to skip that validation. - Parameter timeRange: A CMTimeRange. Only those instructions with timeRanges that overlap with the specified timeRange will be validated. To validate all instructions that may be used for playback or other processing, regardless of timeRange, pass CMTimeRangeMake(kCMTimeZero, kCMTimePositiveInfinity). - Parameter validationDelegate: Indicates an object implementing the AVVideoCompositionValidationHandling protocol to receive information about troublesome portions of a video composition during processing of -isValidForAsset:. May be nil.
     */
    isValidForTracks$assetDuration$timeRange$validationDelegate$(tracks: _NSArray, duration: CMTime, timeRange: CMTimeRange, validationDelegate: _AVVideoCompositionValidationHandling | null): boolean;
    /**
     * Indicates a custom compositor class to use. The class must implement the AVVideoCompositing protocol. If nil, the default, internal video compositor is used
     */
    customVideoCompositorClass(): NobjcObject;
    /**
     * Indicates the interval which the video composition, when enabled, should render composed video frames
     */
    frameDuration(): CMTime;
    /**
     * File: AVVideoComposition.h Framework: AVFoundation Copyright 2010-2023 Apple Inc. All rights reserved. / #import <AVFoundation/AVBase.h> #import <AVFoundation/AVAsset.h> #import <AVFoundation/AVVideoCompositing.h> #import <AVFoundation/AVSpatialVideoConfiguration.h> #import <Foundation/Foundation.h> #import <CoreVideo/CoreVideo.h> #import <CoreMedia/CMTime.h> #import <CoreMedia/CMTimeRange.h> NS_ASSUME_NONNULL_BEGIN @class AVVideoCompositionCoreAnimationTool; @class AVVideoCompositionInternal; @class AVVideoCompositionLayerInstruction; @class AVVideoCompositionInstruction; @class CIContext; @class CIImage; /// An AVVideoComposition object represents an immutable video composition. /// /// A video composition describes, for any time in the aggregate time range of its instructions, the number and IDs of video tracks that are to be used in order to produce a composed video frame corresponding to that time. When AVFoundation's built-in video compositor is used, the instructions an AVVideoComposition contain can specify a spatial transformation, an opacity value, and a cropping rectangle for each video source, and these can vary over time via simple linear ramping functions. /// /// A client can implement their own custom video compositor by implementing the AVVideoCompositing protocol; a custom video compositor is provided with pixel buffers for each of its video sources during playback and other operations and can perform arbitrary graphical operations on them in order to produce visual output. /// /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type. API_AVAILABLE(macos(10.7), ios(4.0), tvos(9.0), visionos(1.0)) API_UNAVAILABLE(watchos) @interface AVVideoComposition : NSObject <NSCopying, NSMutableCopying> { @private AVVideoCompositionInternal *_videoComposition; } /// Configures policy for per frame HDR display metadata /// /// Determines what HDR display metadata should be attached to the rendered frame. typedef NSString *AVVideoCompositionPerFrameHDRDisplayMetadataPolicy NS_TYPED_ENUM API_AVAILABLE(macos(14.0), ios(17.0), visionos(1.0)) API_UNAVAILABLE(tvos, watchos); /// Default. Pass the HDR metadata through, if present on the composed frame. AVF_EXPORT AVVideoCompositionPerFrameHDRDisplayMetadataPolicy const AVVideoCompositionPerFrameHDRDisplayMetadataPolicyPropagate API_AVAILABLE(macos(14.0), ios(17.0), visionos(1.0)) API_UNAVAILABLE(tvos, watchos); /// AVVideoComposition may generate HDR metadata and attach it to the rendered frame. HDR metadata generation is influenced by the color space of the rendered frame, device, and HDR metadata format platform support. Any previously attached HDR metadata of the same metadata format will be overwritten. AVF_EXPORT AVVideoCompositionPerFrameHDRDisplayMetadataPolicy const AVVideoCompositionPerFrameHDRDisplayMetadataPolicyGenerate API_AVAILABLE(macos(14.0), ios(17.0), visionos(1.0)) API_UNAVAILABLE(tvos, watchos); /// Returns a new instance of AVVideoComposition with values and instructions suitable for presenting the video tracks of the specified asset according to its temporal and geometric properties and those of its tracks. /// /// The returned AVVideoComposition will have instructions that respect the spatial properties and timeRanges of the specified asset's video tracks. /// It will also have the following values for its properties: /// /// - If the asset has exactly one video track, the original timing of the source video track will be used. If the asset has more than one video track, and the nominal frame rate of any of video tracks is known, the reciprocal of the greatest known nominalFrameRate will be used as the value of frameDuration. Otherwise, a default framerate of 30fps is used. /// - If the specified asset is an instance of AVComposition, the renderSize will be set to the naturalSize of the AVComposition; otherwise the renderSize will be set to a value that encompasses all of the asset's video tracks. /// - A renderScale of 1.0. /// - A nil animationTool. /// /// If the specified asset has no video tracks, this method will return an AVVideoComposition instance with an empty collection of instructions. /// /// - Parameter asset: An instance of AVAsset. Ensure that the duration and tracks properties of the asset are already loaded before invoking this method. /// /// - Returns: An instance of AVVideoComposition. + (AVVideoComposition *)videoCompositionWithPropertiesOfAsset:(AVAsset *)asset API_DEPRECATED("Use videoCompositionWithPropertiesOfAsset:completionHandler: instead", macos(10.9, 15.0), ios(6.0, 18.0), tvos(9.0, 18.0)) API_UNAVAILABLE(watchos, visionos); /// Vends a new instance of AVVideoComposition with values and instructions suitable for presenting the video tracks of the specified asset according to its temporal and geometric properties and those of its tracks. /// /// The new AVVideoComposition will have instructions that respect the spatial properties and timeRanges of the specified asset's video tracks. /// It will also have the following values for its properties: /// /// - If the asset has exactly one video track, the original timing of the source video track will be used. If the asset has more than one video track, and the nominal frame rate of any of video tracks is known, the reciprocal of the greatest known nominalFrameRate will be used as the value of frameDuration. Otherwise, a default framerate of 30fps is used. /// - If the specified asset is an instance of AVComposition, the renderSize will be set to the naturalSize of the AVComposition; otherwise the renderSize will be set to a value that encompasses all of the asset's video tracks. /// - A renderScale of 1.0. /// - A nil animationTool. /// /// If the specified asset has no video tracks, this method will return an AVVideoComposition instance with an empty collection of instructions. /// /// - Parameter asset: An instance of AVAsset. /// - Parameter completionHandler: A block that is invoked when the new video composition has finished being created. If the `videoComposition` parameter is nil, the `error` parameter describes the failure that occurred. + (void)videoCompositionWithPropertiesOfAsset:(AVAsset *)asset completionHandler:(void (^ NS_SWIFT_SENDABLE)(AVVideoComposition * _Nullable videoComposition, NSError * _Nullable error))completionHandler API_AVAILABLE(macos(13.0), ios(16.0), tvos(16.0), visionos(1.0)) API_UNAVAILABLE(watchos); /// Pass-through initializer, for internal use in AVFoundation only + (AVVideoComposition *)videoCompositionWithVideoComposition:(AVVideoComposition *)videoComposition API_UNAVAILABLE(macos, ios, tvos, visionos, watchos); /// Indicates a custom compositor class to use. The class must implement the AVVideoCompositing protocol. If nil, the default, internal video compositor is used @property (nonatomic, readonly, nullable) Class<AVVideoCompositing> customVideoCompositorClass API_AVAILABLE(macos(10.9), ios(7.0), tvos(9.0), visionos(1.0)) API_UNAVAILABLE(watchos); /// Indicates the interval which the video composition, when enabled, should render composed video frames @property (nonatomic, readonly) CMTime frameDuration; /// If sourceTrackIDForFrameTiming is not kCMPersistentTrackID_Invalid, frame timing for the video composition is derived from the source asset's track with the corresponding ID. This may be used to preserve a source asset's variable frame timing. If an empty edit is encountered in the source asset’s track, the compositor composes frames as needed up to the frequency specified in frameDuration property.
     */
    sourceTrackIDForFrameTiming(): number;
    /** Indicates the size at which the video composition, when enabled, should render */
    renderSize(): CGSize;
    /**
     * Indicates the scale at which the video composition should render. May only be other than 1.0 for a video composition set on an AVPlayerItem
     */
    renderScale(): number;
    /**
     * Indicates instructions for video composition via an NSArray of instances of classes implementing the AVVideoCompositionInstruction protocol. For the first instruction in the array, timeRange.start must be less than or equal to the earliest time for which playback or other processing will be attempted (note that this will typically be kCMTimeZero). For subsequent instructions, timeRange.start must be equal to the prior instruction's end time. The end time of the last instruction must be greater than or equal to the latest time for which playback or other processing will be attempted (note that this will often be the duration of the asset with which the instance of AVVideoComposition is associated).
     */
    instructions(): _NSArray;
    /**
     * Indicates a special video composition tool for use of Core Animation; may be nil
     */
    animationTool(): _AVVideoCompositionCoreAnimationTool | null;
    /**
     * List of all track IDs for tracks from which sample data should be presented to the compositor at any point in the overall composition. The sample data will be delivered to the custom compositor via AVAsynchronousVideoCompositionRequest.
     */
    sourceSampleDataTrackIDs(): _NSArray;
    /**
     * The output buffers of the video composition can be specified with the outputBufferDescription. The value is an array of CMTagCollectionRef objects that describes the output buffers. If the video composition will output tagged buffers, the details of those buffers should be specified with CMTags. Specifically, the StereoView (eyes) and ProjectionKind must be specified. The behavior is undefined if the output tagged buffers do not match the outputBufferDescription. The default is nil, which means monoscopic output. Note that an empty array is not valid. An exception will be thrown if the objects in the array are not of type CMTagCollectionRef. Note that tagged buffers are only supported for custom compositors.
     */
    outputBufferDescription(): _NSArray;
    /**
     * Indicates the spatial configurations that are available to associate with the output of the video composition. A custom compositor can output spatial video by specifying one of these spatial configurations. A spatial configuration with all nil values indicates the video is not spatial. A nil spatial configuration also indicates the video is not spatial. The value can be nil, which indicates the output will not be spatial. NOTE: If this property is not empty, then the client must attach one of the spatial configurations in this array to all of the pixel buffers, otherwise an exception will be thrown.
     */
    spatialVideoConfigurations(): _NSArray;
    /**
     * Rendering will use these primaries and frames will be tagged as such. If the value of this property is nil then the source's primaries will be propagated and used. Default is nil. Valid values are those suitable for AVVideoColorPrimariesKey. Generally set as a triple along with colorYCbCrMatrix and colorTransferFunction.
     */
    colorPrimaries(): _NSString;
    /**
     * Rendering will use this matrix and frames will be tagged as such. If the value of this property is nil then the source's matrix will be propagated and used. Default is nil. Valid values are those suitable for AVVideoYCbCrMatrixKey. Generally set as a triple along with colorPrimaries and colorTransferFunction.
     */
    colorYCbCrMatrix(): _NSString;
    /**
     * Rendering will use this transfer function and frames will be tagged as such. If the value of this property is nil then the source's transfer function will be propagated and used. Default is nil. Valid values are those suitable for AVVideoTransferFunctionKey. Generally set as a triple along with colorYCbCrMatrix and colorYCbCrMatrix.
     */
    colorTransferFunction(): _NSString;
    /**
     * Configures policy for per frame HDR display metadata on the rendered frame Allows the system to identify situations where HDR metadata can be generated and attached to the rendered video frame. Default is AVVideoCompositionPerFrameHDRDisplayMetadataPolicyPropagate. Any HDR metadata attached to the composed frame will be propagated to the rendered video frames.
     */
    perFrameHDRDisplayMetadataPolicy(): AVVideoCompositionPerFrameHDRDisplayMetadataPolicy;
}
export interface _AVVideoComposition extends _NSCopying, _NSMutableCopying {
}
