AVVideoCompositionLayerInstruction Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AVFoundation.framework
Availability
Available in iOS 4.0 and later.
Declared in
AVVideoComposition.h

Overview

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

Tasks

Getting the Track ID

Getting Opacity, Transform, and Cropping Ramps

Properties

trackID

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

@property(nonatomic, readonly, assign) CMPersistentTrackID trackID
Availability
  • Available in iOS 4.0 and later.
Declared In
AVVideoComposition.h

Instance Methods

getCropRectangleRampForTime:startCropRectangle:endCropRectangle:timeRange:

Obtains the crop rectangle ramp that includes the specified time.

- (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

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

Availability
  • Available in iOS 7.0 and later.
Declared In
AVVideoComposition.h

getOpacityRampForTime:startOpacity:endOpacity:timeRange:

Obtains the opacity ramp that includes a specified time.

- (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

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

Availability
  • Available in iOS 4.0 and later.
Declared In
AVVideoComposition.h

getTransformRampForTime:startTransform:endTransform:timeRange:

Obtains the transform ramp that includes a specified time.

- (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

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

Availability
  • Available in iOS 4.0 and later.
Declared In
AVVideoComposition.h