objc2_av_foundation/generated/
AVPlayerLayer.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-core-video")]
9use objc2_core_video::*;
10use objc2_foundation::*;
11#[cfg(feature = "objc2-quartz-core")]
12#[cfg(not(target_os = "watchos"))]
13use objc2_quartz_core::*;
14
15use crate::*;
16
17extern_class!(
18 #[unsafe(super(CALayer, NSObject))]
20 #[derive(Debug, PartialEq, Eq, Hash)]
21 #[cfg(feature = "objc2-quartz-core")]
22 #[cfg(not(target_os = "watchos"))]
23 pub struct AVPlayerLayer;
24);
25
26#[cfg(feature = "objc2-quartz-core")]
27#[cfg(not(target_os = "watchos"))]
28unsafe impl CAMediaTiming for AVPlayerLayer {}
29
30#[cfg(feature = "objc2-quartz-core")]
31#[cfg(not(target_os = "watchos"))]
32unsafe impl NSCoding for AVPlayerLayer {}
33
34#[cfg(feature = "objc2-quartz-core")]
35#[cfg(not(target_os = "watchos"))]
36unsafe impl NSObjectProtocol for AVPlayerLayer {}
37
38#[cfg(feature = "objc2-quartz-core")]
39#[cfg(not(target_os = "watchos"))]
40unsafe impl NSSecureCoding for AVPlayerLayer {}
41
42#[cfg(feature = "objc2-quartz-core")]
43#[cfg(not(target_os = "watchos"))]
44impl AVPlayerLayer {
45 extern_methods!(
46 #[cfg(feature = "AVPlayer")]
47 #[unsafe(method(playerLayerWithPlayer:))]
51 #[unsafe(method_family = none)]
52 pub unsafe fn playerLayerWithPlayer(player: Option<&AVPlayer>) -> Retained<AVPlayerLayer>;
53
54 #[cfg(feature = "AVPlayer")]
55 #[unsafe(method(player))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn player(&self, mtm: MainThreadMarker) -> Option<Retained<AVPlayer>>;
59
60 #[cfg(feature = "AVPlayer")]
61 #[unsafe(method(setPlayer:))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn setPlayer(&self, player: Option<&AVPlayer>);
65
66 #[cfg(feature = "AVAnimation")]
67 #[unsafe(method(videoGravity))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn videoGravity(&self) -> Retained<AVLayerVideoGravity>;
77
78 #[cfg(feature = "AVAnimation")]
79 #[unsafe(method(setVideoGravity:))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn setVideoGravity(&self, video_gravity: &AVLayerVideoGravity);
83
84 #[unsafe(method(isReadyForDisplay))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn isReadyForDisplay(&self) -> bool;
93
94 #[cfg(feature = "objc2-core-foundation")]
95 #[unsafe(method(videoRect))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn videoRect(&self) -> CGRect;
99
100 #[unsafe(method(pixelBufferAttributes))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn pixelBufferAttributes(
109 &self,
110 ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
111
112 #[unsafe(method(setPixelBufferAttributes:))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn setPixelBufferAttributes(
116 &self,
117 pixel_buffer_attributes: Option<&NSDictionary<NSString, AnyObject>>,
118 );
119
120 #[cfg(feature = "objc2-core-video")]
121 #[unsafe(method(copyDisplayedPixelBuffer))]
127 #[unsafe(method_family = copy)]
128 pub unsafe fn copyDisplayedPixelBuffer(&self) -> Option<Retained<CVPixelBuffer>>;
129 );
130}
131
132#[cfg(feature = "objc2-quartz-core")]
134#[cfg(not(target_os = "watchos"))]
135impl AVPlayerLayer {
136 extern_methods!(
137 #[unsafe(method(layer))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn layer() -> Retained<Self>;
141
142 #[unsafe(method(init))]
143 #[unsafe(method_family = init)]
144 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
145
146 #[unsafe(method(initWithLayer:))]
147 #[unsafe(method_family = init)]
148 pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
149 );
150}
151
152#[cfg(feature = "objc2-quartz-core")]
154#[cfg(not(target_os = "watchos"))]
155impl AVPlayerLayer {
156 extern_methods!(
157 #[unsafe(method(new))]
158 #[unsafe(method_family = new)]
159 pub unsafe fn new() -> Retained<Self>;
160 );
161}