ds5-timestamp.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 
6 #include "ds5-private.h"
7 
8 #include "algo.h"
9 #include "error-handling.h"
10 
11 namespace librealsense
12 {
14  {
15  std::unique_ptr<frame_timestamp_reader> _backup_timestamp_reader;
16  static const int pins = 2;
17  std::vector<std::atomic<bool>> _has_metadata;
19  mutable std::recursive_mutex _mtx;
20 
21  public:
22  ds5_timestamp_reader_from_metadata(std::unique_ptr<frame_timestamp_reader> backup_timestamp_reader);
23 
24  bool has_metadata(const std::shared_ptr<frame_interface>& frame);
25 
26  rs2_time_t get_frame_timestamp(const std::shared_ptr<frame_interface>& frame) override;
27 
28  unsigned long long get_frame_counter(const std::shared_ptr<frame_interface>& frame) const override;
29 
30  void reset() override;
31 
32  rs2_timestamp_domain get_frame_timestamp_domain(const std::shared_ptr<frame_interface>& frame) const override;
33  };
34 
36  {
37  static const int pins = 2;
38  mutable std::vector<int64_t> counter;
39  std::shared_ptr<platform::time_service> _ts;
40  mutable std::recursive_mutex _mtx;
41  public:
42  ds5_timestamp_reader(std::shared_ptr<platform::time_service> ts);
43 
44  void reset() override;
45 
46  rs2_time_t get_frame_timestamp(const std::shared_ptr<frame_interface>& frame) override;
47 
48  unsigned long long get_frame_counter(const std::shared_ptr<frame_interface>& frame) const override;
49 
50  rs2_timestamp_domain get_frame_timestamp_domain(const std::shared_ptr<frame_interface>& frame) const override;
51  };
52 
54  {
55  static const int sensors = 4; // TODO: implement frame-counter for each GPIO or
56  // reading counter field report
57  mutable std::vector<int64_t> counter;
58  mutable std::recursive_mutex _mtx;
59  public:
61 
62  void reset() override;
63 
64  rs2_time_t get_frame_timestamp(const std::shared_ptr<frame_interface>& frame) override;
65 
66  bool has_metadata(const std::shared_ptr<frame_interface>& frame) const;
67 
68  unsigned long long get_frame_counter(const std::shared_ptr<frame_interface>& frame) const override;
69 
70  rs2_timestamp_domain get_frame_timestamp_domain(const std::shared_ptr<frame_interface>& frame) const override;
71  };
72 }
std::vector< int64_t > counter
Definition: ds5-timestamp.h:38
ds5_timestamp_reader_from_metadata(std::unique_ptr< frame_timestamp_reader > backup_timestamp_reader)
std::unique_ptr< frame_timestamp_reader > _backup_timestamp_reader
Definition: ds5-timestamp.h:15
std::vector< std::atomic< bool > > _has_metadata
Definition: ds5-timestamp.h:17
unsigned long long get_frame_counter(const std::shared_ptr< frame_interface > &frame) const override
std::shared_ptr< platform::time_service > _ts
Definition: ds5-timestamp.h:39
rs2_timestamp_domain get_frame_timestamp_domain(const std::shared_ptr< frame_interface > &frame) const override
bool has_metadata(const std::shared_ptr< frame_interface > &frame)
rs2_time_t get_frame_timestamp(const std::shared_ptr< frame_interface > &frame) override
double rs2_time_t
Definition: rs_types.h:300
rs2_timestamp_domain
Specifies the clock in relation to which the frame timestamp was measured.
Definition: rs_frame.h:19


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