iOS Developer Library

Developer

AVFoundation Framework Reference AVVideoCompositionLayerInstruction Class Reference

Options
Deployment Target:

On This Page
Language:

AVVideoCompositionLayerInstruction

Inheritance


Conforms To


Import Statement


Swift

import AVFoundation

Objective-C

@import AVFoundation;

Availability


Available in iOS 4.0 and later.

An AVVideoCompositionLayerInstruction object represents the transform, opacity, and cropping ramps to apply to a given track.

  • trackID trackID Property

    The trackID of the source track to which the compositor will apply the instruction. (read-only)

    Declaration

    Swift

    var trackID: CMPersistentTrackID { get }

    Objective-C

    @property(nonatomic, readonly, assign) CMPersistentTrackID trackID

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 4.0 and later.

  • Obtains the opacity ramp that includes a specified time.

    Declaration

    Swift

    func getOpacityRampForTime(_ time: CMTime, startOpacity startOpacity: UnsafeMutablePointer<Float>, endOpacity endOpacity: UnsafeMutablePointer<Float>, timeRange timeRange: UnsafeMutablePointer<CMTimeRange>) -> Bool

    Objective-C

    - (BOOL)getOpacityRampForTime:(CMTime)time startOpacity:(float *)startOpacity endOpacity:(float *)endOpacity timeRange:(CMTimeRange *)timeRange

    Parameters

    time

    If a ramp with a time range that contains the specified time has been set, information about the effective ramp for that time is supplied. Otherwise, information about the first ramp that starts after the specified time is supplied.

    startOpacity

    A pointer to a float to receive the starting opacity value for the opacity ramp.

    This value may be NULL.

    endOpacity

    A pointer to a float to receive the ending opacity value for the opacity ramp.

    This value may be NULL.

    timeRange

    A pointer to a CMTimeRange to receive the time range of the opacity ramp.

    This value may be NULL.

    Return Value

    YEStrue if values are returned successfully, otherwise NOfalse. NOfalse is returned if time is beyond the duration of the last opacity ramp that has been set.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 4.0 and later.

  • Obtains the transform ramp that includes a specified time.

    Declaration

    Swift

    func getTransformRampForTime(_ time: CMTime, startTransform startTransform: UnsafeMutablePointer<CGAffineTransform>, endTransform endTransform: UnsafeMutablePointer<CGAffineTransform>, timeRange timeRange: UnsafeMutablePointer<CMTimeRange>) -> Bool

    Objective-C

    - (BOOL)getTransformRampForTime:(CMTime)time startTransform:(CGAffineTransform *)startTransform endTransform:(CGAffineTransform *)endTransform timeRange:(CMTimeRange *)timeRange

    Parameters

    time

    If a ramp with a time range that contains the specified time has been set, information about the effective ramp for that time is supplied. Otherwise, information about the first ramp that starts after the specified time is supplied.

    startTransform

    A pointer to a float to receive the starting transform value for the transform ramp.

    This value may be NULL.

    endTransform

    A pointer to a float to receive the ending transform value for the transform ramp.

    This value may be NULL.

    timeRange

    A pointer to a CMTimeRange to receive the time range of the transform ramp.

    This value may be NULL.

    Return Value

    YEStrue if values are returned successfully, otherwise NOfalse. NOfalse is returned if time is beyond the duration of the last transform ramp that has been set.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 4.0 and later.

  • Obtains the crop rectangle ramp that includes the specified time.

    Declaration

    Swift

    func getCropRectangleRampForTime(_ time: CMTime, startCropRectangle startCropRectangle: UnsafeMutablePointer<CGRect>, endCropRectangle endCropRectangle: UnsafeMutablePointer<CGRect>, timeRange timeRange: UnsafeMutablePointer<CMTimeRange>) -> Bool

    Objective-C

    - (BOOL)getCropRectangleRampForTime:(CMTime)time startCropRectangle:(CGRect *)startCropRectangle endCropRectangle:(CGRect *)endCropRectangle timeRange:(CMTimeRange *)timeRange

    Parameters

    time

    If a ramp with a time range that contains the specified time has been set, information about the effective ramp for that time is supplied. Otherwise, information about the first ramp that starts after the specified time is supplied.

    startCropRectangle

    A pointer to a CGRect to receive the starting crop rectangle value for the crop rectangle ramp.

    May be NULL.

    endCropRectangle

    A pointer to a CGRect to receive the ending crop rectangle value for the crop rectangle ramp.

    This value may be NULL.

    timeRange

    A pointer to a CMTimeRange to receive the time range of the crop rectangle ramp.

    This value may be NULL.

    Return Value

    NOfalse will be returned if the specified time is beyond the duration of the last crop rectangle ramp that has been set.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 7.0 and later.