harmony 鸿蒙capture_session.h

  • 2025-06-12
  • 浏览 (3)

capture_session.h

Overview

The capture_session.h file declares the capture session concepts.

Library: libohcamera.so

File to include: <ohcamera/capture_session.h>

System capability: SystemCapability.Multimedia.Camera.Core

Since: 11

Related module: OH_Camera

Summary

Structs

Name Description
struct CaptureSession_Callbacks Describes the callbacks used for a capture session.

Types

Name Description
typedef struct Camera_CaptureSession Camera_CaptureSession Defines a struct for the capture session object.
typedef void(* OH_CaptureSession_OnFocusStateChange) (Camera_CaptureSession *session, Camera_FocusState focusState) Defines the callback defined in the CaptureSession_Callbacks struct and used to report focus status changes of a capture session.
typedef void(* OH_CaptureSession_OnError) (Camera_CaptureSession *session, Camera_ErrorCode errorCode) Defines the callback defined in the CaptureSession_Callbacks struct and used to report capture session errors.
typedef void(* OH_CaptureSession_OnSmoothZoomInfo) (Camera_CaptureSession *session, Camera_SmoothZoomInfo *smoothZoomInfo) Defines the callback invoked when smooth zoom is triggered for a capture session.
typedef struct CaptureSession_Callbacks CaptureSession_Callbacks Defines a struct for the callbacks used for a capture session.

Functions

