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