10 _previous_depth_frame_counter(0),
11 _frames_without_requested_metadata_counter(0)
38 LOG_WARNING(
"HDR Merge filter cannot process frames because relevant metadata params are missing");
45 if (depth_seq_size != 2)
134 bool restart_pipe_detected = (depth_merged_frame_counter > input_frame_counter);
135 bool resolution_change_detected = (merged_d_profile.width() != new_d_profile.
width()) ||
136 (merged_d_profile.height() != new_d_profile.
height());
138 if (restart_pipe_detected || resolution_change_detected)
158 if (first_fs_frame_counter + 1 != second_fs_frame_counter)
161 if ((first_depth.get_height() != second_depth.get_height()) ||
162 (first_depth.get_width() != second_depth.get_width()))
172 auto first = first_fs;
173 auto second = second_fs;
176 auto second_depth = second.get_depth_frame();
177 auto first_ir =
first.get_infrared_frame();
178 auto second_ir = second.get_infrared_frame();
183 auto height = vf.get_height();
192 auto d0 = (
uint16_t*)first_depth.get_data();
193 auto d1 = (
uint16_t*)second_depth.get_data();
197 ptr->set_sensor(
orig->get_sensor());
199 memset(new_data, 0, width * height *
sizeof(
uint16_t));
201 int width_height_product = width *
height;
207 merge_frames_using_ir<uint8_t>(new_data, d0, d1, first_ir, second_ir, width_height_product);
211 merge_frames_using_ir<uint16_t>(new_data, d0, d1, first_ir, second_ir, width_height_product);
230 for (
int i = 0;
i < width_height_prod;
i++)
245 bool use_ir = (first_ir && second_ir);
262 use_ir = (depth_frame_counter == ir_frame_counter);
269 use_ir = (depth_frame_counter == ir_frame_counter);
276 use_ir = (depth_seq_id == ir_seq_id);
283 use_ir = (depth_seq_id == ir_seq_id);
bool supports_frame_metadata(const rs2_frame_metadata_value &frame_metadata) const override
unsigned long long _previous_depth_frame_counter
rs2_metadata_type get_frame_metadata(rs2_frame_metadata_value frame_metadata) const
stream_profile get_profile() const
const int NUMBER_OF_FRAMES_WITHOUT_METADATA_FOR_WARNING
depth_frame get_depth_frame() const
frame allocate_video_frame(const stream_profile &profile, const frame &original, int new_bpp=0, int new_width=0, int new_height=0, int new_stride=0, rs2_extension frame_type=RS2_EXTENSION_VIDEO_FRAME) const
rs2::frame merging_algorithm(const rs2::frame_source &source, const rs2::frameset first_fs, const rs2::frameset second_fs, const bool use_ir) const
bool should_ir_be_used_for_merging(const rs2::depth_frame &first_depth, const rs2::video_frame &first_ir, const rs2::depth_frame &second_depth, const rs2::video_frame &second_ir) const
rs2::frame _depth_merged_frame
GLint GLsizei GLsizei height
std::map< int, rs2::frameset > _framesets
bool check_frames_mergeability(const rs2::frameset first_fs, const rs2::frameset second_fs, bool &use_ir) const
int _frames_without_requested_metadata_counter
rs2_format format() const
rs2::frame process_frame(const rs2::frame_source &source, const rs2::frame &f) override
void reset_warning_counter_on_pipe_restart(const rs2::depth_frame &depth_frame)
GLsizei GLsizei GLchar * source
video_frame get_infrared_frame(const size_t index=0) const
void merge_frames_using_only_depth(uint16_t *new_data, uint16_t *d0, uint16_t *d1, int width_height_prod) const
const byte * get_frame_data() const override
unsigned long long get_frame_number() const
void discard_depth_merged_frame_if_needed(const rs2::frame &f)
bool should_process(const rs2::frame &frame) override
rs2_metadata_type get_frame_metadata(const rs2_frame_metadata_value &frame_metadata) const override