Name Description
Camera_ErrorCode OH_CaptureSession_RegisterCallback (Camera_CaptureSession *session, CaptureSession_Callbacks *callback) Registers a callback to listen for capture session events.
Camera_ErrorCode OH_CaptureSession_UnregisterCallback (Camera_CaptureSession *session, CaptureSession_Callbacks *callback) Unregisters the callback used to listen for capture session events.
Camera_ErrorCode OH_CaptureSession_RegisterSmoothZoomInfoCallback (Camera_CaptureSession *session, OH_CaptureSession_OnSmoothZoomInfo smoothZoomInfoCallback) Registers a callback to listen for smooth zoom events.
Camera_ErrorCode OH_CaptureSession_UnregisterSmoothZoomInfoCallback (Camera_CaptureSession *session, OH_CaptureSession_OnSmoothZoomInfo smoothZoomInfoCallback) Unregisters the callback used to listen for smooth zoom events.
Camera_ErrorCode OH_CaptureSession_SetSessionMode (Camera_CaptureSession *session, Camera_SceneMode sceneMode) Sets a scene mode for a session.
Camera_ErrorCode OH_CaptureSession_AddSecureOutput (Camera_CaptureSession *session, Camera_PreviewOutput *previewOutput) Marks a preview output stream as secure output.
Camera_ErrorCode OH_CaptureSession_BeginConfig (Camera_CaptureSession *session) Starts the configuration for a capture session.
Camera_ErrorCode OH_CaptureSession_CommitConfig (Camera_CaptureSession *session) Commits the configuration for a capture session.
Camera_ErrorCode OH_CaptureSession_AddInput (Camera_CaptureSession *session, Camera_Input *cameraInput) Adds a CameraInput instance to a session.
Camera_ErrorCode OH_CaptureSession_RemoveInput (Camera_CaptureSession *session, Camera_Input *cameraInput) Removes a CameraInput instance from a session.
Camera_ErrorCode OH_CaptureSession_AddPreviewOutput (Camera_CaptureSession *session, Camera_PreviewOutput *previewOutput) Adds a PreviewOutput instance to a session.
Camera_ErrorCode OH_CaptureSession_RemovePreviewOutput (Camera_CaptureSession *session, Camera_PreviewOutput *previewOutput) Removes a PreviewOutput instance from a session.
Camera_ErrorCode OH_CaptureSession_AddPhotoOutput (Camera_CaptureSession *session, Camera_PhotoOutput *photoOutput) Adds a PhotoOutput instance to a session.
Camera_ErrorCode OH_CaptureSession_RemovePhotoOutput (Camera_CaptureSession *session, Camera_PhotoOutput *photoOutput) Removes a PhotoOutput instance from a session.
Camera_ErrorCode OH_CaptureSession_AddVideoOutput (Camera_CaptureSession *session, Camera_VideoOutput *videoOutput) Adds a VideoOutput instance to a session.
Camera_ErrorCode OH_CaptureSession_RemoveVideoOutput (Camera_CaptureSession *session, Camera_VideoOutput *videoOutput) Removes a VideoOutput instance from a session.
Camera_ErrorCode OH_CaptureSession_AddMetadataOutput (Camera_CaptureSession *session, Camera_MetadataOutput *metadataOutput) Adds a MetadataOutput instance to a session.
Camera_ErrorCode OH_CaptureSession_RemoveMetadataOutput (Camera_CaptureSession *session, Camera_MetadataOutput *metadataOutput) Removes a MetadataOutput instance from a session.
Camera_ErrorCode OH_CaptureSession_Start (Camera_CaptureSession *session) Starts a capture session.
Camera_ErrorCode OH_CaptureSession_Stop (Camera_CaptureSession *session) Stops a capture session.
Camera_ErrorCode OH_CaptureSession_Release (Camera_CaptureSession *session) Releases a CaptureSession instance.
Camera_ErrorCode OH_CaptureSession_HasFlash (Camera_CaptureSession *session, bool *hasFlash) Checks whether the device has flash.
Camera_ErrorCode OH_CaptureSession_IsFlashModeSupported (Camera_CaptureSession *session, Camera_FlashMode flashMode, bool *isSupported) Checks whether a flash mode is supported.
Camera_ErrorCode OH_CaptureSession_GetFlashMode (Camera_CaptureSession *session, Camera_FlashMode *flashMode) Obtains the flash mode in use.
Camera_ErrorCode OH_CaptureSession_SetFlashMode (Camera_CaptureSession *session, Camera_FlashMode flashMode) Sets a flash mode for the device.
Camera_ErrorCode OH_CaptureSession_IsExposureModeSupported (Camera_CaptureSession *session, Camera_ExposureMode exposureMode, bool *isSupported) Checks whether an exposure mode is supported.
Camera_ErrorCode OH_CaptureSession_GetExposureMode (Camera_CaptureSession *session, Camera_ExposureMode *exposureMode) Obtains the exposure mode in use.
Camera_ErrorCode OH_CaptureSession_SetExposureMode (Camera_CaptureSession *session, Camera_ExposureMode exposureMode) Sets an exposure mode for the device.
Camera_ErrorCode OH_CaptureSession_GetMeteringPoint (Camera_CaptureSession *session, Camera_Point *point) Obtains the metering point in use.
Camera_ErrorCode OH_CaptureSession_SetMeteringPoint (Camera_CaptureSession *session, Camera_Point point) Sets the metering point, which is the center point of the metering rectangle.
Camera_ErrorCode OH_CaptureSession_GetExposureBiasRange (Camera_CaptureSession *session, float *minExposureBias, float *maxExposureBias, float *step) Obtains the exposure compensation values of the device.
Camera_ErrorCode OH_CaptureSession_SetExposureBias (Camera_CaptureSession *session, float exposureBias) Sets an exposure compensation value for the device.
Camera_ErrorCode OH_CaptureSession_GetExposureBias (Camera_CaptureSession *session, float *exposureBias) Obtains the exposure compensation value in use.
Camera_ErrorCode OH_CaptureSession_IsFocusModeSupported (Camera_CaptureSession *session, Camera_FocusMode focusMode, bool *isSupported) Checks whether a focus mode is supported.
Camera_ErrorCode OH_CaptureSession_GetFocusMode (Camera_CaptureSession *session, Camera_FocusMode *focusMode) Obtains the focus mode in use.
Camera_ErrorCode OH_CaptureSession_SetFocusMode (Camera_CaptureSession *session, Camera_FocusMode focusMode) Sets a focus mode for the device.
Camera_ErrorCode OH_CaptureSession_GetFocusPoint (Camera_CaptureSession *session, Camera_Point *focusPoint) Obtains the focal point in use.
Camera_ErrorCode OH_CaptureSession_SetFocusPoint (Camera_CaptureSession *session, Camera_Point focusPoint) Sets a focal point for the device.
Camera_ErrorCode OH_CaptureSession_GetZoomRatioRange (Camera_CaptureSession *session, float *minZoom, float *maxZoom) Obtains the supported zoom ratio range.
Camera_ErrorCode OH_CaptureSession_GetZoomRatio (Camera_CaptureSession *session, float *zoom) Obtains the zoom ratio in use.
Camera_ErrorCode OH_CaptureSession_SetZoomRatio (Camera_CaptureSession *session, float zoom) Sets a zoom ratio for the device.
Camera_ErrorCode OH_CaptureSession_IsVideoStabilizationModeSupported (Camera_CaptureSession *session, Camera_VideoStabilizationMode mode, bool *isSupported) Checks whether a video stabilization mode is supported.
Camera_ErrorCode OH_CaptureSession_GetVideoStabilizationMode (Camera_CaptureSession *session, Camera_VideoStabilizationMode *mode) Obtains the video stabilization mode in use.
Camera_ErrorCode OH_CaptureSession_SetVideoStabilizationMode (Camera_CaptureSession *session, Camera_VideoStabilizationMode mode) Sets a video stabilization mode for the device.
Camera_ErrorCode OH_CaptureSession_CanAddInput (Camera_CaptureSession *session, Camera_Input *cameraInput, bool *isSuccessful) Checks whether a CameraInput instance can be added to a session.
Camera_ErrorCode OH_CaptureSession_CanAddPreviewOutput (Camera_CaptureSession *session, Camera_PreviewOutput *cameraOutput, bool *isSuccessful) Checks whether a PreviewOutput instance can be added to a session.
Camera_ErrorCode OH_CaptureSession_CanAddPhotoOutput (Camera_CaptureSession *session, Camera_PhotoOutput *cameraOutput, bool *isSuccessful) Checks whether a PhotoOutput instance can be added to a session.
Camera_ErrorCode OH_CaptureSession_CanAddVideoOutput (Camera_CaptureSession *session, Camera_VideoOutput *cameraOutput, bool *isSuccessful) Checks whether a VideoOutput instance can be added to a session.
Camera_ErrorCode OH_CaptureSession_CanPreconfig (Camera_CaptureSession *session, Camera_PreconfigType preconfigType, bool *canPreconfig) Checks whether a preconfigured resolution type is supported.
Camera_ErrorCode OH_CaptureSession_CanPreconfigWithRatio (Camera_CaptureSession *session, Camera_PreconfigType preconfigType, Camera_PreconfigRatio preconfigRatio, bool *canPreconfig) Checks whether a preconfigured resolution type with an aspect ratio is supported.
Camera_ErrorCode OH_CaptureSession_Preconfig (Camera_CaptureSession *session, Camera_PreconfigType preconfigType) Sets a preconfigured resolution type.
Camera_ErrorCode OH_CaptureSession_PreconfigWithRatio (Camera_CaptureSession *session, Camera_PreconfigType preconfigType, Camera_PreconfigRatio preconfigRatio) Sets a preconfigured resolution type with an aspect ratio.
Camera_ErrorCode OH_CaptureSession_GetExposureValue (Camera_CaptureSession *session, float *exposureValue) Obtains the exposure value.
Camera_ErrorCode OH_CaptureSession_GetFocalLength (Camera_CaptureSession *session, float *focalLength) Obtains the current focal length.
Camera_ErrorCode OH_CaptureSession_SetSmoothZoom (Camera_CaptureSession *session, float targetZoom, Camera_SmoothZoomMode smoothZoomMode) Sets smooth zoom.
Camera_ErrorCode OH_CaptureSession_GetSupportedColorSpaces (Camera_CaptureSession *session, OH_NativeBuffer_ColorSpace **colorSpace, uint32_t *size) Obtains the supported color spaces.
Camera_ErrorCode OH_CaptureSession_DeleteColorSpaces (Camera_CaptureSession *session, OH_NativeBuffer_ColorSpace *colorSpace) Deletes color spaces.
Camera_ErrorCode OH_CaptureSession_GetActiveColorSpace (Camera_CaptureSession *session, OH_NativeBuffer_ColorSpace *colorSpace) Obtains the active color space.
Camera_ErrorCode OH_CaptureSession_SetActiveColorSpace (Camera_CaptureSession *session, OH_NativeBuffer_ColorSpace colorSpace) Sets the active color space.
Camera_ErrorCode OH_CaptureSession_SetQualityPrioritization (Camera_CaptureSession *session, Camera_QualityPrioritization qualityPrioritization) Sets the priority level for video recording quality.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Camera Kit

harmony 鸿蒙Camera_CaptureEndInfo

harmony 鸿蒙Camera_CaptureStartInfo

harmony 鸿蒙Camera_ConcurrentInfo

harmony 鸿蒙Camera_Device

harmony 鸿蒙Camera_FrameRateRange

harmony 鸿蒙Camera_FrameShutterEndInfo

harmony 鸿蒙Camera_FrameShutterInfo

harmony 鸿蒙Camera_Location

harmony 鸿蒙Camera_MetadataObject

0  赞