backend.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2015 Intel Corporation. All Rights Reserved.
3 
4 #if defined(RS2_USE_LIBUVC_BACKEND) && !defined(RS2_USE_WMF_BACKEND) && !defined(RS2_USE_V4L2_BACKEND) && !defined(RS2_USE_WINUSB_UVC_BACKEND) && !defined(RS2_USE_ANDROID_BACKEND)
5 // UVC support will be provided via libuvc / libusb backend
6 #elif !defined(RS2_USE_LIBUVC_BACKEND) && defined(RS2_USE_WMF_BACKEND) && !defined(RS2_USE_V4L2_BACKEND) && !defined(RS2_USE_WINUSB_UVC_BACKEND) && !defined(RS2_USE_ANDROID_BACKEND)
7 // UVC support will be provided via Windows Media Foundation / WinUSB backend
8 #elif !defined(RS2_USE_LIBUVC_BACKEND) && !defined(RS2_USE_WMF_BACKEND) && !defined(RS2_USE_V4L2_BACKEND) && defined(RS2_USE_WINUSB_UVC_BACKEND)&&!defined(RS2_USE_ANDROID_BACKEND)
9 // UVC support will be provided via WinUSB / WinUSB backend
10 #elif !defined(RS2_USE_LIBUVC_BACKEND) && !defined(RS2_USE_WMF_BACKEND) && defined(RS2_USE_V4L2_BACKEND) && !defined(RS2_USE_WINUSB_UVC_BACKEND)&&!defined(RS2_USE_ANDROID_BACKEND)
11 // UVC support will be provided via Video 4 Linux 2 / libusb backend
12 #elif !defined(RS2_USE_LIBUVC_BACKEND) && !defined(RS2_USE_WMF_BACKEND) && !defined(RS2_USE_V4L2_BACKEND) && !defined(RS2_USE_WINUSB_UVC_BACKEND) && defined(RS2_USE_ANDROID_BACKEND)
13 // UVC support will be provided via Android backend
14 #else
15 #error No UVC backend selected. Please #define exactly one of RS2_USE_LIBUVC_BACKEND, RS2_USE_WMF_BACKEND, RS2_USE_WINUSB_UVC_BACKEND or RS2_USE_V4L2_BACKEND
16 #endif
17 
18 #include "backend.h"
20 {
21  vec.resize(sizeof(value));
22  auto data = reinterpret_cast<const uint8_t*>(&value);
23  std::copy(data, data + sizeof(value), vec.data());
24 }
25 
26 double librealsense::monotonic_to_realtime(double monotonic)
27 {
28  auto realtime = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
29  auto time_since_epoch = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
30  return monotonic + (realtime - time_since_epoch);
31 }
GLfloat value
unsigned char uint8_t
Definition: stdint.h:78
double monotonic_to_realtime(double monotonic)
Definition: backend.cpp:26
GLint GLsizei count
void populate_raw_data(std::vector< uint8_t > &vec, int32_t value)
Definition: backend.cpp:19
signed int int32_t
Definition: stdint.h:77
Definition: parser.hpp:150
void copy(void *dst, void const *src, size_t size)
Definition: types.cpp:836


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:45:06