objc2-av-foundation 0.3.2

Bindings to the AVFoundation framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-media")]
use objc2_core_media::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcompositiontracksegment?language=objc)
    #[unsafe(super(AVAssetTrackSegment, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "AVAssetTrackSegment")]
    pub struct AVCompositionTrackSegment;
);

#[cfg(feature = "AVAssetTrackSegment")]
unsafe impl Send for AVCompositionTrackSegment {}

#[cfg(feature = "AVAssetTrackSegment")]
unsafe impl Sync for AVCompositionTrackSegment {}

#[cfg(feature = "AVAssetTrackSegment")]
extern_conformance!(
    unsafe impl NSObjectProtocol for AVCompositionTrackSegment {}
);

#[cfg(feature = "AVAssetTrackSegment")]
impl AVCompositionTrackSegment {
    extern_methods!(
        #[cfg(feature = "objc2-core-media")]
        /// Returns an instance of AVCompositionTrackSegment that presents a portion of a file referenced by URL.
        ///
        /// Parameter `URL`: An instance of NSURL that references the container file to be presented by the AVCompositionTrackSegment.
        ///
        /// Parameter `trackID`: The track identifier that specifies the track of the container file to be presented by the AVCompositionTrackSegment.
        ///
        /// Parameter `sourceTimeRange`: The timeRange of the track of the container file to be presented by the AVCompositionTrackSegment.
        ///
        /// Parameter `targetTimeRange`: The timeRange of the composition track during which the AVCompositionTrackSegment is to be presented.
        ///
        /// Returns: An instance of AVCompositionTrackSegment.
        ///
        /// To specify that the segment be played at the asset's normal rate, set source.duration == target.duration in the timeMapping.
        /// Otherwise, the segment will be played at a rate equal to the ratio source.duration / target.duration.
        #[unsafe(method(compositionTrackSegmentWithURL:trackID:sourceTimeRange:targetTimeRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn compositionTrackSegmentWithURL_trackID_sourceTimeRange_targetTimeRange(
            url: &NSURL,
            track_id: CMPersistentTrackID,
            source_time_range: CMTimeRange,
            target_time_range: CMTimeRange,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-media")]
        /// Returns an instance of AVCompositionTrackSegment that presents an empty track segment.
        ///
        /// Parameter `timeRange`: The timeRange of the empty AVCompositionTrackSegment.
        ///
        /// Returns: An instance of AVCompositionTrackSegment.
        #[unsafe(method(compositionTrackSegmentWithTimeRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn compositionTrackSegmentWithTimeRange(
            time_range: CMTimeRange,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-media")]
        /// Initializes an instance of AVCompositionTrackSegment that presents a portion of a file referenced by URL.
        ///
        /// Parameter `URL`: An instance of NSURL that references the container file to be presented by the AVCompositionTrackSegment.
        ///
        /// Parameter `trackID`: The track identifier that specifies the track of the container file to be presented by the AVCompositionTrackSegment.
        ///
        /// Parameter `sourceTimeRange`: The timeRange of the track of the container file to be presented by the AVCompositionTrackSegment.
        ///
        /// Parameter `targetTimeRange`: The timeRange of the composition track during which the AVCompositionTrackSegment is to be presented.
        ///
        /// Returns: An instance of AVCompositionTrackSegment.
        ///
        /// To specify that the segment be played at the asset's normal rate, set source.duration == target.duration in the timeMapping.
        /// Otherwise, the segment will be played at a rate equal to the ratio source.duration / target.duration.
        #[unsafe(method(initWithURL:trackID:sourceTimeRange:targetTimeRange:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithURL_trackID_sourceTimeRange_targetTimeRange(
            this: Allocated<Self>,
            url: &NSURL,
            track_id: CMPersistentTrackID,
            source_time_range: CMTimeRange,
            target_time_range: CMTimeRange,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-media")]
        /// Initializes an instance of AVCompositionTrackSegment that presents an empty track segment.
        ///
        /// Parameter `timeRange`: The timeRange of the empty AVCompositionTrackSegment.
        ///
        /// Returns: An instance of AVCompositionTrackSegment.
        #[unsafe(method(initWithTimeRange:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithTimeRange(
            this: Allocated<Self>,
            time_range: CMTimeRange,
        ) -> Retained<Self>;

        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(isEmpty))]
        #[unsafe(method_family = none)]
        pub unsafe fn isEmpty(&self) -> bool;

        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(sourceURL))]
        #[unsafe(method_family = none)]
        pub unsafe fn sourceURL(&self) -> Option<Retained<NSURL>>;

        #[cfg(feature = "objc2-core-media")]
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(sourceTrackID))]
        #[unsafe(method_family = none)]
        pub unsafe fn sourceTrackID(&self) -> CMPersistentTrackID;
    );
}

/// Methods declared on superclass `AVAssetTrackSegment`.
#[cfg(feature = "AVAssetTrackSegment")]
impl AVCompositionTrackSegment {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}