5 #ifndef LIBREALSENSE_ARCHIVE_H 6 #define LIBREALSENSE_ARCHIVE_H 41 int in_width,
int in_height,
int in_fps,
42 int in_stride_x,
int in_stride_y,
int in_bpp,
43 const rs_format in_format,
rs_stream in_stream_type,
int in_pad, std::shared_ptr<std::vector<rs_frame_metadata>> in_supported_metadata_vector,
double in_exposure_value,
double in_actual_fps)
44 : timestamp(in_timestamp),
45 frame_number(in_frame_number),
46 system_time(in_system_time),
50 stride_x(in_stride_x),
51 stride_y(in_stride_y),
54 stream_type(in_stream_type),
56 supported_metadata_vector(in_supported_metadata_vector),
57 exposure_value(in_exposure_value),
58 actual_fps(in_actual_fps){}
74 explicit frame() : ref_count(0), owner(nullptr), on_release(){}
77 : ref_count(r.ref_count.exchange(0)),
78 owner(r.owner), on_release()
98 const byte* get_frame_data()
const;
99 double get_frame_timestamp()
const;
102 unsigned long long get_frame_number()
const override;
104 long long get_frame_system_time()
const;
105 int get_width()
const;
106 int get_height()
const;
107 int get_framerate()
const;
108 int get_stride()
const;
111 rs_stream get_stream_type()
const override;
113 std::chrono::high_resolution_clock::time_point get_frame_callback_start_time_point()
const;
114 void update_frame_callback_start_ts(std::chrono::high_resolution_clock::time_point ts);
137 if (frame_ptr) frame_ptr->
acquire();
142 other.frame_ptr =
nullptr;
153 if (frame_ptr) frame_ptr->
release();
168 const byte* get_frame_data()
const override;
169 double get_frame_timestamp()
const override;
170 unsigned long long get_frame_number()
const override;
171 long long get_frame_system_time()
const override;
173 int get_frame_width()
const override;
174 int get_frame_height()
const override;
175 int get_frame_framerate()
const override;
176 int get_frame_stride()
const override;
177 int get_frame_bpp()
const override;
178 rs_format get_frame_format()
const override;
179 rs_stream get_stream_type()
const override;
180 std::chrono::high_resolution_clock::time_point get_frame_callback_start_time_point()
const;
181 void update_frame_callback_start_ts(std::chrono::high_resolution_clock::time_point ts);
182 void log_callback_start(std::chrono::high_resolution_clock::time_point capture_start_time);
229 frame_archive(
const std::vector<subdevice_mode_selection> & selection, std::atomic<uint32_t>* max_frame_queue_size, std::chrono::high_resolution_clock::time_point capture_started = std::chrono::high_resolution_clock::now());
258 virtual void flush();
subdevice_mode_selection modes[RS_STREAM_NATIVE_COUNT]
void release_frameset(frameset *frameset)
frame_ref * track_frame(rs_stream stream)
frame_ref(frame_ref &&other)
double get_frame_timestamp(rs_stream stream) const
std::atomic< uint32_t > * max_frame_queue_size
frame backbuffer[RS_STREAM_NATIVE_COUNT]
unsigned long long get_frame_number(rs_stream stream) const
std::atomic< int > ref_count
void attach_continuation(frame_continuation &&continuation)
bool supports_frame_metadata(rs_frame_metadata frame_metadata) const override
frame_metadata
Types of value provided from the device with each frame.
GLint GLint GLsizei GLsizei height
rs_timestamp_domain timestamp_domain
small_heap< frame, RS_USER_QUEUE_SIZE *RS_STREAM_COUNT > published_frames
byte * alloc_frame(rs_stream stream, const frame_additional_data &additional_data, bool requires_memory)
frame_archive(const std::vector< subdevice_mode_selection > &selection, std::atomic< uint32_t > *max_frame_queue_size, std::chrono::high_resolution_clock::time_point capture_started=std::chrono::high_resolution_clock::now())
void swap(frame_ref &other)
const rs_frame_ref * get_frame(rs_stream stream) const
double get_frame_metadata(rs_frame_metadata frame_metadata) const override
frame_continuation on_release
int get_frame_stride(rs_stream stream) const
void set_timestamp(double new_ts) override
frame_ref * detach_frame_ref(frameset *frameset, rs_stream stream)
void release_frame_ref(frame_ref *ref)
frame_ref * clone_frame(frame_ref *frameset)
frame * publish_frame(frame &&frame)
int get_frame_bpp() const override
rs_timestamp_domain
Specifies the clock in relation to which the frame timestamp was measured.
std::chrono::high_resolution_clock::time_point frame_callback_started
std::shared_ptr< std::vector< rs_frame_metadata > > supported_metadata_vector
const uint8_t RS_STREAM_NATIVE_COUNT
bool supports_frame_metadata(rs_stream stream, rs_frame_metadata frame_metadata) const
unsigned long long get_frame_number() const override
void update_owner(frame_archive *new_owner)
int get_frame_bpp(rs_stream stream) const
frame_additional_data additional_data
void log_callback_start(frame_ref *frame_ref, std::chrono::high_resolution_clock::time_point capture_start_time)
unsigned long long frame_number
double get_frame_timestamp() const override
long long get_frame_system_time() const override
rs_format
Formats: defines how each stream can be encoded.
small_heap< frame_ref, RS_USER_QUEUE_SIZE *RS_STREAM_COUNT > detached_refs
std::recursive_mutex mutex
frame & operator=(frame &&r)
void set_timestamp_domain(rs_timestamp_domain timestamp_domain) override
const byte * get_frame_data(rs_stream stream) const
frameset * clone_frameset(frameset *frameset)
std::chrono::high_resolution_clock::time_point capture_started
void disable_continuation()
void attach_continuation(rs_stream stream, frame_continuation &&continuation)
const byte * get_frame_data() const override
rs_stream
Streams are different types of data provided by RealSense devices.
GLint GLint GLsizei width
long long get_frame_system_time(rs_stream stream) const
frame_ref(const frame_ref &other)
void log_frame_callback_end(frame *frame)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
small_heap< frameset, RS_USER_QUEUE_SIZE *RS_STREAM_COUNT > published_sets
void unpublish_frame(frame *frame)
rs_frame_metadata
Types of value provided from the device with each frame.
std::vector< frame > freelist
const subdevice_mode_selection & get_mode(rs_stream stream) const
void disable_continuation()
frame_additional_data(double in_timestamp, unsigned long long in_frame_number, long long in_system_time, int in_width, int in_height, int in_fps, int in_stride_x, int in_stride_y, int in_bpp, const rs_format in_format, rs_stream in_stream_type, int in_pad, std::shared_ptr< std::vector< rs_frame_metadata >> in_supported_metadata_vector, double in_exposure_value, double in_actual_fps)
bool is_stream_enabled(rs_stream stream) const
std::atomic< uint32_t > published_frames_per_stream[RS_STREAM_COUNT]
GLdouble GLdouble GLdouble r
double get_frame_metadata(rs_stream stream, rs_frame_metadata frame_metadata) const
int get_frame_stride() const override