Skip to main content

cidre/av/sample_buffer/
display_layer.rs

1use crate::{arc, av, ca, define_obj_type, objc};
2
3define_obj_type!(
4    #[doc(alias = "AVSampleBufferDisplayLayer")]
5    pub DisplayLayer(ca::Layer),
6    AV_DISPLAY_LAYER
7);
8
9#[cfg(feature = "cm")]
10use crate::cm;
11
12#[cfg(feature = "cm")]
13impl DisplayLayer {
14    #[objc::msg_send(controlTimebase)]
15    pub fn control_timebase(&self) -> Option<&cm::Timebase>;
16
17    #[objc::msg_send(setControlTimebase:)]
18    pub fn set_control_timebase(&self, value: Option<&cm::Timebase>);
19}
20
21impl DisplayLayer {
22    #[objc::msg_send(videoGravity)]
23    pub fn video_gravity(&self) -> arc::R<av::LayerVideoGravity>;
24
25    #[objc::msg_send(setVideoGravity:)]
26    pub fn set_video_gravity(&mut self, value: &av::LayerVideoGravity);
27
28    /// Indicates that image data should be protected from capture.
29    #[objc::msg_send(preventsCapture)]
30    pub fn prevents_capture(&self) -> bool;
31
32    #[objc::msg_send(setPreventsCapture:)]
33    pub fn set_prevents_capture(&self, value: bool);
34
35    #[objc::msg_send(preventsDisplaySleepDuringVideoPlayback)]
36    pub fn prevents_display_sleep_during_video_playback(&self) -> bool;
37
38    #[objc::msg_send(setPreventsDisplaySleepDuringVideoPlayback:)]
39    pub fn set_prevents_display_sleep_during_video_playback(&self, value: bool);
40
41    #[objc::msg_send(outputObscuredDueToInsufficientExternalProtection)]
42    pub fn output_obscured_due_to_insufficient_external_protection(&self) -> bool;
43
44    #[objc::msg_send(sampleBufferRenderer)]
45    pub fn sample_buf_renderer(&self) -> arc::R<av::SampleBufVideoRenderer>;
46}
47
48unsafe extern "C" {
49    static AV_DISPLAY_LAYER: &'static objc::Class<DisplayLayer>;
50}