objc2_video_toolbox/generated/
VTFrameProcessorFrame.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4#[cfg(feature = "objc2")]
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-media")]
7use objc2_core_media::*;
8#[cfg(feature = "objc2-core-video")]
9use objc2_core_video::*;
10
11use crate::*;
12
13#[cfg(feature = "objc2")]
14extern_class!(
15    /// Helper class to wrap pixel buffers as video frames.
16    ///
17    /// You can use the frames as source frames, reference frames, or output frames of a processor. Frame instances retain
18    /// the backing pixel buffer.
19    ///
20    /// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/vtframeprocessorframe?language=objc)
21    #[unsafe(super(NSObject))]
22    #[derive(Debug, PartialEq, Eq, Hash)]
23    #[cfg(feature = "objc2")]
24    pub struct VTFrameProcessorFrame;
25);
26
27#[cfg(feature = "objc2")]
28extern_conformance!(
29    unsafe impl NSObjectProtocol for VTFrameProcessorFrame {}
30);
31
32#[cfg(feature = "objc2")]
33impl VTFrameProcessorFrame {
34    extern_methods!(
35        #[cfg(all(feature = "objc2-core-media", feature = "objc2-core-video"))]
36        /// Creates a new instance of frame with a pixel buffer and presentation timestamp.
37        ///
38        /// The `CVPixelBuffer` is retained in this object.
39        /// Returns `nil` if the ``CVPixelBuffer`` you provided is NULL or the ``CVPixelBuffer`` is not backed by ``IOSurface``.
40        ///
41        /// - Parameters:
42        /// - buffer: The ``CVPixelBuffer`` that this frame wraps; it must not be `nil` and must be ``IOSurface`` backed.
43        /// - presentationTimeStamp: The presentation timestamp of the buffer.
44        #[unsafe(method(initWithBuffer:presentationTimeStamp:))]
45        #[unsafe(method_family = init)]
46        pub unsafe fn initWithBuffer_presentationTimeStamp(
47            this: Allocated<Self>,
48            buffer: &CVPixelBuffer,
49            presentation_time_stamp: CMTime,
50        ) -> Option<Retained<Self>>;
51
52        #[unsafe(method(init))]
53        #[unsafe(method_family = init)]
54        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
55
56        #[unsafe(method(new))]
57        #[unsafe(method_family = new)]
58        pub unsafe fn new() -> Retained<Self>;
59
60        #[cfg(feature = "objc2-core-video")]
61        /// Pixel buffer that you provided when you initialized the object.
62        #[unsafe(method(buffer))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn buffer(&self) -> Retained<CVPixelBuffer>;
65
66        #[cfg(feature = "objc2-core-media")]
67        /// Presentation timestamp that you provided when you initialized the object.
68        #[unsafe(method(presentationTimeStamp))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn presentationTimeStamp(&self) -> CMTime;
71    );
72}
73
74#[cfg(feature = "objc2")]
75extern_class!(
76    /// Helper class to wrap optical flow.
77    ///
78    /// Instances retain the backing pixel buffers that you provide.
79    ///
80    /// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/vtframeprocessoropticalflow?language=objc)
81    #[unsafe(super(NSObject))]
82    #[derive(Debug, PartialEq, Eq, Hash)]
83    #[cfg(feature = "objc2")]
84    pub struct VTFrameProcessorOpticalFlow;
85);
86
87#[cfg(feature = "objc2")]
88extern_conformance!(
89    unsafe impl NSObjectProtocol for VTFrameProcessorOpticalFlow {}
90);
91
92#[cfg(feature = "objc2")]
93impl VTFrameProcessorOpticalFlow {
94    extern_methods!(
95        #[cfg(feature = "objc2-core-video")]
96        /// Creates a new instance of forward and backward optical flow with pixel buffers.
97        ///
98        /// Create a new instance with forward and backward optical flow ``CVPixelBuffer``s. Instances retain the pixel buffers
99        /// you provide to this method. Returns `nil` if either `CVPixelBuffer` is NULL or the `CVPixelBuffer`s are not `IOSurface` backed.
100        ///
101        /// - Parameters:
102        /// - forwardFlow: `CVPixelBuffer` that contains forward optical flow; it must not be `nil` and must be `IOSurface` backed.
103        /// - backwardFlow: `CVPixelBuffer` that contains backward optical flow; it must not be `nil` and must be `IOSurface` backed.
104        #[unsafe(method(initWithForwardFlow:backwardFlow:))]
105        #[unsafe(method_family = init)]
106        pub unsafe fn initWithForwardFlow_backwardFlow(
107            this: Allocated<Self>,
108            forward_flow: &CVPixelBuffer,
109            backward_flow: &CVPixelBuffer,
110        ) -> Option<Retained<Self>>;
111
112        #[unsafe(method(init))]
113        #[unsafe(method_family = init)]
114        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
115
116        #[unsafe(method(new))]
117        #[unsafe(method_family = new)]
118        pub unsafe fn new() -> Retained<Self>;
119
120        #[cfg(feature = "objc2-core-video")]
121        /// Returns the forward optical flow `CVPixelBuffer` that you provided when you initialized the object.
122        #[unsafe(method(forwardFlow))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn forwardFlow(&self) -> Retained<CVPixelBuffer>;
125
126        #[cfg(feature = "objc2-core-video")]
127        /// Returns the backward optical flow `CVPixelBuffer` that you provided when you initialized the object.
128        #[unsafe(method(backwardFlow))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn backwardFlow(&self) -> Retained<CVPixelBuffer>;
131    );
132}