metavr/virtualcamera/VirtualCamera.hcameraName
: const char * |
Set camera name for the virtual camera device.
Optional, if not set, the default value is an empty string.
This camera name will be exposed through vendor tag "com.meta.extra_metadata.camera_name" key. It is used to indicate the camera name e.g. for app defined cameras. The default is an empty string. The client is expected to provide a null terminated ASCII or UTF-8 C-style string.
Signature
const char* MvrVirtualCameraConfiguration::cameraName |
cameraPosition
: MvrVirtualCameraPosition |
Set lens position for the virtual camera device.
Optional, if not set, the default value is MVR_VIRTUAL_CAMERA_POSITION_NONE.
This camera position will be exposed through "com.meta.extra_metadata.position" key. It is used to indicate the positioning (left/right) of an RGB camera on the front of the headset. The vendor tag is only set if this is called.
Signature
MvrVirtualCameraPosition MvrVirtualCameraConfiguration::cameraPosition |
cameraSource
: MvrVirtualCameraSource |
Set camera source for the virtual camera device.
Optional, if not set, the default value is MVR_VIRTUAL_CAMERA_SOURCE_APP_DEFINED.
CameraSource APP_DEFINED requires permission horizonos.permission.CREATE_VIRTUAL_CAMERA, which is available to all clients. CameraSource PASSTHROUGH, AVATAR and SPATIAL are for operating system usage only.
This camera source will be exposed in vendor tag "com.meta.extra_metadata.camera_source". It is used to identify the source of the video feed.
Signature
MvrVirtualCameraSource MvrVirtualCameraConfiguration::cameraSource |
cameraThumbnailUri
: const char * |
Set Content URI string for camera thumbnail of the virtual camera device.
Optional, if not set, the default value is an empty string.
This Content URI will be exposed through vendor tag "com.meta.extra_metadata.camera_thumbnail" key. It is used to indicate the Content URI for the camera thumbnail image e.g. for app defined cameras. The default is an empty string. The ContentProvider API must be implemented by the app to support this feature. Camera Consumer Apps can then use the Content URI together with ContentResolver API to fetch the thumbnail image.
Signature
const char* MvrVirtualCameraConfiguration::cameraThumbnailUri |
clientData
: void * |
Set application-owned opaque pointer for the MvrVirtualCameraConfiguration.
Optional, if not set (nullptr), the value passed to the callbacks will also be nullptr.
This pointer will be passed to the callbacks registered for the MvrVirtualCameraConfiguration.
Signature
void* MvrVirtualCameraConfiguration::clientData |
id
: const char * |
Camera ID for the virtual camera device.
Optional, if not set (nullptr), the assigned ID will be implementation defined.
The ID cannot be set for cameras of type MVR_VIRTUAL_CAMERA_SOURCE_APP_DEFINED.
The ID is used to identify the virtual camera in the Camera API client. The ID must be unique among all virtual cameras registered in the system. An attempt to configure an ID that is already in use by another virtual camera will result in a failed call to MvrVirtualCamera_create with error code MVR_VIRTUAL_CAMERA_STATUS_INTERNAL_ERROR. The client is expected to provide a null terminated ASCII or UTF-8 C-style string. For that string only alphanumeric characters are allowed.
Signature
const char* MvrVirtualCameraConfiguration::id |
inputStreamConfigs
: const MvrVirtualCameraInputConfiguration*const * |
Pointer to an array of supported input stream configurations.
At least one input configuration needs to be added so the camera can be successfully registered.
In case you register input resolutions with multiple aspect ratios, you have to make sure that the resolution with the smallest aspect ratio has bigger or equal width and height than all other input resolutions. This ensures that every possible output resolutions request via Camera API can be rendered from a single input resolution which is horizontally center cropped (height decreased) and then downscaled. Otherwise, the registration will fail with MVR_VIRTUAL_CAMERA_STATUS_INVALID_ARGUMENT.
By adding this input configuration, the caller declares that it can provide frames with the specified width, height and format. This configuration will be used to infer possible output configurations for the Camera API client listed in CameraCharacteristics.
OnStreamConfiguredCallback will be invoked for one of the input configurations best matching the Camera API client request.
Signature
const MvrVirtualCameraInputConfiguration* const* MvrVirtualCameraConfiguration::inputStreamConfigs |
inputStreamConfigsCount
: uint32_t |
Set number of elements of array containing the supported input stream configurations.
Signature
uint32_t MvrVirtualCameraConfiguration::inputStreamConfigsCount |
inputTimeoutMs
: long |
Set timeout - maximal time (ms) to wait for new frame in input queue, request processing will block until timeout or until there's new frame in the input buffer queue (Surface).
Optional, if not set, the default value is 1000.
Configure how to handle timeout when waiting for new frame in input Surface. During normal operation, virtual camera will repeat previous frame if further waiting for new frame would mean violating the fps range of the request.
Setting this option allows producer app to force virtual camera to wait for new frame in input surface for up to specified timeout and configure how that timeout should be handled.
Using this option puts responsibility of delivering frames in timely manner to the virtual camera owner, as delays in processing capture requests might result in unrecoverable timeouts on framework and client side.
Signature
long MvrVirtualCameraConfiguration::inputTimeoutMs |
inputTimeoutStrategy
: MvrVirtualCameraInputTimeoutStrategy |
Set timeout strategy - how to handle the expiration of timeout.
Optional, if not set, the default value is MVR_VIRTUAL_CAMERA_INPUT_TIMEOUT_STRATEGY_REPEAT_FRAME_RESPECT_MIN_FPS.
Configure how to handle timeout when waiting for new frame in input Surface. During normal operation, virtual camera will repeat previous frame if further waiting for new frame would mean violating the fps range of the request.
Setting this option allows producer app to force virtual camera to wait for new frame in input surface for up to specified timeout and configure how that timeout should be handled.
Using this option puts responsibility of delivering frames in timely manner to the virtual camera owner, as delays in processing capture requests might result in unrecoverable timeouts on framework and client side.
Signature
MvrVirtualCameraInputTimeoutStrategy MvrVirtualCameraConfiguration::inputTimeoutStrategy |
intrinsicCalibration
: const MvrVirtualCameraLensIntrinsicCalibration* |
Set intrinsic calibration for virtual camera instance.
Optional, if not set (nullptr), the respective camera metadata will be null.
This will be exposed through CameraCharacteristic.LENS_INTRINSIC_CALIBRATION key in CameraCharacteristics of virtual camera metadata. See CameraCharacteristic.LENS_INTRINSIC_CALIBRATION for details.
Signature
const MvrVirtualCameraLensIntrinsicCalibration* MvrVirtualCameraConfiguration::intrinsicCalibration |
intrinsicCalibrationSpatial
: const MvrVirtualCameraLensIntrinsicCalibration* |
Set intrinsic calibration for the spatial (right) camera.
Optional, if not set (nullptr), the respective vendor tag metadata will not be present.
For spatial camera, the standard LENS_INTRINSIC_CALIBRATION metadata key contains the left camera's intrinsics. This field allows specifying the right camera's intrinsics, which will be exposed through vendor tag "com.meta.extra_metadata.intrinsic_calibration_spatial".
Both left and right intrinsics should incorporate any stereo rectification and vertical shift applied during spatial camera rendering.
Signature
const MvrVirtualCameraLensIntrinsicCalibration* MvrVirtualCameraConfiguration::intrinsicCalibrationSpatial |
lensFacing
: MvrVirtualCameraLensFacing |
Set lens facing for the virtual camera device.
Optional, if not set, the default value is MVR_VIRTUAL_CAMERA_LENS_FACING_EXTERNAL.
This will be exposed through CameraCharacteristic.LENS_FACING key in CameraCharacteristics of virtual camera metadata. See CameraCharacteristic.LENS_FACING for details.
Signature
MvrVirtualCameraLensFacing MvrVirtualCameraConfiguration::lensFacing |
lensPose
: const MvrPose* |
Set pose rotation quaternion and pose translation of virtual camera lens.
Optional, if not set (nullptr), the respective camera metadata will be null.
The pose orientation (rotation) will be exposed through CameraCharacteristic.LENS_POSE_ROTATION key in CameraCharacteristics of virtual camera metadata. See
CameraCharacteristic.LENS_POSE_ROTATION for details. When setting the pose rotation, the pose reference must be explicitly set to different than MVR_VIRTUAL_CAMERA_LENS_POSE_REFERENCE_UNDEFINED value using MvrVirtualCameraConfiguration_setPoseReference, otherwise the registration will fail with MVR_VIRTUAL_CAMERA_STATUS_INVALID_ARGUMENT.
This pose position (translation) exposed through CameraCharacteristic.LENS_POSE_TRANSLATION key in CameraCharacteristics of virtual camera metadata. See
CameraCharacteristic.LENS_POSE_TRANSLATION for details. When setting the pose translation, the pose reference must be explicitly set to different than MVR_VIRTUAL_CAMERA_LENS_POSE_REFERENCE_UNDEFINED value using MvrVirtualCameraConfiguration_setPoseReference, otherwise the registration will fail with MVR_VIRTUAL_CAMERA_STATUS_INVALID_ARGUMENT.
Signature
const MvrPose* MvrVirtualCameraConfiguration::lensPose |
lensPoseSpatial
: const MvrPose* |
Set pose (rotation + translation) for the spatial (right) camera.
Optional, if not set (nullptr), the respective vendor tag metadata will not be present.
For spatial camera, the standard LENS_POSE_ROTATION and LENS_POSE_TRANSLATION metadata keys contain the left camera's pose. This field allows specifying the right camera's pose, which will be exposed through vendor tags "com.meta.extra_metadata.lens_pose_translation_spatial" and "com.meta.extra_metadata.lens_pose_rotation_spatial".
Both left and right poses should incorporate the stereo rectification rotation applied during spatial camera rendering.
Signature
const MvrPose* MvrVirtualCameraConfiguration::lensPoseSpatial |
onProcessCaptureRequest
: OnCaptureRequestCallback |
Set onCaptureRequest callback for the MvrVirtualCamera.
Optional, this callback doesn't have to be set.
This callback is invoked every time when Camera API client requests a new frame from any output stream corresponding to the input stream referenced by the streamId.
Signature
OnCaptureRequestCallback MvrVirtualCameraConfiguration::onProcessCaptureRequest |
onProcessCaptureRequestWithMetadata
: OnCaptureRequestWithMetadataCallback |
Set onCaptureRequestWithMetadata callback for the MvrVirtualCamera.
Optional, this callback doesn't have to be set.
This callback is invoked every time when Camera API client requests a new frame from any output stream corresponding to the input stream referenced by the streamId. When perFrameCameraMetadataEnabled is true, this callback will receive the capture request metadata in addition to the streamId and frameId.
If both onProcessCaptureRequest and onProcessCaptureRequestWithMetadata are set, only onProcessCaptureRequestWithMetadata will be invoked.
Signature
OnCaptureRequestWithMetadataCallback MvrVirtualCameraConfiguration::onProcessCaptureRequestWithMetadata |
onStreamClosed
: OnStreamClosedCallback |
Set onStreamClosed callback for the MvrVirtualCamera.
This callback must be set. The callback will be invoked when stream previously received in OnStreamConfiguredCallback has become obsolete. The ANativeWindow* passed to OnStreamConfiguredCallback should be released using ANativeWindow_release after this callback is invoked.
Repeated calls to this function will overwrite the previous callback.
Signature
OnStreamClosedCallback MvrVirtualCameraConfiguration::onStreamClosed |
onStreamConfigured
: OnStreamConfiguredCallback |
Set onStreamConfigured callback for the MvrVirtualCamera.
This callback must be set. The callback will be invoked when Camera API client opens the virtual camera and configures the stream(s).
Note that the ownership of the ANativeWindow* is transferred to the client and client is responsible for releasing it after receiving onStreamClosed callback using ANativeWindow_release(). Repeated calls to this function will overwrite the previous callback.
Signature
OnStreamConfiguredCallback MvrVirtualCameraConfiguration::onStreamConfigured |
perFrameCameraMetadataEnabled
: bool |
Enable per-frame camera metadata in capture request callbacks.
Optional, if not set, the default value is false.
When set to true, the onProcessCaptureRequestWithMetadata callback will receive the capture request metadata from the Camera API client. This allows the virtual camera implementer to access camera settings like focus, exposure, zoom level, etc. that were requested by the application using the Camera API.
The metadata is serialized using libcamera_metadata format and can be accessed by casting to camera_metadata*.
Note: This requires setting the onProcessCaptureRequestWithMetadata callback instead of the deprecated onProcessCaptureRequest callback.
Signature
bool MvrVirtualCameraConfiguration::perFrameCameraMetadataEnabled |
poseReference
: MvrVirtualCameraLensPoseReference |
Set pose reference of virtual camera lens.
Optional, if not set, the default value is MVR_VIRTUAL_CAMERA_LENS_POSE_REFERENCE_UNDEFINED.
This will be exposed through CameraCharacteristic.LENS_POSE_REFERENCE key in CameraCharacteristics of virtual camera metadata. See CameraCharacteristic.LENS_POSE_REFERENCE for details.
Signature
MvrVirtualCameraLensPoseReference MvrVirtualCameraConfiguration::poseReference |
sensorOrientation
: MvrVirtualCameraSensorOrientation |
Set sensor orientation for the MvrVirtualCameraConfiguration.
Optional, if not set, the default value is MVR_VIRTUAL_CAMERA_SENSOR_ORIENTATION_0.
This will be exposed through CameraCharacteristic.SENSOR_ORIENTATION key in CameraCharacteristics of virtual camera metadata. See CameraCharacteristic.SENSOR_ORIENTATION for details.
Signature
MvrVirtualCameraSensorOrientation MvrVirtualCameraConfiguration::sensorOrientation |
spatialFormat
: MvrVirtualCameraSpatialFormat |
Set image layout for a spatial virtual camera device.
Optional, if not set, the default value is MVR_VIRTUAL_CAMERA_SPATIAL_FORMAT_NONE.
Only meaningful when cameraSource is MVR_VIRTUAL_CAMERA_SOURCE_SPATIAL. It distinguishes the side-by-side and MV-HEVC multiview spatial cameras, which otherwise share the same source. This will be exposed through vendor tag "com.meta.extra_metadata.spatial_format". The vendor tag is only set if this is not MVR_VIRTUAL_CAMERA_SPATIAL_FORMAT_NONE.
Signature
MvrVirtualCameraSpatialFormat MvrVirtualCameraConfiguration::spatialFormat |
timestampSource
: MvrVirtualCameraAcquisitionTimestampSource |
Configure acquisition timestamp source for virtual camera instance.
Controls whether frame timestamps reflect when the frame was sampled (SAMPLING_TIME) or when the buffer was presented to the surface (SURFACE).
Signature
MvrVirtualCameraAcquisitionTimestampSource MvrVirtualCameraConfiguration::timestampSource |
version
: uint32_t |
version of the structure, filled by MvrVirtualCameraConfiguration_init
Signature
uint32_t MvrVirtualCameraConfiguration::version |