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 video frames that will be sent to the processor, as source frames, reference frames, or output frames.  Instances retain the buffer backing them.
16    ///
17    /// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/vtframeprocessorframe?language=objc)
18    #[unsafe(super(NSObject))]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    #[cfg(feature = "objc2")]
21    pub struct VTFrameProcessorFrame;
22);
23
24#[cfg(feature = "objc2")]
25extern_conformance!(
26    unsafe impl NSObjectProtocol for VTFrameProcessorFrame {}
27);
28
29#[cfg(feature = "objc2")]
30impl VTFrameProcessorFrame {
31    extern_methods!(
32        #[cfg(all(feature = "objc2-core-media", feature = "objc2-core-video"))]
33        /// initialize class with a CVPixelBufferRef and a presentation time. Buffer is retained.  Returns nil if no CVPixelBuffer is provided or CVPixelBuffer is not IOSurface backed.
34        ///
35        /// Parameter `buffer`: The CVPixelBufferRef that this VTFrameProcessorFrame will wrap.  Must not be nil and must be IOSurface backed.
36        ///
37        /// Parameter `presentationTimeStamp`: The presentation timestamp of the buffer.
38        #[unsafe(method(initWithBuffer:presentationTimeStamp:))]
39        #[unsafe(method_family = init)]
40        pub unsafe fn initWithBuffer_presentationTimeStamp(
41            this: Allocated<Self>,
42            buffer: &CVPixelBuffer,
43            presentation_time_stamp: CMTime,
44        ) -> Option<Retained<Self>>;
45
46        #[unsafe(method(init))]
47        #[unsafe(method_family = init)]
48        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
49
50        #[unsafe(method(new))]
51        #[unsafe(method_family = new)]
52        pub unsafe fn new() -> Retained<Self>;
53
54        #[cfg(feature = "objc2-core-video")]
55        /// Returns the CVPixelBufferRef  that was provided when the object was initialized with.
56        #[unsafe(method(buffer))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn buffer(&self) -> Retained<CVPixelBuffer>;
59
60        #[cfg(feature = "objc2-core-media")]
61        /// Returns the presentation timestamp that was provided when the object was initialized with
62        #[unsafe(method(presentationTimeStamp))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn presentationTimeStamp(&self) -> CMTime;
65    );
66}
67
68#[cfg(feature = "objc2")]
69extern_class!(
70    /// Helper class to wrap optical flow that will be sent to the processor.   Instances retain the buffers backing them.
71    ///
72    /// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/vtframeprocessoropticalflow?language=objc)
73    #[unsafe(super(NSObject))]
74    #[derive(Debug, PartialEq, Eq, Hash)]
75    #[cfg(feature = "objc2")]
76    pub struct VTFrameProcessorOpticalFlow;
77);
78
79#[cfg(feature = "objc2")]
80extern_conformance!(
81    unsafe impl NSObjectProtocol for VTFrameProcessorOpticalFlow {}
82);
83
84#[cfg(feature = "objc2")]
85impl VTFrameProcessorOpticalFlow {
86    extern_methods!(
87        #[cfg(feature = "objc2-core-video")]
88        /// initialize class with forward and backward optical flow CVPixelBufferRefs. Instances retain the buffers backing them. Returns nil if a nil CVPixelBuffer is provided or CVPixelBuffers are not IOSurface backed.
89        ///
90        /// Parameter `forwardFlow`: CVPixelBufferRef that contains forward optical flow. Must not be nil and must be IOSurface backed.
91        ///
92        /// Parameter `backwardFlow`: CVPixelBufferRef that contains backward optical flow. Must not be nil and must be IOSurface backed.
93        #[unsafe(method(initWithForwardFlow:backwardFlow:))]
94        #[unsafe(method_family = init)]
95        pub unsafe fn initWithForwardFlow_backwardFlow(
96            this: Allocated<Self>,
97            forward_flow: &CVPixelBuffer,
98            backward_flow: &CVPixelBuffer,
99        ) -> Option<Retained<Self>>;
100
101        #[unsafe(method(init))]
102        #[unsafe(method_family = init)]
103        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
104
105        #[unsafe(method(new))]
106        #[unsafe(method_family = new)]
107        pub unsafe fn new() -> Retained<Self>;
108
109        #[cfg(feature = "objc2-core-video")]
110        /// Returns the forward optical flow CVPixelBufferRef that was provided when the object was initialized.
111        #[unsafe(method(forwardFlow))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn forwardFlow(&self) -> Retained<CVPixelBuffer>;
114
115        #[cfg(feature = "objc2-core-video")]
116        /// Returns the backward optical flow CVPixelBufferRef that was provided when the object was initialized.
117        #[unsafe(method(backwardFlow))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn backwardFlow(&self) -> Retained<CVPixelBuffer>;
120    );
121}