Package apple.avfoundation
Class AVCaptureSession
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.avfoundation.AVCaptureSession
-
- All Implemented Interfaces:
NSObject
- Direct Known Subclasses:
AVCaptureMultiCamSession
public class AVCaptureSession extends NSObject
AVCaptureSession AVCaptureSession is the central hub of the AVFoundation capture classes. To perform a real-time capture, a client may instantiate AVCaptureSession and add appropriate AVCaptureInputs, such as AVCaptureDeviceInput, and outputs, such as AVCaptureMovieFileOutput. [AVCaptureSession startRunning] starts the flow of data from the inputs to the outputs, and [AVCaptureSession stopRunning] stops the flow. A client may set the sessionPreset property to customize the quality level or bitrate of the output. API-Since: 4.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Block_accessibilityActivateBlock_ret, NSObject.Block_accessibilityActivationPointBlock_ret, NSObject.Block_accessibilityAttributedHintBlock_ret, NSObject.Block_accessibilityAttributedLabelBlock_ret, NSObject.Block_accessibilityAttributedUserInputLabelsBlock_ret, NSObject.Block_accessibilityAttributedValueBlock_ret, NSObject.Block_accessibilityContainerTypeBlock_ret, NSObject.Block_accessibilityCustomActionsBlock_ret, NSObject.Block_accessibilityCustomRotorsBlock_ret, NSObject.Block_accessibilityDecrementBlock_ret, NSObject.Block_accessibilityElementsBlock_ret, NSObject.Block_accessibilityElementsHiddenBlock_ret, NSObject.Block_accessibilityFrameBlock_ret, NSObject.Block_accessibilityHeaderElementsBlock_ret, NSObject.Block_accessibilityHintBlock_ret, NSObject.Block_accessibilityIdentifierBlock_ret, NSObject.Block_accessibilityIncrementBlock_ret, NSObject.Block_accessibilityLabelBlock_ret, NSObject.Block_accessibilityLanguageBlock_ret, NSObject.Block_accessibilityMagicTapBlock_ret, NSObject.Block_accessibilityNavigationStyleBlock_ret, NSObject.Block_accessibilityPathBlock_ret, NSObject.Block_accessibilityPerformEscapeBlock_ret, NSObject.Block_accessibilityRespondsToUserInteractionBlock_ret, NSObject.Block_accessibilityShouldGroupAccessibilityChildrenBlock_ret, NSObject.Block_accessibilityTextualContextBlock_ret, NSObject.Block_accessibilityTraitsBlock_ret, NSObject.Block_accessibilityUserInputLabelsBlock_ret, NSObject.Block_accessibilityValueBlock_ret, NSObject.Block_accessibilityViewIsModalBlock_ret, NSObject.Block_automationElementsBlock_ret, NSObject.Block_isAccessibilityElementBlock_ret, NSObject.Block_setAccessibilityActivateBlock, NSObject.Block_setAccessibilityActivationPointBlock, NSObject.Block_setAccessibilityAttributedHintBlock, NSObject.Block_setAccessibilityAttributedLabelBlock, NSObject.Block_setAccessibilityAttributedUserInputLabelsBlock, NSObject.Block_setAccessibilityAttributedValueBlock, NSObject.Block_setAccessibilityContainerTypeBlock, NSObject.Block_setAccessibilityCustomActionsBlock, NSObject.Block_setAccessibilityCustomRotorsBlock, NSObject.Block_setAccessibilityDecrementBlock, NSObject.Block_setAccessibilityElementsBlock, NSObject.Block_setAccessibilityElementsHiddenBlock, NSObject.Block_setAccessibilityFrameBlock, NSObject.Block_setAccessibilityHeaderElementsBlock, NSObject.Block_setAccessibilityHintBlock, NSObject.Block_setAccessibilityIdentifierBlock, NSObject.Block_setAccessibilityIncrementBlock, NSObject.Block_setAccessibilityLabelBlock, NSObject.Block_setAccessibilityLanguageBlock, NSObject.Block_setAccessibilityMagicTapBlock, NSObject.Block_setAccessibilityNavigationStyleBlock, NSObject.Block_setAccessibilityPathBlock, NSObject.Block_setAccessibilityPerformEscapeBlock, NSObject.Block_setAccessibilityRespondsToUserInteractionBlock, NSObject.Block_setAccessibilityShouldGroupAccessibilityChildrenBlock, NSObject.Block_setAccessibilityTextualContextBlock, NSObject.Block_setAccessibilityTraitsBlock, NSObject.Block_setAccessibilityUserInputLabelsBlock, NSObject.Block_setAccessibilityValueBlock, NSObject.Block_setAccessibilityViewIsModalBlock, NSObject.Block_setAutomationElementsBlock, NSObject.Block_setIsAccessibilityElementBlock, NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAVCaptureSession(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()voidaddConnection(@NotNull AVCaptureConnection connection)addConnection: Adds an AVCaptureConnection to the session.voidaddInput(@NotNull AVCaptureInput input)addInput: Adds an AVCaptureInput to the session.voidaddInputWithNoConnections(@NotNull AVCaptureInput input)addInputWithNoConnections: Adds an AVCaptureInput to the session without forming any connections.voidaddOutput(@NotNull AVCaptureOutput output)addOutput: Adds an AVCaptureOutput to the session.voidaddOutputWithNoConnections(@NotNull AVCaptureOutput output)addOutputWithNoConnections: Adds an AVCaptureOutput to the session without forming any connections.static AVCaptureSessionalloc()static AVCaptureSessionallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)booleanautomaticallyConfiguresApplicationAudioSession()[@property] automaticallyConfiguresApplicationAudioSession Indicates whether the receiver should configure the application's audio session for recording.booleanautomaticallyConfiguresCaptureDeviceForWideColor()[@property] automaticallyConfiguresCaptureDeviceForWideColor Indicates whether the receiver automatically configures its video device's activeFormat and activeColorSpace properties, preferring wide color for photos.static booleanautomaticallyNotifiesObserversForKey(@NotNull java.lang.String key)voidbeginConfiguration()beginConfiguration When paired with commitConfiguration, allows a client to batch multiple configuration operations on a running session into atomic updates.booleancanAddConnection(@NotNull AVCaptureConnection connection)canAddConnection: Returns whether the proposed connection can be added to the receiver.booleancanAddInput(@NotNull AVCaptureInput input)canAddInput: Returns whether the proposed input can be added to the receiver.booleancanAddOutput(@NotNull AVCaptureOutput output)canAddOutput: Returns whether the proposed output can be added to the receiver.static voidcancelPreviousPerformRequestsWithTarget(@NotNull java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(@NotNull java.lang.Object aTarget, @NotNull org.moe.natj.objc.SEL aSelector, @Nullable java.lang.Object anArgument)booleancanSetSessionPreset(@NotNull java.lang.String preset)canSetSessionPreset: Returns whether the receiver can be configured with the given preset.static @NotNull NSArray<java.lang.String>classFallbacksForKeyedArchiver()static @NotNull org.moe.natj.objc.ClassclassForKeyedUnarchiver()voidcommitConfiguration()commitConfiguration When preceded by beginConfiguration, allows a client to batch multiple configuration operations on a running session into atomic updates.@NotNull NSArray<? extends AVCaptureConnection>connections()[@property] connections An NSArray of AVCaptureConnections currently added to the receiver.static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()floathardwareCost()[@property] hardwareCost Indicates the percentage of the session's available hardware budget currently in use.static longhash_static()AVCaptureSessioninit()@NotNull NSArray<? extends AVCaptureInput>inputs()[@property] inputs An NSArray of AVCaptureInputs currently added to the receiver.static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)booleanisInterrupted()[@property] interrupted Indicates whether the session is being interrupted.booleanisMultitaskingCameraAccessEnabled()[@property] multitaskingCameraAccessEnabled Indicates whether the session is configured to use the camera while multitasking.booleanisMultitaskingCameraAccessSupported()[@property] multitaskingCameraAccessSupported Returns whether the session can be configured to use the camera while multitasking.booleanisRunning()[@property] running Indicates whether the session is currently running.static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static @NotNull NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(@NotNull java.lang.String key)@Nullable CMClockRefmasterClock()Deprecated.static AVCaptureSessionnew_objc()@NotNull NSArray<? extends AVCaptureOutput>outputs()[@property] outputs An NSArray of AVCaptureOutputs currently added to the receiver.voidremoveConnection(@NotNull AVCaptureConnection connection)removeConnection: Removes an AVCaptureConnection from the session.voidremoveInput(@NotNull AVCaptureInput input)removeInput: Removes an AVCaptureInput from the session.voidremoveOutput(@NotNull AVCaptureOutput output)removeOutput: Removes an AVCaptureOutput from the session.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)@NotNull java.lang.StringsessionPreset()[@property] sessionPreset Indicates the session preset currently in use by the receiver.voidsetAutomaticallyConfiguresApplicationAudioSession(boolean value)[@property] automaticallyConfiguresApplicationAudioSession Indicates whether the receiver should configure the application's audio session for recording.voidsetAutomaticallyConfiguresCaptureDeviceForWideColor(boolean value)[@property] automaticallyConfiguresCaptureDeviceForWideColor Indicates whether the receiver automatically configures its video device's activeFormat and activeColorSpace properties, preferring wide color for photos.voidsetMultitaskingCameraAccessEnabled(boolean value)[@property] multitaskingCameraAccessEnabled Indicates whether the session is configured to use the camera while multitasking.voidsetSessionPreset(@NotNull java.lang.String value)[@property] sessionPreset Indicates the session preset currently in use by the receiver.voidsetUsesApplicationAudioSession(boolean value)[@property] usesApplicationAudioSession Indicates whether the receiver will use the application's AVAudioSession for recording.static voidsetVersion_static(long aVersion)voidstartRunning()startRunning Starts an AVCaptureSession instance running.voidstopRunning()stopRunning Stops an AVCaptureSession instance that is currently running.static org.moe.natj.objc.Classsuperclass_static()@Nullable CMClockRefsynchronizationClock()[@property] synchronizationClock Provides the clock being used for synchronization.booleanusesApplicationAudioSession()[@property] usesApplicationAudioSession Indicates whether the receiver will use the application's AVAudioSession for recording.static booleanuseStoredAccessor()Deprecated.static longversion_static()-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivateBlock, accessibilityActivationPoint, accessibilityActivationPointBlock, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedHintBlock, accessibilityAttributedLabel, accessibilityAttributedLabelBlock, accessibilityAttributedUserInputLabels, accessibilityAttributedUserInputLabelsBlock, accessibilityAttributedValue, accessibilityAttributedValueBlock, accessibilityContainerType, accessibilityContainerTypeBlock, accessibilityCustomActions, accessibilityCustomActionsBlock, accessibilityCustomRotors, accessibilityCustomRotorsBlock, accessibilityDecrement, accessibilityDecrementBlock, accessibilityDirectTouchOptions, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsBlock, accessibilityElementsHidden, accessibilityElementsHiddenBlock, accessibilityFrame, accessibilityFrameBlock, accessibilityHeaderElementsBlock, accessibilityHint, accessibilityHintBlock, accessibilityIdentifierBlock, accessibilityIncrement, accessibilityIncrementBlock, accessibilityLabel, accessibilityLabelBlock, accessibilityLanguage, accessibilityLanguageBlock, accessibilityMagicTapBlock, accessibilityNavigationStyle, accessibilityNavigationStyleBlock, accessibilityPath, accessibilityPathBlock, accessibilityPerformEscape, accessibilityPerformEscapeBlock, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityRespondsToUserInteractionBlock, accessibilityScroll, accessibilityShouldGroupAccessibilityChildrenBlock, accessibilityTextualContext, accessibilityTextualContextBlock, accessibilityTraits, accessibilityTraitsBlock, accessibilityUserInputLabels, accessibilityUserInputLabelsBlock, accessibilityValue, accessibilityValueBlock, accessibilityViewIsModal, accessibilityViewIsModalBlock, accessibilityZoomInAtPoint, accessibilityZoomOutAtPoint, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, automationElements, automationElementsBlock, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hash, indexOfAccessibilityElement, isAccessibilityElement, isAccessibilityElementBlock, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivateBlock, setAccessibilityActivationPoint, setAccessibilityActivationPointBlock, setAccessibilityAttributedHint, setAccessibilityAttributedHintBlock, setAccessibilityAttributedLabel, setAccessibilityAttributedLabelBlock, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedUserInputLabelsBlock, setAccessibilityAttributedValue, setAccessibilityAttributedValueBlock, setAccessibilityContainerType, setAccessibilityContainerTypeBlock, setAccessibilityCustomActions, setAccessibilityCustomActionsBlock, setAccessibilityCustomRotors, setAccessibilityCustomRotorsBlock, setAccessibilityDecrementBlock, setAccessibilityDirectTouchOptions, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsBlock, setAccessibilityElementsHidden, setAccessibilityElementsHiddenBlock, setAccessibilityFrame, setAccessibilityFrameBlock, setAccessibilityHeaderElementsBlock, setAccessibilityHint, setAccessibilityHintBlock, setAccessibilityIdentifierBlock, setAccessibilityIncrementBlock, setAccessibilityLabel, setAccessibilityLabelBlock, setAccessibilityLanguage, setAccessibilityLanguageBlock, setAccessibilityMagicTapBlock, setAccessibilityNavigationStyle, setAccessibilityNavigationStyleBlock, setAccessibilityPath, setAccessibilityPathBlock, setAccessibilityPerformEscapeBlock, setAccessibilityRespondsToUserInteraction, setAccessibilityRespondsToUserInteractionBlock, setAccessibilityShouldGroupAccessibilityChildrenBlock, setAccessibilityTextualContext, setAccessibilityTextualContextBlock, setAccessibilityTraits, setAccessibilityTraitsBlock, setAccessibilityUserInputLabels, setAccessibilityUserInputLabelsBlock, setAccessibilityValue, setAccessibilityValueBlock, setAccessibilityViewIsModal, setAccessibilityViewIsModalBlock, setAutomationElements, setAutomationElementsBlock, setIsAccessibilityElement, setIsAccessibilityElementBlock, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, storedValueForKey, superclass, takeStoredValueForKey, takeValueForKey, takeValueForKeyPath, takeValuesFromDictionary, unableToSetNilForKey, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, valuesForKeys, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static AVCaptureSession alloc()
-
allocWithZone
public static AVCaptureSession allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(@NotNull @NotNull java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(@NotNull @NotNull java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(@NotNull @NotNull java.lang.Object aTarget, @NotNull @NotNull org.moe.natj.objc.SEL aSelector, @Nullable @Nullable java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
@NotNull public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
@NotNull public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
@NotNull public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(@NotNull @NotNull java.lang.String key)
-
new_objc
public static AVCaptureSession new_objc()
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
version_static
public static long version_static()
-
addConnection
public void addConnection(@NotNull @NotNull AVCaptureConnection connection)addConnection: Adds an AVCaptureConnection to the session. An AVCaptureConnection instance can only be added to a session using -addConnection: if canAddConnection: returns YES. When using -addInput: or -addOutput:, connections are formed automatically between all compatible inputs and outputs. Manually adding connections is only necessary when adding an input or output with no connections. -addConnection: may be called while the session is running. API-Since: 8.0- Parameters:
connection- An AVCaptureConnection instance.
-
addInput
public void addInput(@NotNull @NotNull AVCaptureInput input)addInput: Adds an AVCaptureInput to the session. An AVCaptureInput instance can only be added to a session using -addInput: if -canAddInput: returns YES. -addInput: may be called while the session is running.- Parameters:
input- An AVCaptureInput instance.
-
addInputWithNoConnections
public void addInputWithNoConnections(@NotNull @NotNull AVCaptureInput input)addInputWithNoConnections: Adds an AVCaptureInput to the session without forming any connections. -addInputWithNoConnections: may be called while the session is running. The -addInput: method is the preferred method for adding an input to an AVCaptureSession. -addInputWithNoConnections: may be called if you need fine-grained control over which inputs are connected to which outputs. API-Since: 8.0- Parameters:
input- An AVCaptureInput instance.
-
addOutput
public void addOutput(@NotNull @NotNull AVCaptureOutput output)addOutput: Adds an AVCaptureOutput to the session. An AVCaptureOutput instance can only be added to a session using -addOutput: if -canAddOutput: returns YES. -addOutput: may be called while the session is running.- Parameters:
output- An AVCaptureOutput instance.
-
addOutputWithNoConnections
public void addOutputWithNoConnections(@NotNull @NotNull AVCaptureOutput output)addOutputWithNoConnections: Adds an AVCaptureOutput to the session without forming any connections. -addOutputWithNoConnections: may be called while the session is running. The -addOutput: method is the preferred method for adding an output to an AVCaptureSession. -addOutputWithNoConnections: may be called if you need fine-grained control over which inputs are connected to which outputs. API-Since: 8.0- Parameters:
output- An AVCaptureOutput instance.
-
automaticallyConfiguresApplicationAudioSession
public boolean automaticallyConfiguresApplicationAudioSession()
[@property] automaticallyConfiguresApplicationAudioSession Indicates whether the receiver should configure the application's audio session for recording. The value of this property is a BOOL indicating whether the receiver should configure the application's audio session when needed for optimal recording. When set to YES, the receiver ensures the application's audio session is set to the PlayAndRecord category, and picks an appropriate microphone and polar pattern to match the video camera being used. When set to NO, and -usesApplicationAudioSession is set to YES, the receiver will use the application's audio session, but will not change any of its properties. If the session is not set up correctly for input, audio recording may fail. The default value is YES. API-Since: 7.0
-
automaticallyConfiguresCaptureDeviceForWideColor
public boolean automaticallyConfiguresCaptureDeviceForWideColor()
[@property] automaticallyConfiguresCaptureDeviceForWideColor Indicates whether the receiver automatically configures its video device's activeFormat and activeColorSpace properties, preferring wide color for photos. The default value is YES. By default, the receiver automatically adjusts its source video AVCaptureDevice's activeFormat and activeColorSpace properties based on the supportedColorSpaces of the device's formats and the current AVCaptureSession topology. Wide color spaces are preferred over sRGB if an AVCapturePhotoOutput is present in the session. If you wish to set AVCaptureDevice's activeColorSpace manually, and prevent the AVCaptureSession from undoing your work, you must set automaticallyConfiguresCaptureDeviceForWideColor to NO. If the receiver's sessionPreset is set to AVCaptureSessionPresetInputPriority, the session will not alter the capture device's activeFormat, but might still alter its activeColorSpace. API-Since: 10.0
-
beginConfiguration
public void beginConfiguration()
beginConfiguration When paired with commitConfiguration, allows a client to batch multiple configuration operations on a running session into atomic updates. -beginConfiguration / -commitConfiguration are AVCaptureSession's mechanism for batching multiple configuration operations on a running session into atomic updates. After calling [session beginConfiguration], clients may add or remove outputs, alter the sessionPreset, or configure individual AVCaptureInput or Output properties. All changes will be pended until the client calls [session commitConfiguration], at which time they will be applied together. -beginConfiguration / -commitConfiguration pairs may be nested, and will only be applied when the outermost commit is invoked.
-
canAddConnection
public boolean canAddConnection(@NotNull @NotNull AVCaptureConnection connection)canAddConnection: Returns whether the proposed connection can be added to the receiver. An AVCaptureConnection instance can only be added to a session using -addConnection: if canAddConnection: returns YES. When using -addInput: or -addOutput:, connections are formed automatically between all compatible inputs and outputs. Manually adding connections is only necessary when adding an input or output with no connections. API-Since: 8.0- Parameters:
connection- An AVCaptureConnection instance.
-
canAddInput
public boolean canAddInput(@NotNull @NotNull AVCaptureInput input)canAddInput: Returns whether the proposed input can be added to the receiver. An AVCaptureInput instance can only be added to a session using -addInput: if -canAddInput: returns YES.- Parameters:
input- An AVCaptureInput instance.- Returns:
- YES if the proposed input can be added to the receiver, NO otherwise.
-
canAddOutput
public boolean canAddOutput(@NotNull @NotNull AVCaptureOutput output)canAddOutput: Returns whether the proposed output can be added to the receiver. An AVCaptureOutput instance can only be added to a session using -addOutput: if -canAddOutput: returns YES. On iOS and Mac Catalyst, some limitations to adding combinations of different types of outputs apply: - A maximum of one output of each type may be added. For applications linked on or after iOS 16.0, this restriction no longer applies to AVCaptureVideoDataOutputs. When adding more than one AVCaptureVideoDataOutput, AVCaptureSession.hardwareCost must be taken into account. - A session cannot contain both an AVCaptureStillImageOutput and an AVCapturePhotoOutput at the same time. - Prior to iOS 16.0, an AVCaptureVideoDataOutput and an AVCaptureMovieFileOutput may be added to the same session, but only one may have its connection active. When both have their connections enabled, the AVCaptureMovieFileOutput "wins" and the AVCaptureVideoDataOutput's connection becomes inactive. For applications linked on or after iOS 16.0, this restriction has been lifted. When adding multiple AVCaptureVideoDataOutputs or a combination of AVCaptureVideoDataOutputs and an AVCaptureMovieFileOutput, AVCaptureSession.hardwareCost must be taken into account. - Similarly, prior to iOS 16.0, an AVCaptureAudioDataOutput and an AVCaptureMovieFileOutput may be added to the same session, but only one may have its connection active. When both have their connections enabled, the AVCaptureMovieFileOutput "wins" and the AVCaptureAudioDataOutput's connection becomes inactive. For applications linked on or after iOS 16.0, this restriction has been lifted.- Parameters:
output- An AVCaptureOutput instance.- Returns:
- YES if the proposed output can be added to the receiver, NO otherwise.
-
canSetSessionPreset
public boolean canSetSessionPreset(@NotNull @NotNull java.lang.String preset)canSetSessionPreset: Returns whether the receiver can be configured with the given preset. An AVCaptureSession instance can be associated with a preset that configures its inputs and outputs to fulfill common use cases. This method can be used to determine if the receiver supports the desired preset given its current input and output configuration. The receiver's sessionPreset property may only be set to a certain preset if this method returns YES for that preset.- Parameters:
preset- An AVCaptureSession preset.- Returns:
- YES if the receiver can be set to the given preset, NO otherwise.
-
commitConfiguration
public void commitConfiguration()
commitConfiguration When preceded by beginConfiguration, allows a client to batch multiple configuration operations on a running session into atomic updates. -beginConfiguration / -commitConfiguration are AVCaptureSession's mechanism for batching multiple configuration operations on a running session into atomic updates. After calling [session beginConfiguration], clients may add or remove outputs, alter the sessionPreset, or configure individual AVCaptureInput or Output properties. All changes will be pended until the client calls [session commitConfiguration], at which time they will be applied together. -beginConfiguration / -commitConfiguration pairs may be nested, and will only be applied when the outermost commit is invoked.
-
init
public AVCaptureSession init()
-
inputs
@NotNull public @NotNull NSArray<? extends AVCaptureInput> inputs()
[@property] inputs An NSArray of AVCaptureInputs currently added to the receiver. The value of this property is an NSArray of AVCaptureInputs currently added to the receiver. Clients can add AVCaptureInputs to a session by calling -addInput:.
-
isInterrupted
public boolean isInterrupted()
[@property] interrupted Indicates whether the session is being interrupted. The value of this property is a BOOL indicating whether the receiver is currently being interrupted, such as by a phone call or alarm. Clients can key value observe the value of this property to be notified when the session ceases to be interrupted and again has access to needed hardware resources. API-Since: 4.0
-
isRunning
public boolean isRunning()
[@property] running Indicates whether the session is currently running. The value of this property is a BOOL indicating whether the receiver is running. Clients can key value observe the value of this property to be notified when the session automatically starts or stops running.
-
masterClock
@Nullable @Deprecated public @Nullable CMClockRef masterClock()
Deprecated.[@property] masterClock Provides the clock being used for synchronization. Deprecated. Please use synchronizationClock instead. API-Since: 7.0 Deprecated-Since: 15.4
-
outputs
@NotNull public @NotNull NSArray<? extends AVCaptureOutput> outputs()
[@property] outputs An NSArray of AVCaptureOutputs currently added to the receiver. The value of this property is an NSArray of AVCaptureOutputs currently added to the receiver. Clients can add AVCaptureOutputs to a session by calling -addOutput:.
-
removeConnection
public void removeConnection(@NotNull @NotNull AVCaptureConnection connection)removeConnection: Removes an AVCaptureConnection from the session. -removeConnection: may be called while the session is running. API-Since: 8.0- Parameters:
connection- An AVCaptureConnection instance.
-
removeInput
public void removeInput(@NotNull @NotNull AVCaptureInput input)removeInput: Removes an AVCaptureInput from the session. -removeInput: may be called while the session is running.- Parameters:
input- An AVCaptureInput instance.
-
removeOutput
public void removeOutput(@NotNull @NotNull AVCaptureOutput output)removeOutput: Removes an AVCaptureOutput from the session. -removeOutput: may be called while the session is running.- Parameters:
output- An AVCaptureOutput instance.
-
sessionPreset
@NotNull public @NotNull java.lang.String sessionPreset()
[@property] sessionPreset Indicates the session preset currently in use by the receiver. The value of this property is an AVCaptureSessionPreset indicating the current session preset in use by the receiver. The sessionPreset property may be set while the receiver is running.
-
setAutomaticallyConfiguresApplicationAudioSession
public void setAutomaticallyConfiguresApplicationAudioSession(boolean value)
[@property] automaticallyConfiguresApplicationAudioSession Indicates whether the receiver should configure the application's audio session for recording. The value of this property is a BOOL indicating whether the receiver should configure the application's audio session when needed for optimal recording. When set to YES, the receiver ensures the application's audio session is set to the PlayAndRecord category, and picks an appropriate microphone and polar pattern to match the video camera being used. When set to NO, and -usesApplicationAudioSession is set to YES, the receiver will use the application's audio session, but will not change any of its properties. If the session is not set up correctly for input, audio recording may fail. The default value is YES. API-Since: 7.0
-
setAutomaticallyConfiguresCaptureDeviceForWideColor
public void setAutomaticallyConfiguresCaptureDeviceForWideColor(boolean value)
[@property] automaticallyConfiguresCaptureDeviceForWideColor Indicates whether the receiver automatically configures its video device's activeFormat and activeColorSpace properties, preferring wide color for photos. The default value is YES. By default, the receiver automatically adjusts its source video AVCaptureDevice's activeFormat and activeColorSpace properties based on the supportedColorSpaces of the device's formats and the current AVCaptureSession topology. Wide color spaces are preferred over sRGB if an AVCapturePhotoOutput is present in the session. If you wish to set AVCaptureDevice's activeColorSpace manually, and prevent the AVCaptureSession from undoing your work, you must set automaticallyConfiguresCaptureDeviceForWideColor to NO. If the receiver's sessionPreset is set to AVCaptureSessionPresetInputPriority, the session will not alter the capture device's activeFormat, but might still alter its activeColorSpace. API-Since: 10.0
-
setSessionPreset
public void setSessionPreset(@NotNull @NotNull java.lang.String value)[@property] sessionPreset Indicates the session preset currently in use by the receiver. The value of this property is an AVCaptureSessionPreset indicating the current session preset in use by the receiver. The sessionPreset property may be set while the receiver is running.
-
setUsesApplicationAudioSession
public void setUsesApplicationAudioSession(boolean value)
[@property] usesApplicationAudioSession Indicates whether the receiver will use the application's AVAudioSession for recording. The value of this property is a BOOL indicating whether the receiver is currently using the application's AVAudioSession (see AVAudioSession.h). Prior to iOS 7, AVCaptureSession uses its own audio session, which can lead to unwanted interruptions when interacting with the application's audio session. In applications linked on or after iOS 7, AVCaptureSession shares the application's audio session, allowing for simultaneous play back and recording without unwanted interruptions. Clients desiring the pre-iOS 7 behavior may opt out by setting usesApplicationAudioSession to NO. The default value is YES. API-Since: 7.0
-
startRunning
public void startRunning()
startRunning Starts an AVCaptureSession instance running. Clients invoke -startRunning to start the flow of data from inputs to outputs connected to the AVCaptureSession instance. This call blocks until the session object has completely started up or failed. A failure to start running is reported through the AVCaptureSessionRuntimeErrorNotification mechanism.
-
stopRunning
public void stopRunning()
stopRunning Stops an AVCaptureSession instance that is currently running. Clients invoke -stopRunning to stop the flow of data from inputs to outputs connected to the AVCaptureSession instance. This call blocks until the session object has completely stopped.
-
usesApplicationAudioSession
public boolean usesApplicationAudioSession()
[@property] usesApplicationAudioSession Indicates whether the receiver will use the application's AVAudioSession for recording. The value of this property is a BOOL indicating whether the receiver is currently using the application's AVAudioSession (see AVAudioSession.h). Prior to iOS 7, AVCaptureSession uses its own audio session, which can lead to unwanted interruptions when interacting with the application's audio session. In applications linked on or after iOS 7, AVCaptureSession shares the application's audio session, allowing for simultaneous play back and recording without unwanted interruptions. Clients desiring the pre-iOS 7 behavior may opt out by setting usesApplicationAudioSession to NO. The default value is YES. API-Since: 7.0
-
connections
@NotNull public @NotNull NSArray<? extends AVCaptureConnection> connections()
[@property] connections An NSArray of AVCaptureConnections currently added to the receiver. The value of this property is an NSArray of AVCaptureConnections currently added to the receiver. Connections are formed implicitly by the receiver when a client calls -addInput: or -addOutput:. Connections are formed explicitly when a client calls -addConnection:. API-Since: 13.0
-
hardwareCost
public float hardwareCost()
[@property] hardwareCost Indicates the percentage of the session's available hardware budget currently in use. The value of this property is a float from 0.0 => 1.0 indicating how much of the session's available hardware is in use as a percentage, given the currently connected inputs and outputs and the features for which you've opted in. When your hardwareCost is greater than 1.0, the capture session cannot run your desired configuration due to hardware constraints, so you receive an AVCaptureSessionRuntimeErrorNotification when attempting to start it running. Default value is 0. Contributors to hardwareCost include: - Whether the source devices' active formats use the full sensor (4:3) or a crop (16:9). Cropped formats require lower hardware bandwidth, and therefore lower the cost. - The max frame rate supported by the source devices' active formats. The higher the max frame rate, the higher the cost. - Whether the source devices' active formats are binned or not. Binned formats require substantially less hardware bandwidth, and therefore result in a lower cost. - The number of sources configured to deliver streaming disparity / depth via AVCaptureDepthDataOutput. The higher the number of cameras configured to produce depth, the higher the cost. In order to reduce hardwareCost, consider picking a sensor-cropped activeFormat, or a binned format. You may also use AVCaptureDeviceInput's videoMinFrameDurationOverride property to artificially limit the max frame rate (which is the reciprocal of the min frame duration) of a source device to a lower value. By doing so, you only pay the hardware cost for the max frame rate you intend to use. AVCaptureMultiCamSessions always computes this hardwareCost. AVCaptureSessions only computes a non-zero hardwareCost when multiple AVCaptureVideoDataOutputs or an AVCaptureMovieFileOutput and one or more AVCaptureVideoDataOutputs are added to the session. API-Since: 16.0
-
isMultitaskingCameraAccessEnabled
public boolean isMultitaskingCameraAccessEnabled()
[@property] multitaskingCameraAccessEnabled Indicates whether the session is configured to use the camera while multitasking. The default value is NO. This property may only be set if -isMultitaskingCameraAccessSupported returns YES. This property must be set before the session starts running. AVCaptureSessions that are configured to use the camera while multitasking will not be interrupted with AVCaptureSessionInterruptionReasonVideoDeviceNotAvailableWithMultipleForegroundApps. For applications that have the com.apple.developer.avfoundation.multitasking-camera-access entitlement, this property defaults to YES if -isMultitaskingCameraAccessSupported returns YES. To learn about best practices for using the camera while multitasking, refer to the Accessing the Camera While Multitasking article on developer.apple.com. See https://developer.apple.com/documentation/avkit/accessing_the_camera_while_multitasking\. This property is key-value observable. API-Since: 16.0
-
isMultitaskingCameraAccessSupported
public boolean isMultitaskingCameraAccessSupported()
[@property] multitaskingCameraAccessSupported Returns whether the session can be configured to use the camera while multitasking. This property can be used to determine whether multitaskingCameraAccessEnabled may be set to YES. When this property changes from YES to NO, multitaskingCameraAccessEnabled also reverts to NO. This property returns true on iPads that support Stage Manager with an extended display. This property returns true on Apple TV. This property is key-value observable. API-Since: 16.0
-
setMultitaskingCameraAccessEnabled
public void setMultitaskingCameraAccessEnabled(boolean value)
[@property] multitaskingCameraAccessEnabled Indicates whether the session is configured to use the camera while multitasking. The default value is NO. This property may only be set if -isMultitaskingCameraAccessSupported returns YES. This property must be set before the session starts running. AVCaptureSessions that are configured to use the camera while multitasking will not be interrupted with AVCaptureSessionInterruptionReasonVideoDeviceNotAvailableWithMultipleForegroundApps. For applications that have the com.apple.developer.avfoundation.multitasking-camera-access entitlement, this property defaults to YES if -isMultitaskingCameraAccessSupported returns YES. To learn about best practices for using the camera while multitasking, refer to the Accessing the Camera While Multitasking article on developer.apple.com. See https://developer.apple.com/documentation/avkit/accessing_the_camera_while_multitasking\. This property is key-value observable. API-Since: 16.0
-
synchronizationClock
@Nullable public @Nullable CMClockRef synchronizationClock()
[@property] synchronizationClock Provides the clock being used for synchronization. synchronizationClock is readonly. Use synchronizationClock to synchronize AVCaptureOutput data with external data sources (e.g motion samples). All capture output sample buffer timestamps are on the synchronizationClock timebase. For example, if you want to reverse synchronize the output timestamps to the original timestamps, you can do the following: In captureOutput:didOutputSampleBuffer:fromConnection: AVCaptureInputPort *port = [[connection inputPorts] objectAtIndex:0]; CMClockRef originalClock = [port clock]; CMTime syncedPTS = CMSampleBufferGetPresentationTime( sampleBuffer ); CMTime originalPTS = CMSyncConvertTime( syncedPTS, [session synchronizationClock], originalClock ); This property is key-value observable. API-Since: 15.4
-
useStoredAccessor
@Deprecated public static boolean useStoredAccessor()
Deprecated.
-
-