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::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avsynchronizedlayer?language=objc)
    #[unsafe(super(CALayer, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "objc2-quartz-core")]
    #[cfg(not(target_os = "watchos"))]
    pub struct AVSynchronizedLayer;
);

#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
extern_conformance!(
    unsafe impl CAMediaTiming for AVSynchronizedLayer {}
);

#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
extern_conformance!(
    unsafe impl NSCoding for AVSynchronizedLayer {}
);

#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for AVSynchronizedLayer {}
);

#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
extern_conformance!(
    unsafe impl NSSecureCoding for AVSynchronizedLayer {}
);

#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
impl AVSynchronizedLayer {
    extern_methods!(
        #[cfg(feature = "AVPlayerItem")]
        /// Returns an instance of AVSynchronizedLayer with timing synchronized with the specified AVPlayerItem.
        ///
        /// Returns: An instance of AVSynchronizedLayer.
        #[unsafe(method(synchronizedLayerWithPlayerItem:))]
        #[unsafe(method_family = none)]
        pub unsafe fn synchronizedLayerWithPlayerItem(
            player_item: &AVPlayerItem,
        ) -> Retained<AVSynchronizedLayer>;

        #[cfg(feature = "AVPlayerItem")]
        /// Indicates the instance of AVPlayerItem to which the timing of the AVSynchronizedLayer is synchronized.
        ///
        /// Before macOS 13, iOS 16, tvOS 16, and watchOS 9, this property must be accessed on the main thread/queue.
        #[unsafe(method(playerItem))]
        #[unsafe(method_family = none)]
        pub unsafe fn playerItem(&self, mtm: MainThreadMarker) -> Option<Retained<AVPlayerItem>>;

        #[cfg(feature = "AVPlayerItem")]
        /// Setter for [`playerItem`][Self::playerItem].
        #[unsafe(method(setPlayerItem:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPlayerItem(
            &self,
            player_item: Option<&AVPlayerItem>,
            mtm: MainThreadMarker,
        );
    );
}

/// Methods declared on superclass `CALayer`.
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
impl AVSynchronizedLayer {
    extern_methods!(
        /// Layer creation and initialization. *
        #[unsafe(method(layer))]
        #[unsafe(method_family = none)]
        pub unsafe fn layer() -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        /// # Safety
        ///
        /// `layer` should be of the correct type.
        #[unsafe(method(initWithLayer:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
impl AVSynchronizedLayer {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}