objc2_av_foundation/generated/AVCaptionFormatConformer.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 /// Performs a conversion of canonical caption to conform to a specific format.
12 ///
13 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcaptionformatconformer?language=objc)
14 #[unsafe(super(NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 pub struct AVCaptionFormatConformer;
17);
18
19extern_conformance!(
20 unsafe impl NSObjectProtocol for AVCaptionFormatConformer {}
21);
22
23impl AVCaptionFormatConformer {
24 extern_methods!(
25 #[unsafe(method(init))]
26 #[unsafe(method_family = init)]
27 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
28
29 #[unsafe(method(new))]
30 #[unsafe(method_family = new)]
31 pub unsafe fn new() -> Retained<Self>;
32
33 #[cfg(feature = "AVCaptionSettings")]
34 /// Returns an instance of AVCaptionFormatConformer that can convert a canonical caption to conform to a specific format.
35 ///
36 /// Parameter `conversionSettings`: Describes the conversion operation for which the caption is to be conformed.
37 ///
38 /// Returns: A new instance of AVCaptionFormatConformer configured to perform the specified conversion.
39 ///
40 /// # Safety
41 ///
42 /// `conversion_settings` generic should be of the correct type.
43 #[unsafe(method(captionFormatConformerWithConversionSettings:))]
44 #[unsafe(method_family = none)]
45 pub unsafe fn captionFormatConformerWithConversionSettings(
46 conversion_settings: &NSDictionary<AVCaptionSettingsKey, AnyObject>,
47 ) -> Retained<Self>;
48
49 #[cfg(feature = "AVCaptionSettings")]
50 /// Returns an instance of AVCaptionFormatConformer that can convert a canonical caption to conform to a specific format.
51 ///
52 /// Parameter `conversionSettings`: Describes the conversion operation for which the caption is to be conformed.
53 ///
54 /// Returns: A new instance of AVCaptionFormatConformer configured to perform the specified conversion.
55 ///
56 /// This method throws an exception if the conversion setting's AVCaptionMediaTypeKey is not equal to AVMediaTypeClosedCaption, or if its AVCaptionMediaSubTypeKey is not equal to kCMClosedCaptionFormatType_CEA608.
57 ///
58 /// # Safety
59 ///
60 /// `conversion_settings` generic should be of the correct type.
61 #[unsafe(method(initWithConversionSettings:))]
62 #[unsafe(method_family = init)]
63 pub unsafe fn initWithConversionSettings(
64 this: Allocated<Self>,
65 conversion_settings: &NSDictionary<AVCaptionSettingsKey, AnyObject>,
66 ) -> Retained<Self>;
67
68 /// Specifies whether to conform the time range of a given canonical caption as well.
69 ///
70 /// When set to YES, conforms time range.
71 /// When set to NO, the time range of the conformed caption will be same as a given canonical caption.
72 /// In the case of conforming to CAE608 format, AVCaption is encoded so that each CAE608 control code (2 bytes) fits into 1 frame duration (1001/30000).
73 /// When set to YES and if all the encoded data can not fit inside the canonical caption time range, the caption time range will be extended to fit all the data and will be returned in the conformed AVCaption.
74 /// The default value is NO.
75 #[unsafe(method(conformsCaptionsToTimeRange))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn conformsCaptionsToTimeRange(&self) -> bool;
78
79 /// Setter for [`conformsCaptionsToTimeRange`][Self::conformsCaptionsToTimeRange].
80 #[unsafe(method(setConformsCaptionsToTimeRange:))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn setConformsCaptionsToTimeRange(&self, conforms_captions_to_time_range: bool);
83
84 #[cfg(feature = "AVCaption")]
85 /// Creates a format-compliant caption that conforms to a specific format by converting a given canonical caption.
86 ///
87 /// Parameter `caption`: Specifies a canonical caption to be converted.
88 ///
89 /// Parameter `outError`: A pointer where a NSError object may be returned.
90 ///
91 /// Returns: A format-compliant caption that conforms to a specific format.
92 #[unsafe(method(conformedCaptionForCaption:error:_))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn conformedCaptionForCaption_error(
95 &self,
96 caption: &AVCaption,
97 ) -> Result<Retained<AVCaption>, Retained<NSError>>;
98 );
99}