Class AVMutableMovie

  • All Implemented Interfaces:
    AVAsynchronousKeyValueLoading, NSCopying, NSMutableCopying, NSObject

    public class AVMutableMovie
    extends AVMovie
    AVMutableMovie AVMutableMovie adds to its immutable superclass, AVMovie, several categories of methods for editing QuickTime movie files, e.g. inserting and removing time ranges of media, adding and removing tracks, and modifying the metadata collections stored therein. By default, after creating an AVMutableMovie the defaultMediaDataStorage property will be nil and each associated AVMutableMovieTrack's mediaDataStorage property will be nil. If you want to create an AVMutableMovie from a file and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
    • Constructor Detail

      • AVMutableMovie

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • addMutableTrackWithMediaTypeCopySettingsFromTrackOptions

        public AVMutableMovieTrack addMutableTrackWithMediaTypeCopySettingsFromTrackOptions​(java.lang.String mediaType,
                                                                                            AVAssetTrack track,
                                                                                            NSDictionary<java.lang.String,​?> options)
        addMutableTrackWithMediaType:copySettingsFromTrack:options: Adds an empty track to the target movie. The trackID of the newly added track is a property of the returned instance of AVMutableMovieTrack.
        Parameters:
        mediaType - The media type of the new track (e.g. AVMediaTypeVideo for a video track).
        track - If you wish to transfer settings from an existing track, including track userdata and metadata, width, height, preferred volume, etc., pass a reference to an AVAssetTrack representing that track. Otherwise pass nil.
        options - An NSDictionary object that contains keys for specifying options for the initialization of the new AVMutableMovieTrack object. Currently no keys are defined; pass nil for default initialization behavior.
        Returns:
        An AVMutableMovieTrack object
      • addMutableTracksCopyingSettingsFromTracksOptions

        public NSArray<? extends AVMutableMovieTrack> addMutableTracksCopyingSettingsFromTracksOptions​(NSArray<? extends AVAssetTrack> existingTracks,
                                                                                                       NSDictionary<java.lang.String,​?> options)
        addMutableTracksCopyingSettingsFromTracks:options: Adds one or more empty tracks to the target movie, copying track settings from the source tracks. This method creates one or more empty tracks in the target movie and configures those tracks with settings (such as track userdata and metadata, width, height, and preferred volume) copied from the source tracks in the existingTracks array. Also, properties involving pairs of tracks (such as track references) are copied from the source tracks to the target tracks.
        Parameters:
        existingTracks - An array of AVAssetTrack objects.
        options - An NSDictionary object that contains keys for specifying options for the initialization of the new AVMutableMovieTrack objects. Currently no keys are defined; pass nil for default initialization behavior.
        Returns:
        An array of AVMutableMovieTrack objects; the index of a track in this array is the same as the index of its source track in the existingTracks array.
      • allocWithZone

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

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

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

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

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

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

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

        public AVMediaDataStorage defaultMediaDataStorage()
        [@property] defaultMediaDataStorage The default storage container for media data added to a movie. The value of this property is an AVMediaDataStorage object that indicates where sample data that is added to a movie should be written, for any track for whose mediaDataStorage property is nil.
        Overrides:
        defaultMediaDataStorage in class AVMovie
      • description_static

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

        public static long hash_static()
      • initWithDataOptions

        public AVMutableMovie initWithDataOptions​(NSData data,
                                                  NSDictionary<java.lang.String,​?> options)
        Description copied from class: AVMovie
        initWithData:options: Creates an AVMovie object from a movie header stored in an NSData object. You can use this method to operate on movie headers that are not stored in files. In general you should avoid loading an entire movie file with its media data into an instance of NSData! By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack's mediaDataStorage property will be nil. If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
        Overrides:
        initWithDataOptions in class AVMovie
        Parameters:
        data - An NSData object containing a movie header.
        options - An NSDictionary object that contains keys for specifying options for the initialization of the AVMovie object. Currently no keys are defined.
        Returns:
        An AVMovie object
      • initWithDataOptionsError

        public AVMutableMovie initWithDataOptionsError​(NSData data,
                                                       NSDictionary<java.lang.String,​?> options,
                                                       org.moe.natj.general.ptr.Ptr<NSError> outError)
        initWithData:options:error: Creates an AVMutableMovie object from a movie header stored in an NSData object. You can use this method to operate on movie headers that are not stored in files. In general you should avoid loading an entire movie file with its media data into an instance of NSData! By default, the defaultMediaDataStorage property will be nil and each associated AVMutableMovieTrack's mediaDataStorage property will be nil. If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
        Parameters:
        data - An NSData object containing a movie header.
        options - An NSDictionary object that contains keys for specifying options for the initialization of the AVMutableMovie object. Currently no keys are defined.
        outError - If an error occurs creating a movie, describes the nature of the failure.
        Returns:
        An AVMutableMovie object
      • initWithSettingsFromMovieOptionsError

        public AVMutableMovie initWithSettingsFromMovieOptionsError​(AVMovie movie,
                                                                    NSDictionary<java.lang.String,​?> options,
                                                                    org.moe.natj.general.ptr.Ptr<NSError> outError)
        initWithSettingsFromMovie:options:error: Creates an AVMutableMovie object without tracks (and therefore without media). By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack's mediaDataStorage property will be nil. If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
        Parameters:
        movie - If you wish to transfer settings from an existing movie (including movie userdata and metadata, preferred rate, preferred volume, etc.), pass a reference to an AVMovie object representing that movie. Otherwise pass nil. The userdata and metadata from the source movie may need to be converted if the format of that movie differs from fileType; you may wish to inspect the userdata or metadata of the receiver to ensure that important data was copied.
        options - An NSDictionary object that contains keys for specifying options for the initialization of the AVMutableMovie object. Currently no keys are defined; pass nil for default initialization behavior.
        outError - If an error occurs creating a movie, describes the nature of the failure.
        Returns:
        An AVMutableMovie object
      • initWithURLOptions

        public AVMutableMovie initWithURLOptions​(NSURL URL,
                                                 NSDictionary<java.lang.String,​?> options)
        Description copied from class: AVMovie
        initWithURL:options: Creates an AVMovie object from a movie header stored in a QuickTime movie file or ISO base media file. By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack's mediaDataStorage property will be nil. If you want to create an AVMutableMovie from a file and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
        Overrides:
        initWithURLOptions in class AVMovie
        Parameters:
        URL - An NSURL object that specifies a file containing a movie header.
        options - An NSDictionary object that contains keys for specifying options for the initialization of the AVMovie object. Currently no keys are defined.
        Returns:
        An AVMovie object
      • initWithURLOptionsError

        public AVMutableMovie initWithURLOptionsError​(NSURL URL,
                                                      NSDictionary<java.lang.String,​?> options,
                                                      org.moe.natj.general.ptr.Ptr<NSError> outError)
        initWithURL:options:error: Creates an AVMutableMovie object from a movie header stored in a QuickTime movie file or ISO base media file. By default, the defaultMediaDataStorage property will be nil and each associated AVMutableMovieTrack's mediaDataStorage property will be nil. If you want to create an AVMutableMovie from a file and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
        Parameters:
        URL - An NSURL object that specifies a file containing a movie header.
        options - An NSDictionary object that contains keys for specifying options for the initialization of the AVMutableMovie object. Currently no keys are defined.
        outError - If an error occurs creating a movie, describes the nature of the failure.
        Returns:
        An AVMutableMovie object
      • insertEmptyTimeRange

        public void insertEmptyTimeRange​(CMTimeRange timeRange)
        insertEmptyTimeRange: Adds an empty time range to the target movie.
        Parameters:
        timeRange - The time range to be made empty. Note that you cannot add empty time ranges to the end of a movie.
      • insertTimeRangeOfAssetAtTimeCopySampleDataError

        public boolean insertTimeRangeOfAssetAtTimeCopySampleDataError​(CMTimeRange timeRange,
                                                                       AVAsset asset,
                                                                       CMTime startTime,
                                                                       boolean copySampleData,
                                                                       org.moe.natj.general.ptr.Ptr<NSError> outError)
        insertTimeRange:ofAsset:atTime:copySampleData:error: Inserts all the tracks of a timeRange of an asset into a movie. This method may add new tracks to the target movie to ensure that all tracks of the asset are represented in the inserted timeRange. Existing content at the specified startTime will be pushed out by the duration of timeRange.
        Parameters:
        timeRange - The time range of the asset to be inserted.
        asset - An AVAsset object indicating the source of the inserted media. Only instances of AVURLAsset and AVComposition are supported. Must not be nil.
        startTime - The time in the target movie at which the media is to be inserted.
        copySampleData - A BOOL value that indicates whether sample data is to be copied from the source to the destination during edits. If YES, the sample data is written to the location specified by the track property mediaDataStorage if non-nil, or else by the movie property defaultMediaDataStorage if non-nil; if both are nil, the method will fail and return NO. If NO, sample data will not be written and sample references to the samples in their original container will be added as necessary. Note that in this case, this method will fail if the source AVAsset is not able to provide sample reference information for the original container.
        outError - If the insertion fails, an NSError object that describes the nature of the failure.
        Returns:
        A BOOL value that indicates the success of the insertion.
      • instanceMethodSignatureForSelector

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

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

        public CMTime interleavingPeriod()
        [@property] interleavingPeriod A CMTime that indicates the duration for interleaving runs of samples of each track. The default interleaving period is 0.5 seconds.
      • isModified

        public boolean isModified()
        [@property] modified Whether a movie has been modified. The value of this property is a BOOL that indicates whether the AVMutableMovie object has been modified since it was created, was last written, or had its modified state cleared via a call to setModified:NO.
      • isSubclassOfClass

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

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • metadata

        public NSArray<? extends AVMetadataItem> metadata()
        [@property] metadata A collection of metadata stored by the movie. The value of this property is an array of AVMetadataItem objects representing the collection of metadata stored by the movie.
        Overrides:
        metadata in class AVAsset
      • movieTypes

        public static NSArray<java.lang.String> movieTypes()
      • movieWithDataOptionsError

        public static AVMutableMovie movieWithDataOptionsError​(NSData data,
                                                               NSDictionary<java.lang.String,​?> options,
                                                               org.moe.natj.general.ptr.Ptr<NSError> outError)
        movieWithData:options:error: Creates an AVMutableMovie object from a movie header stored in an NSData object. You can use this method to operate on movie headers that are not stored in files. In general you should avoid loading an entire movie file with its media data into an instance of NSData! By default, the defaultMediaDataStorage property will be nil and each associated AVMutableMovieTrack's mediaDataStorage property will be nil. If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
        Parameters:
        data - An NSData object containing a movie header.
        options - An NSDictionary object that contains keys for specifying options for the initialization of the AVMutableMovie object. Currently no keys are defined.
        outError - If an error occurs creating a movie, describes the nature of the failure.
        Returns:
        An AVMutableMovie object
      • movieWithSettingsFromMovieOptionsError

        public static AVMutableMovie movieWithSettingsFromMovieOptionsError​(AVMovie movie,
                                                                            NSDictionary<java.lang.String,​?> options,
                                                                            org.moe.natj.general.ptr.Ptr<NSError> outError)
        movieWithSettingsFromMovie:options:error: Creates an AVMutableMovie object without tracks (and therefore without media). By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack's mediaDataStorage property will be nil. If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
        Parameters:
        movie - If you wish to transfer settings from an existing movie (including movie userdata and metadata, preferred rate, preferred volume, etc.), pass a reference to an AVMovie object representing that movie. Otherwise pass nil. The userdata and metadata from the source movie may need to be converted if the format of that movie differs from fileType; you may wish to inspect the userdata or metadata of the receiver to ensure that important data was copied.
        options - An NSDictionary object that contains keys for specifying options for the initialization of the AVMutableMovie object. Currently no keys are defined; pass nil for default initialization behavior.
        outError - If an error occurs creating a movie, describes the nature of the failure.
        Returns:
        An AVMutableMovie object
      • movieWithURLOptionsError

        public static AVMutableMovie movieWithURLOptionsError​(NSURL URL,
                                                              NSDictionary<java.lang.String,​?> options,
                                                              org.moe.natj.general.ptr.Ptr<NSError> outError)
        movieWithURL:options:error: Creates an AVMutableMovie object from a movie header stored in a QuickTime movie file or ISO base media file. By default, the defaultMediaDataStorage property will be nil and each associated AVMutableMovieTrack's mediaDataStorage property will be nil. If you want to create an AVMutableMovie from a file and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
        Parameters:
        URL - An NSURL object that specifies a file containing a movie header.
        options - An NSDictionary object that contains keys for specifying options for the initialization of the AVMutableMovie object. Currently no keys are defined.
        outError - If an error occurs creating a movie, describes the nature of the failure.
        Returns:
        An AVMutableMovie object
      • mutableTrackCompatibleWithTrack

        public AVMutableMovieTrack mutableTrackCompatibleWithTrack​(AVAssetTrack track)
        mutableTrackCompatibleWithTrack: Provides a reference to a track of a mutable movie into which any time range of an AVAssetTrack can be inserted (via -[AVMutableMovieTrack insertTimeRange:ofTrack:atTime:copySampleData:error:]). For best performance, the number of tracks in a movie should be kept to a minimum, corresponding to the number for which media data must be presented in parallel. If media data of the same type is to be presented serially, even from multiple assets, a single track of that media type should be used. This method, -mutableTrackCompatibleWithTrack:, can help the client to identify an existing target track for an insertion.
        Parameters:
        track - A reference to the AVAssetTrack from which a time range may be inserted.
        Returns:
        An AVMutableMovieTrack that can accommodate the insertion. If no such track is available, the result is nil. A new track of the same media type as the AVAssetTrack can be created via -addMutableTrackWithMediaType:copySettingsFromTrack:options:, and this new track will be compatible.
      • new_objc

        public static java.lang.Object new_objc()
      • preferredRate

        public float preferredRate()
        [@property] preferredRate The natural rate at which the movie is to be played; often but not always 1.0.
        Overrides:
        preferredRate in class AVAsset
      • preferredTransform

        public CGAffineTransform preferredTransform()
        [@property] preferredTransform A CGAffineTransform indicating the transform specified in the movie's storage container as the preferred transformation of the visual media data for display purposes; the value is often but not always CGAffineTransformIdentity.
        Overrides:
        preferredTransform in class AVAsset
      • preferredVolume

        public float preferredVolume()
        [@property] preferredVolume The preferred volume of the audible media data of the movie; often but not always 1.0.
        Overrides:
        preferredVolume in class AVAsset
      • removeTimeRange

        public void removeTimeRange​(CMTimeRange timeRange)
        removeTimeRange: Removes a specified time range from a movie.
        Parameters:
        timeRange - The time range to be removed.
      • removeTrack

        public void removeTrack​(AVMovieTrack track)
        removeTrack: Removes a track from the target movie.
        Parameters:
        track - The track to be removed.
      • resolveClassMethod

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

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

        public void scaleTimeRangeToDuration​(CMTimeRange timeRange,
                                             CMTime duration)
        scaleTimeRange:toDuration: Changes the duration of a time range of a movie.
        Parameters:
        timeRange - The time range to be scaled.
        duration - The new duration of the time range.
      • setDefaultMediaDataStorage

        public void setDefaultMediaDataStorage​(AVMediaDataStorage value)
        [@property] defaultMediaDataStorage The default storage container for media data added to a movie. The value of this property is an AVMediaDataStorage object that indicates where sample data that is added to a movie should be written, for any track for whose mediaDataStorage property is nil.
      • setInterleavingPeriod

        public void setInterleavingPeriod​(CMTime value)
        [@property] interleavingPeriod A CMTime that indicates the duration for interleaving runs of samples of each track. The default interleaving period is 0.5 seconds.
      • setMetadata

        public void setMetadata​(NSArray<? extends AVMetadataItem> value)
        [@property] metadata A collection of metadata stored by the movie. The value of this property is an array of AVMetadataItem objects representing the collection of metadata stored by the movie.
      • setModified

        public void setModified​(boolean value)
        [@property] modified Whether a movie has been modified. The value of this property is a BOOL that indicates whether the AVMutableMovie object has been modified since it was created, was last written, or had its modified state cleared via a call to setModified:NO.
      • setPreferredRate

        public void setPreferredRate​(float value)
        [@property] preferredRate The natural rate at which the movie is to be played; often but not always 1.0.
      • setPreferredTransform

        public void setPreferredTransform​(CGAffineTransform value)
        [@property] preferredTransform A CGAffineTransform indicating the transform specified in the movie's storage container as the preferred transformation of the visual media data for display purposes; the value is often but not always CGAffineTransformIdentity.
      • setPreferredVolume

        public void setPreferredVolume​(float value)
        [@property] preferredVolume The preferred volume of the audible media data of the movie; often but not always 1.0.
      • setTimescale

        public void setTimescale​(int value)
        [@property] timescale For file types that contain a 'moov' atom, such as QuickTime Movie files, specifies the time scale of the movie. The default movie time scale is 600. In certain cases, you may want to set this to a different value. For instance, a movie that contains a single audio track should typically have the movie time scale set to the media time scale of that track. This property should be set on a new empty movie before any edits are performed on the movie.
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

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

        public int timescale()
        [@property] timescale For file types that contain a 'moov' atom, such as QuickTime Movie files, specifies the time scale of the movie. The default movie time scale is 600. In certain cases, you may want to set this to a different value. For instance, a movie that contains a single audio track should typically have the movie time scale set to the media time scale of that track. This property should be set on a new empty movie before any edits are performed on the movie.
      • trackWithTrackID

        public AVMutableMovieTrack trackWithTrackID​(int trackID)
        trackWithTrackID: Provides an instance of AVMutableMovieTrack that represents the track of the specified trackID. Becomes callable without blocking when the key @"tracks" has been loaded
        Overrides:
        trackWithTrackID in class AVMovie
        Parameters:
        trackID - The trackID of the requested AVMutableMovieTrack.
        Returns:
        An instance of AVMutableMovieTrack; may be nil if no track of the specified trackID is available.
      • tracks

        public NSArray<? extends AVMutableMovieTrack> tracks()
        [@property] tracks The tracks in a mutable movie. The value of this property is an array of tracks the mutable movie contains; the tracks are of type AVMutableMovieTrack.
        Overrides:
        tracks in class AVMovie
      • tracksWithMediaCharacteristic

        public NSArray<? extends AVMutableMovieTrack> tracksWithMediaCharacteristic​(java.lang.String mediaCharacteristic)
        tracksWithMediaCharacteristic: Provides an array of AVMutableMovieTracks of the asset that present media with the specified characteristic. Becomes callable without blocking when the key @"tracks" has been loaded
        Overrides:
        tracksWithMediaCharacteristic in class AVMovie
        Parameters:
        mediaCharacteristic - The media characteristic according to which the receiver filters its AVMutableMovieTracks. (Media characteristics are defined in AVMediaFormat.h)
        Returns:
        An NSArray of AVMutableMovieTracks; may be empty if no tracks with the specified characteristic are available.
      • tracksWithMediaType

        public NSArray<? extends AVMutableMovieTrack> tracksWithMediaType​(java.lang.String mediaType)
        tracksWithMediaType: Provides an array of AVMutableMovieTracks of the asset that present media of the specified media type. Becomes callable without blocking when the key @"tracks" has been loaded
        Overrides:
        tracksWithMediaType in class AVMovie
        Parameters:
        mediaType - The media type according to which the receiver filters its AVMutableMovieTracks. (Media types are defined in AVMediaFormat.h)
        Returns:
        An NSArray of AVMutableMovieTracks; may be empty if no tracks of the specified media type are available.
      • version_static

        public static long version_static()