Monado OpenXR Runtime
rift_s_camera.c File Reference

Oculus Rift S camera handling. More...

#include <asm/byteorder.h>
#include <string.h>
#include "rift_s.h"
#include "rift_s_camera.h"
#include "os/os_threading.h"
#include "xrt/xrt_defines.h"
#include "xrt/xrt_frame.h"
#include "xrt/xrt_frameserver.h"
#include "util/u_autoexpgain.h"
#include "util/u_debug.h"
#include "util/u_var.h"
#include "util/u_sink.h"
#include "util/u_frame.h"
#include "util/u_trace_marker.h"
Include dependency graph for rift_s_camera.c:

Data Structures

struct  rift_s_camera
 Specifies whether the user wants to enable autoexposure from the start. More...
 
struct  rift_s_camera_finder
 
union  rift_s_frame_data
 

Macros

#define DEFAULT_EXPOSURE   6000
 
#define DEFAULT_GAIN   127
 
#define RIFT_S_MIN_EXPOSURE   38
 
#define RIFT_S_MAX_EXPOSURE   14022
 
#define RIFT_S_MIN_GAIN   16
 
#define RIFT_S_MAX_GAIN   255
 

Functions

static void update_expgain (struct rift_s_camera *cam, struct xrt_frame *xf)
 
static void receive_cam_frame (struct xrt_frame_sink *sink, struct xrt_frame *xf)
 
static void on_video_device (struct xrt_prober *xp, struct xrt_prober_device *pdev, const char *product, const char *manufacturer, const char *serial, void *ptr)
 
struct rift_s_camerarift_s_camera_create (struct xrt_prober *xp, struct xrt_frame_context *xfctx, const char *hmd_serial_no, struct os_hid_device *hid, struct rift_s_tracker *tracker, struct rift_s_camera_calibration_block *camera_calibration)
 
void rift_s_camera_destroy (struct rift_s_camera *cam)
 
static bool parse_frame_data (const struct xrt_frame *xf, union rift_s_frame_data *row_data)
 
static int get_y_offset (struct rift_s_camera *cam, enum rift_s_camera_id cam_id, union rift_s_frame_data *row_data)
 
static struct xrt_framerift_s_camera_extract_frame (struct rift_s_camera *cam, enum rift_s_camera_id cam_id, struct xrt_frame *full_frame, union rift_s_frame_data *row_data)
 
void rift_s_camera_update (struct rift_s_camera *cam, struct os_hid_device *hid)
 

Detailed Description

Oculus Rift S camera handling.

The Rift S camera module, handles reception and dispatch of camera frames.

Author
Jan Schmidt jan@c.nosp@m.entr.nosp@m.icula.nosp@m.r.co.nosp@m.m

Function Documentation

◆ receive_cam_frame()

static void receive_cam_frame ( struct xrt_frame_sink sink,
struct xrt_frame xf 
)
static
Todo:
Update expgain independently for each camera like in WMR

References container_of.