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"))]
28extern_conformance!(
29 unsafe impl CAMediaTiming for AVPlayerLayer {}
30);
31
32#[cfg(feature = "objc2-quartz-core")]
33#[cfg(not(target_os = "watchos"))]
34extern_conformance!(
35 unsafe impl NSCoding for AVPlayerLayer {}
36);
37
38#[cfg(feature = "objc2-quartz-core")]
39#[cfg(not(target_os = "watchos"))]
40extern_conformance!(
41 unsafe impl NSObjectProtocol for AVPlayerLayer {}
42);
43
44#[cfg(feature = "objc2-quartz-core")]
45#[cfg(not(target_os = "watchos"))]
46extern_conformance!(
47 unsafe impl NSSecureCoding for AVPlayerLayer {}
48);
49
50#[cfg(feature = "objc2-quartz-core")]
51#[cfg(not(target_os = "watchos"))]
52impl AVPlayerLayer {
53 extern_methods!(
54 #[cfg(feature = "AVPlayer")]
55 #[unsafe(method(playerLayerWithPlayer:))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn playerLayerWithPlayer(player: Option<&AVPlayer>) -> Retained<AVPlayerLayer>;
61
62 #[cfg(feature = "AVPlayer")]
63 #[unsafe(method(player))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn player(&self, mtm: MainThreadMarker) -> Option<Retained<AVPlayer>>;
67
68 #[cfg(feature = "AVPlayer")]
69 #[unsafe(method(setPlayer:))]
71 #[unsafe(method_family = none)]
72 pub unsafe fn setPlayer(&self, player: Option<&AVPlayer>);
73
74 #[cfg(feature = "AVAnimation")]
75 #[unsafe(method(videoGravity))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn videoGravity(&self) -> Retained<AVLayerVideoGravity>;
85
86 #[cfg(feature = "AVAnimation")]
87 #[unsafe(method(setVideoGravity:))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn setVideoGravity(&self, video_gravity: &AVLayerVideoGravity);
93
94 #[unsafe(method(isReadyForDisplay))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn isReadyForDisplay(&self) -> bool;
103
104 #[cfg(feature = "objc2-core-foundation")]
105 #[unsafe(method(videoRect))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn videoRect(&self) -> CGRect;
109
110 #[unsafe(method(pixelBufferAttributes))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn pixelBufferAttributes(
119 &self,
120 ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
121
122 #[unsafe(method(setPixelBufferAttributes:))]
130 #[unsafe(method_family = none)]
131 pub unsafe fn setPixelBufferAttributes(
132 &self,
133 pixel_buffer_attributes: Option<&NSDictionary<NSString, AnyObject>>,
134 );
135
136 #[cfg(feature = "objc2-core-video")]
137 #[unsafe(method(copyDisplayedPixelBuffer))]
143 #[unsafe(method_family = copy)]
144 pub unsafe fn copyDisplayedPixelBuffer(&self) -> Option<Retained<CVPixelBuffer>>;
145 );
146}
147
148#[cfg(feature = "objc2-quartz-core")]
150#[cfg(not(target_os = "watchos"))]
151impl AVPlayerLayer {
152 extern_methods!(
153 #[unsafe(method(layer))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn layer() -> Retained<Self>;
157
158 #[unsafe(method(init))]
159 #[unsafe(method_family = init)]
160 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
161
162 #[unsafe(method(initWithLayer:))]
166 #[unsafe(method_family = init)]
167 pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
168 );
169}
170
171#[cfg(feature = "objc2-quartz-core")]
173#[cfg(not(target_os = "watchos"))]
174impl AVPlayerLayer {
175 extern_methods!(
176 #[unsafe(method(new))]
177 #[unsafe(method_family = new)]
178 pub unsafe fn new() -> Retained<Self>;
179 );
180}