2018-03-22 06:57:35 +02:00
|
|
|
#ifndef MYNTEYE_UVC_H_ // NOLINT
|
|
|
|
#define MYNTEYE_UVC_H_
|
|
|
|
#pragma once
|
|
|
|
|
2018-03-25 18:03:04 +03:00
|
|
|
#include <functional>
|
2018-03-22 06:57:35 +02:00
|
|
|
#include <memory>
|
2018-03-25 18:03:04 +03:00
|
|
|
#include <string>
|
2018-03-22 06:57:35 +02:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "mynteye/mynteye.h"
|
|
|
|
|
|
|
|
#define MYNTEYE_VID 0x04B4
|
|
|
|
#define MYNTEYE_PID 0x00F9
|
|
|
|
|
|
|
|
MYNTEYE_BEGIN_NAMESPACE
|
|
|
|
|
|
|
|
namespace uvc {
|
|
|
|
|
2018-03-25 18:03:04 +03:00
|
|
|
struct extension_unit {
|
|
|
|
int unit;
|
|
|
|
};
|
|
|
|
|
2018-03-22 06:57:35 +02:00
|
|
|
struct context; // Opaque type representing access to the underlying UVC
|
|
|
|
// implementation
|
|
|
|
struct device; // Opaque type representing access to a specific UVC device
|
|
|
|
|
|
|
|
// Enumerate devices
|
|
|
|
std::shared_ptr<context> create_context();
|
|
|
|
std::vector<std::shared_ptr<device>> query_devices(
|
|
|
|
std::shared_ptr<context> context);
|
|
|
|
|
|
|
|
// Static device properties
|
2018-03-25 18:03:04 +03:00
|
|
|
std::string get_name(const device &device);
|
2018-03-22 06:57:35 +02:00
|
|
|
int get_vendor_id(const device &device);
|
|
|
|
int get_product_id(const device &device);
|
|
|
|
|
2018-03-25 18:03:04 +03:00
|
|
|
// Access XU controls
|
|
|
|
void get_control(
|
|
|
|
const device &device, const extension_unit &xu, uint8_t ctrl, void *data,
|
|
|
|
int len);
|
|
|
|
void set_control(
|
|
|
|
const device &device, const extension_unit &xu, uint8_t ctrl, void *data,
|
|
|
|
int len);
|
|
|
|
|
|
|
|
// Control streaming
|
|
|
|
typedef std::function<void(const void *frame)> video_channel_callback;
|
|
|
|
|
|
|
|
void set_device_mode(
|
|
|
|
device &device, int width, int height, uint32_t fourcc, int fps, // NOLINT
|
|
|
|
video_channel_callback callback);
|
|
|
|
void start_streaming(device &device, int num_transfer_bufs); // NOLINT
|
|
|
|
void stop_streaming(device &device); // NOLINT
|
|
|
|
|
2018-03-22 06:57:35 +02:00
|
|
|
} // namespace uvc
|
|
|
|
|
|
|
|
MYNTEYE_END_NAMESPACE
|
|
|
|
|
|
|
|
#endif // MYNTEYE_UVC_H_ NOLINT
|