Monado OpenXR Runtime
Loading...
Searching...
No Matches
uvc_interface.h File Reference

Public interface for userspace UVC frameserver implementation. More...

#include "xrt/xrt_byte_order.h"
#include "xrt/xrt_frame.h"
#include "xrt/xrt_frameserver.h"
#include "util/u_time.h"
#include <libusb.h>
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for uvc_interface.h:

Go to the source code of this file.

Data Structures

struct  uvc_payload_header
 
struct  uvc_probe_commit_control
 
struct  uvc_stream_parameters
 

Typedefs

typedef bool(* get_frame_timestamp_t) (void *user_data, timepoint_ns *timestamp, uint32_t pts)
 Called to get the timestamp of a specific frame, if a callee has a more precise way of timestamping frames.
 
typedef bool(* setup_stream_parameters_callback_t) (uint16_t vid, uint16_t pid, bool is_usb2, libusb_device_handle *devh, struct uvc_probe_commit_control *control, struct uvc_stream_parameters *parameters, size_t *packet_size, int *alt_setting, void *user_data)
 Callback to setup stream parameters based on USB device parameters.
 
typedef bool(* post_init_callback_t) (uint16_t vid, uint16_t pid, bool is_usb2, libusb_device_handle *devh, void *user_data)
 Called after initialization in-case any extra device-specific setup is required (like on CV1 sensors over USB2)
 

Functions

int uvc_set_cur (libusb_device_handle *devh, uint8_t usb_interface, uint8_t entity, uint8_t selector, void *data, uint16_t data_length)
 
int uvc_get_cur (libusb_device_handle *devh, uint8_t usb_interface, uint8_t entity, uint8_t selector, void *data, uint16_t data_length)
 
int uvc_fs_create (libusb_context *usb_ctx, libusb_device_handle *devh, const struct libusb_device_descriptor *desc, setup_stream_parameters_callback_t setup_stream_parameters_callback, post_init_callback_t post_init_callback, void *user_data, struct xrt_frame_context *xfctx, struct xrt_fs **stream)
 
int uvc_fs_destroy (struct xrt_fs *stream)
 
void uvc_fs_set_source_timestamp_callback (struct xrt_fs *stream, get_frame_timestamp_t callback, void *user_data)
 

Detailed Description

Public interface for userspace UVC frameserver implementation.

Author
Philipp Zabel phili.nosp@m.pp.z.nosp@m.abel@.nosp@m.gmai.nosp@m.l.com
Jan Schmidt jan@c.nosp@m.entr.nosp@m.icula.nosp@m.r.co.nosp@m.m
Beyley Cardellio ep1cm.nosp@m.1n10.nosp@m.n123@.nosp@m.gmai.nosp@m.l.com

Typedef Documentation

◆ get_frame_timestamp_t

typedef bool(* get_frame_timestamp_t) (void *user_data, timepoint_ns *timestamp, uint32_t pts)

Called to get the timestamp of a specific frame, if a callee has a more precise way of timestamping frames.

◆ post_init_callback_t

typedef bool(* post_init_callback_t) (uint16_t vid, uint16_t pid, bool is_usb2, libusb_device_handle *devh, void *user_data)

Called after initialization in-case any extra device-specific setup is required (like on CV1 sensors over USB2)

◆ setup_stream_parameters_callback_t

typedef bool(* setup_stream_parameters_callback_t) (uint16_t vid, uint16_t pid, bool is_usb2, libusb_device_handle *devh, struct uvc_probe_commit_control *control, struct uvc_stream_parameters *parameters, size_t *packet_size, int *alt_setting, void *user_data)

Callback to setup stream parameters based on USB device parameters.