use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-av-foundation")]
use objc2_av_foundation::*;
#[cfg(feature = "objc2-core-video")]
use objc2_core_video::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-video-toolbox")]
use objc2_video_toolbox::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SCVideoStreamAnalyzerStreamDirection(pub NSInteger);
impl SCVideoStreamAnalyzerStreamDirection {
#[doc(alias = "SCVideoStreamAnalyzerStreamDirectionOutgoing")]
pub const Outgoing: Self = Self(1);
#[doc(alias = "SCVideoStreamAnalyzerStreamDirectionIncoming")]
pub const Incoming: Self = Self(2);
}
unsafe impl Encode for SCVideoStreamAnalyzerStreamDirection {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for SCVideoStreamAnalyzerStreamDirection {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(all(feature = "SCSensitivityAnalysis", feature = "block2"))]
pub type SCVideoStreamAnalysisChangeHandler =
*mut block2::DynBlock<dyn Fn(*mut SCSensitivityAnalysis, *mut NSError)>;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct SCVideoStreamAnalyzer;
);
extern_conformance!(
unsafe impl NSObjectProtocol for SCVideoStreamAnalyzer {}
);
impl SCVideoStreamAnalyzer {
extern_methods!(
#[cfg(feature = "SCSensitivityAnalysis")]
#[unsafe(method(analysis))]
#[unsafe(method_family = none)]
pub unsafe fn analysis(&self) -> Option<Retained<SCSensitivityAnalysis>>;
#[cfg(all(feature = "SCSensitivityAnalysis", feature = "block2"))]
#[unsafe(method(analysisChangedHandler))]
#[unsafe(method_family = none)]
pub unsafe fn analysisChangedHandler(&self) -> SCVideoStreamAnalysisChangeHandler;
#[cfg(all(feature = "SCSensitivityAnalysis", feature = "block2"))]
#[unsafe(method(setAnalysisChangedHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn setAnalysisChangedHandler(
&self,
analysis_changed_handler: SCVideoStreamAnalysisChangeHandler,
);
#[unsafe(method(initWithParticipantUUID:streamDirection:error:_))]
#[unsafe(method_family = init)]
pub unsafe fn initWithParticipantUUID_streamDirection_error(
this: Allocated<Self>,
participant_uuid: &NSString,
stream_direction: SCVideoStreamAnalyzerStreamDirection,
) -> Result<Retained<Self>, Retained<NSError>>;
#[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(&self) -> Retained<Self>;
#[cfg(feature = "objc2-core-video")]
#[unsafe(method(analyzePixelBuffer:))]
#[unsafe(method_family = none)]
pub unsafe fn analyzePixelBuffer(&self, pixel_buffer: &CVPixelBuffer);
);
}
impl SCVideoStreamAnalyzer {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new_class() -> Retained<Self>;
);
}
impl SCVideoStreamAnalyzer {
extern_methods!(
#[cfg(feature = "objc2-video-toolbox")]
#[unsafe(method(beginAnalysisOfDecompressionSession:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn beginAnalysisOfDecompressionSession_error(
&self,
decompression_session: &VTDecompressionSession,
) -> Result<(), Retained<NSError>>;
#[cfg(feature = "objc2-av-foundation")]
#[unsafe(method(beginAnalysisOfCaptureDeviceInput:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn beginAnalysisOfCaptureDeviceInput_error(
&self,
capture_device_input: &AVCaptureDeviceInput,
) -> Result<(), Retained<NSError>>;
#[unsafe(method(endAnalysis))]
#[unsafe(method_family = none)]
pub unsafe fn endAnalysis(&self);
#[unsafe(method(continueStream))]
#[unsafe(method_family = none)]
pub unsafe fn continueStream(&self);
);
}
#[cfg(feature = "SCSensitivityAnalysis")]
impl SCSensitivityAnalysis {
extern_methods!(
#[unsafe(method(shouldInterruptVideo))]
#[unsafe(method_family = none)]
pub unsafe fn shouldInterruptVideo(&self) -> bool;
#[unsafe(method(shouldIndicateSensitivity))]
#[unsafe(method_family = none)]
pub unsafe fn shouldIndicateSensitivity(&self) -> bool;
#[unsafe(method(shouldMuteAudio))]
#[unsafe(method_family = none)]
pub unsafe fn shouldMuteAudio(&self) -> bool;
);
}