Version 8.9.0
 
Loading...
Searching...
No Matches
IRDeviceLibUVC.h
1/******************************************************************************
2 * Copyright (c) 2012-2017 All Rights Reserved, http://www.evocortex.com *
3 * Evocortex GmbH *
4 * Emilienstr. 1 *
5 * 90489 Nuremberg *
6 * Germany *
7 * *
8 * Contributors: *
9 * Initial version for Linux 64-Bit platform supported by Fraunhofer IPA, *
10 * http://www.ipa.fraunhofer.de *
11 *****************************************************************************/
12
13#ifndef IRDEVICELIBUVC
14#define IRDEVICELIBUVC
15
16#include <string.h>
17#include "IRDevice.h"
18#include "libuvc/libuvc.h"
19#include "LibUVCProxy.h"
20
21namespace evo
22{
23
29class IRDeviceLibUVC : public IRDevice
30{
31public:
32
37 IRDeviceLibUVC(unsigned long serial, int videoFormatIndex);
38
43
48 void setSerial(unsigned long serno);
49
55 int openDevice(unsigned int videoFormatIndex);
56
61 bool isOpen();
62
68 int setFramerate(unsigned int numerator, unsigned int denominator);
69
74
79
85
92 IRDeviceError getFrame(unsigned char* buffer, double* timestamp=NULL, int timeoutMilliseconds = -1);
93
99 virtual void run();
100
104 virtual void exit();
105
106private:
107
108 bool _isStreaming;
109
110 bool _run;
111
112 std::unique_ptr<LibUVCProxy> _libUVCProxy;
113 uvc_context_t *_ctx;
114 uvc_device_t *_dev;
115 uvc_device_handle_t *_devh;
116 uvc_stream_ctrl_t _ctrl;
117 uvc_stream_handle_t * _strmh;
118};
119
120} //namespace
121
122#endif // IRDeviceLibUVC
UVC device interface (Linux platforms)
Definition: IRDeviceLibUVC.h:30
virtual void run()
Run device, i.e., treat main thread in blocking mode.
int openDevice(unsigned int videoFormatIndex)
Open device.
~IRDeviceLibUVC()
Destructor.
int stopStreaming()
Stop video grabbing.
int startStreaming()
Start video grabbing.
bool isOpen()
Check if device was already opened.
virtual void exit()
Exit blocking run method, if previously called.
void setSerial(unsigned long serno)
Force serial number.
int closeDevice()
Close device.
int setFramerate(unsigned int numerator, unsigned int denominator)
Set framerate of device (numerator / denominator)
IRDeviceError getFrame(unsigned char *buffer, double *timestamp=NULL, int timeoutMilliseconds=-1)
Acquire one frame.
IRDeviceLibUVC(unsigned long serial, int videoFormatIndex)
Standard constructor.