mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-06 07:06:10 +00:00
d/wmr: Document camera start and constify argument
This commit is contained in:
parent
16c75e7cc7
commit
4329b755a9
|
@ -66,8 +66,8 @@ struct wmr_camera
|
||||||
struct os_thread_helper usb_thread;
|
struct os_thread_helper usb_thread;
|
||||||
int usb_complete;
|
int usb_complete;
|
||||||
|
|
||||||
struct wmr_camera_config *configs;
|
const struct wmr_camera_config *configs;
|
||||||
int n_configs;
|
int config_count;
|
||||||
|
|
||||||
size_t xfer_size;
|
size_t xfer_size;
|
||||||
uint32_t frame_width, frame_height;
|
uint32_t frame_width, frame_height;
|
||||||
|
@ -116,8 +116,8 @@ compute_frame_size(struct wmr_camera *cam)
|
||||||
|
|
||||||
F = 26;
|
F = 26;
|
||||||
|
|
||||||
for (i = 0; i < cam->n_configs; i++) {
|
for (i = 0; i < cam->config_count; i++) {
|
||||||
struct wmr_camera_config *config = cam->configs + i;
|
const struct wmr_camera_config *config = &cam->configs[i];
|
||||||
if (config->purpose != WMR_CAMERA_PURPOSE_HEAD_TRACKING)
|
if (config->purpose != WMR_CAMERA_PURPOSE_HEAD_TRACKING)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -364,12 +364,12 @@ out:
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
wmr_camera_start(struct wmr_camera *cam, struct wmr_camera_config *cam_configs, int n_configs)
|
wmr_camera_start(struct wmr_camera *cam, const struct wmr_camera_config *cam_configs, int config_count)
|
||||||
{
|
{
|
||||||
int res, i;
|
int res, i;
|
||||||
|
|
||||||
cam->configs = cam_configs;
|
cam->configs = cam_configs;
|
||||||
cam->n_configs = n_configs;
|
cam->config_count = config_count;
|
||||||
if (!compute_frame_size(cam)) {
|
if (!compute_frame_size(cam)) {
|
||||||
WMR_CAM_WARN(cam, "Invalid config or no head tracking cameras found");
|
WMR_CAM_WARN(cam, "Invalid config or no head tracking cameras found");
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@ -383,8 +383,8 @@ wmr_camera_start(struct wmr_camera *cam, struct wmr_camera_config *cam_configs,
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
for (i = 0; i < cam->n_configs; i++) {
|
for (i = 0; i < cam->config_count; i++) {
|
||||||
struct wmr_camera_config *config = cam->configs + i;
|
const struct wmr_camera_config *config = &cam->configs[i];
|
||||||
if (config->purpose != WMR_CAMERA_PURPOSE_HEAD_TRACKING)
|
if (config->purpose != WMR_CAMERA_PURPOSE_HEAD_TRACKING)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,13 @@ wmr_camera_open(struct xrt_prober_device *dev_holo, enum u_logging_level ll);
|
||||||
void
|
void
|
||||||
wmr_camera_free(struct wmr_camera *cam);
|
wmr_camera_free(struct wmr_camera *cam);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Starts the cameras.
|
||||||
|
*
|
||||||
|
* The data pointed to by @p configs must be kept alive for as long as the camera is kept alive.
|
||||||
|
*/
|
||||||
bool
|
bool
|
||||||
wmr_camera_start(struct wmr_camera *cam, struct wmr_camera_config *cam_configs, int n_configs);
|
wmr_camera_start(struct wmr_camera *cam, const struct wmr_camera_config *configs, int config_count);
|
||||||
bool
|
bool
|
||||||
wmr_camera_stop(struct wmr_camera *cam);
|
wmr_camera_stop(struct wmr_camera *cam);
|
||||||
int
|
int
|
||||||
|
|
Loading…
Reference in a new issue