uvc-streamer.h
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 #pragma once
5 #include "uvc-types.h"
6 #include "../types.h"
7 
8 #include "stdio.h"
9 #include "stdlib.h"
10 #include <cstring>
11 #include <string>
12 #include <chrono>
13 #include <thread>
14 
15 typedef void(uvc_frame_callback_t)(struct librealsense::platform::frame_object *frame, void *user_ptr);
16 
17 namespace librealsense
18 {
19  namespace platform
20  {
22  {
25  std::shared_ptr<uvc_stream_ctrl_t> control;
29  };
30 
32  {
33  public:
35  virtual ~uvc_streamer();
36 
38 
39  bool running() { return _running; }
40  void start();
41  void stop();
42  void enable_user_callbacks() { _publish_frames = true; }
43  void disable_user_callbacks() { _publish_frames = false; }
44  bool wait_for_first_frame(uint32_t timeout_ms);
45 
46  private:
47  std::mutex _running_mutex;
48  std::condition_variable _stopped_cv;
49  bool _running = false;
50  bool _frame_arrived = false;
51  bool _publish_frames = true;
52 
55 
57 
58  std::shared_ptr<watchdog> _watchdog;
62  std::vector<rs_usb_request> _requests;
63  std::shared_ptr<backend_frames_archive> _frames_archive;
64  std::shared_ptr<active_object<>> _publish_frame_thread;
65  std::shared_ptr<platform::usb_request_callback> _request_callback;
66 
67  void init();
68  void flush();
69  };
70  }
71 }
std::vector< rs_usb_request > _requests
Definition: uvc-streamer.h:62
typedef void(APIENTRY *GLDEBUGPROC)(GLenum source
std::shared_ptr< platform::usb_request_callback > _request_callback
Definition: uvc-streamer.h:65
unsigned char uint8_t
Definition: stdint.h:78
static const textual_icon stop
Definition: model-views.h:225
const uvc_streamer_context get_context()
Definition: uvc-streamer.h:37
std::shared_ptr< active_object<> > _publish_frame_thread
Definition: uvc-streamer.h:64
std::shared_ptr< uvc_stream_ctrl_t > control
Definition: uvc-streamer.h:25
unsigned int uint32_t
Definition: stdint.h:80
std::shared_ptr< usb_endpoint > rs_usb_endpoint
Definition: usb-endpoint.h:24
std::shared_ptr< backend_frames_archive > _frames_archive
Definition: uvc-streamer.h:63
std::shared_ptr< usb_messenger > rs_usb_messenger
Definition: usb-messenger.h:26
void init(void)
Definition: boing.c:180
GLuint start
std::shared_ptr< watchdog > _watchdog
Definition: uvc-streamer.h:58
std::function< void(stream_profile, frame_object, std::function< void()>)> frame_callback
Definition: backend.h:177
signed __int64 int64_t
Definition: stdint.h:89
std::condition_variable _stopped_cv
Definition: uvc-streamer.h:48
void( uvc_frame_callback_t)(struct librealsense::platform::frame_object *frame, void *user_ptr)
Definition: uvc-streamer.h:15
std::shared_ptr< usb_device > rs_usb_device
Definition: usb-device.h:29


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