You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add new formats to represent depth data, specifying the data type and units (e.g., MINIAV_PIXEL_FORMAT_DEPTH_U16_MM for unsigned 16-bit depth in millimeters, MINIAV_PIXEL_FORMAT_DEPTH_F32_M for 32-bit float depth in meters).
Consider formats for confidence maps if provided by the hardware.
Buffer Structure (MiniAVBuffer):
Option A (Preferred for Synchronization): Modify the video struct within the MiniAVBuffer union to potentially hold both color and depth data if captured simultaneously from the same device. This might involve:
Adding fields like depth_width, depth_height, depth_pixel_format, depth_stride_bytes, depth_planes.
Ensuring the single timestamp_us applies to both synchronized frames.
The internal_handle would need to manage the release of both buffers.
Option B (Simpler, Less Synchronized): Introduce a new MiniAVBufferType like MINIAV_BUFFER_TYPE_DEPTH and potentially a separate depth struct in the union. This might be simpler but makes explicit synchronization between color and depth streams (if needed) the responsibility of the application using timestamps.
Metadata:
Intrinsics: Depth cameras require specific intrinsics (focal length, principal point) which might differ from the color sensor's intrinsics, especially on multi-sensor devices. The API needs a way to expose both color and depth intrinsics, potentially linked to the buffer.
Extrinsics: If a device has separate color and depth sensors, the rigid body transformation (rotation + translation) between them (extrinsics) is needed for alignment. The API should provide a way to query this.
Depth Scale/Units: Explicitly define the units for depth formats (e.g., via the format enum name or a separate metadata field) to allow correct interpretation.
API Functions:
MiniAV_Camera_GetSupportedFormats: Needs to be updated to report supported depth formats and potentially combinations (e.g., Color 1080p@30 + Depth 480p@30). The MiniAVVideoFormatInfo struct might need expansion.
MiniAV_Camera_Configure: Needs to accept requests for depth streams, potentially alongside color streams.
(Optional) New functions might be needed to query depth-specific properties or intrinsics/extrinsics if not handled via the generic property API.
Synchronization: Ensuring tight timestamp synchronization between color and depth frames from the same device is critical for many applications (favors Option A for MiniAVBuffer).
Performance: Depth processing can be demanding; maintaining zero-copy is important.
API Complexity: Adding depth increases API surface area and complexity.
Vendor SDKs: Relying on vendor SDKs adds external dependencies and build complexity. Prioritize native OS APIs where available and sufficient.
Format Variety: Depth cameras output various formats (raw disparity, point clouds, IR); focus initially on common depth map formats (e.g., 16-bit unsigned integer).
Pixel Format Enum (
MiniAVPixelFormat):MINIAV_PIXEL_FORMAT_DEPTH_U16_MMfor unsigned 16-bit depth in millimeters,MINIAV_PIXEL_FORMAT_DEPTH_F32_Mfor 32-bit float depth in meters).Buffer Structure (
MiniAVBuffer):videostruct within theMiniAVBufferunion to potentially hold both color and depth data if captured simultaneously from the same device. This might involve:depth_width,depth_height,depth_pixel_format,depth_stride_bytes,depth_planes.timestamp_usapplies to both synchronized frames.internal_handlewould need to manage the release of both buffers.MiniAVBufferTypelikeMINIAV_BUFFER_TYPE_DEPTHand potentially a separatedepthstruct in the union. This might be simpler but makes explicit synchronization between color and depth streams (if needed) the responsibility of the application using timestamps.Metadata:
API Functions:
MiniAV_Camera_GetSupportedFormats: Needs to be updated to report supported depth formats and potentially combinations (e.g., Color 1080p@30 + Depth 480p@30). TheMiniAVVideoFormatInfostruct might need expansion.MiniAV_Camera_Configure: Needs to accept requests for depth streams, potentially alongside color streams.Platform Implementations (
miniav_c/src/camera/<platform>):librealsense).DEPTH16,DEPTH_POINT_CLOUD).AVCaptureDepthDataOutput).Tasks
MiniAVPixelFormatenums.MiniAVBufferstructure (Option A or B).MiniAV_Camera_GetSupportedFormatsandMiniAV_Camera_ConfigureAPIs.MiniAV_ReleaseBuffercorrectly handles releasing depth resources.Considerations
MiniAVBuffer).