Class AVVideoComposition

    • Constructor Detail

      • AVVideoComposition

        protected AVVideoComposition​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static AVVideoComposition allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • videoCompositionWithAssetApplyingCIFiltersWithHandler

        @NotNull
        @Deprecated
        public static @NotNull AVVideoComposition videoCompositionWithAssetApplyingCIFiltersWithHandler​(@NotNull
                                                                                                        @NotNull AVAsset asset,
                                                                                                        @NotNull
                                                                                                        @NotNull AVVideoComposition.Block_videoCompositionWithAssetApplyingCIFiltersWithHandler applier)
        Deprecated.
        videoCompositionWithAsset:applyingCIFiltersWithHandler: 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: 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]; }]; API-Since: 9.0 Deprecated-Since: 100000.0
        Parameters:
        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.
      • videoCompositionWithPropertiesOfAsset

        @NotNull
        @Deprecated
        public static @NotNull AVVideoComposition videoCompositionWithPropertiesOfAsset​(@NotNull
                                                                                        @NotNull AVAsset asset)
        Deprecated.
        videoCompositionWithPropertiesOfAsset: 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. API-Since: 6.0 Deprecated-Since: 100000.0
        Parameters:
        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.
      • animationTool

        @Nullable
        public @Nullable AVVideoCompositionCoreAnimationTool animationTool()
        indicates a special video composition tool for use of Core Animation; may be nil
      • colorPrimaries

        @Nullable
        public @Nullable java.lang.String colorPrimaries()
        [@property] colorPrimaries 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. API-Since: 10.0
      • colorTransferFunction

        @Nullable
        public @Nullable java.lang.String colorTransferFunction()
        [@property] colorTransferFunction 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. API-Since: 10.0
      • colorYCbCrMatrix

        @Nullable
        public @Nullable java.lang.String colorYCbCrMatrix()
        [@property] colorYCbCrMatrix 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. API-Since: 10.0
      • copyWithZone

        @NotNull
        public @NotNull java.lang.Object copyWithZone​(@Nullable
                                                      @Nullable org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        copyWithZone in interface NSCopying
      • customVideoCompositorClass

        @Nullable
        public @Nullable AVVideoCompositing customVideoCompositorClass()
        indicates a custom compositor class to use. The class must implement the AVVideoCompositing protocol. If nil, the default, internal video compositor is used API-Since: 7.0
      • frameDuration

        public CMTime frameDuration()
        indicates the interval which the video composition, when enabled, should render composed video frames
      • instructions

        @NotNull
        public @NotNull NSArray<?> instructions()
        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).
      • isValidForAssetTimeRangeValidationDelegate

        @Deprecated
        public boolean isValidForAssetTimeRangeValidationDelegate​(@Nullable
                                                                  @Nullable AVAsset asset,
                                                                  CMTimeRange timeRange,
                                                                  @Nullable
                                                                  @Nullable AVVideoCompositionValidationHandling validationDelegate)
        Deprecated.
        isValidForAsset:timeRange:validationDelegate: 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. API-Since: 5.0 Deprecated-Since: 100000.0
        Parameters:
        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.
        timeRange - A CMTimeRange. Only those instuctions 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).
        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.
      • mutableCopyWithZone

        @NotNull
        public @NotNull java.lang.Object mutableCopyWithZone​(@Nullable
                                                             @Nullable org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        mutableCopyWithZone in interface NSMutableCopying
      • renderScale

        public float renderScale()
        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 API-Since: 4.0
      • renderSize

        public CGSize renderSize()
        indicates the size at which the video composition, when enabled, should render
      • sourceTrackIDForFrameTiming

        public int sourceTrackIDForFrameTiming()
        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. API-Since: 11.0
      • sourceSampleDataTrackIDs

        @NotNull
        public @NotNull NSArray<? extends NSNumber> sourceSampleDataTrackIDs()
        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. API-Since: 15.0
      • determineValidityForAssetTimeRangeValidationDelegateCompletionHandler

        public void determineValidityForAssetTimeRangeValidationDelegateCompletionHandler​(@Nullable
                                                                                          @Nullable AVAsset asset,
                                                                                          CMTimeRange timeRange,
                                                                                          @Nullable
                                                                                          @Nullable AVVideoCompositionValidationHandling validationDelegate,
                                                                                          @NotNull
                                                                                          @NotNull AVVideoComposition.Block_determineValidityForAssetTimeRangeValidationDelegateCompletionHandler completionHandler)
        determineValidityForAsset:timeRange:validationDelegate:completionHandler: 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. API-Since: 16.0
        Parameters:
        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.
        timeRange - A CMTimeRange. Only those instuctions 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).
        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.
        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.
      • videoCompositionWithAssetApplyingCIFiltersWithHandlerCompletionHandler

        public static void videoCompositionWithAssetApplyingCIFiltersWithHandlerCompletionHandler​(@NotNull
                                                                                                  @NotNull AVAsset asset,
                                                                                                  @NotNull
                                                                                                  @NotNull AVVideoComposition.Block_videoCompositionWithAssetApplyingCIFiltersWithHandlerCompletionHandler_1 applier,
                                                                                                  @NotNull
                                                                                                  @NotNull AVVideoComposition.Block_videoCompositionWithAssetApplyingCIFiltersWithHandlerCompletionHandler_2 completionHandler)
        videoCompositionWithAsset:applyingCIFiltersWithHandler:completionHandler: 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: [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 }]; API-Since: 16.0
        Parameters:
        asset - An instance of AVAsset.
        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.
      • videoCompositionWithPropertiesOfAssetCompletionHandler

        public static void videoCompositionWithPropertiesOfAssetCompletionHandler​(@NotNull
                                                                                  @NotNull AVAsset asset,
                                                                                  @NotNull
                                                                                  @NotNull AVVideoComposition.Block_videoCompositionWithPropertiesOfAssetCompletionHandler completionHandler)
        videoCompositionWithPropertiesOfAsset:completionHandler: 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. API-Since: 16.0
        Parameters:
        asset - An instance of AVAsset.
        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.
      • perFrameHDRDisplayMetadataPolicy

        @NotNull
        public @NotNull java.lang.String perFrameHDRDisplayMetadataPolicy()
        [@property] perFrameHDRDisplayMetadataPolicy 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. API-Since: 17.0
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.