File tree Expand file tree Collapse file tree 4 files changed +42
-11
lines changed Expand file tree Collapse file tree 4 files changed +42
-11
lines changed Original file line number Diff line number Diff line change @@ -145,9 +145,16 @@ namespace librealsense
145
145
146
146
auto video = dynamic_cast <video_stream_profile_interface*>(p.get ());
147
147
auto profile = to_profile (p.get ());
148
- video->set_intrinsics ([profile, this ]()
148
+
149
+ std::weak_ptr<ds5_color_sensor> wp =
150
+ std::dynamic_pointer_cast<ds5_color_sensor>(this ->shared_from_this ());
151
+ video->set_intrinsics ([profile, wp]()
149
152
{
150
- return get_intrinsics (profile);
153
+ auto sp = wp.lock ();
154
+ if (sp)
155
+ return sp->get_intrinsics (profile);
156
+ else
157
+ return rs2_intrinsics{};
151
158
});
152
159
153
160
if (video->get_width () == 640 && video->get_height () == 480 && video->get_format () == RS2_FORMAT_RGB8 && video->get_framerate () == 30 )
Original file line number Diff line number Diff line change @@ -129,9 +129,15 @@ namespace librealsense
129
129
if (p->get_format () != RS2_FORMAT_Y16) // Y16 format indicate unrectified images, no intrinsics are available for these
130
130
{
131
131
auto profile = to_profile (p.get ());
132
- video->set_intrinsics ([profile, this ]()
132
+ std::weak_ptr<ds5_depth_sensor> wp =
133
+ std::dynamic_pointer_cast<ds5_depth_sensor>(this ->shared_from_this ());
134
+ video->set_intrinsics ([profile, wp]()
133
135
{
134
- return get_intrinsics (profile);
136
+ auto sp = wp.lock ();
137
+ if (sp)
138
+ return sp->get_intrinsics (profile);
139
+ else
140
+ return rs2_intrinsics{};
135
141
});
136
142
}
137
143
}
Original file line number Diff line number Diff line change @@ -120,11 +120,16 @@ namespace librealsense
120
120
if (video->get_width () == 640 && video->get_height () == 480 && video->get_format () == RS2_FORMAT_RAW8 && video->get_framerate () == 30 )
121
121
video->make_default ();
122
122
123
- // Register intrinsics
124
123
auto profile = to_profile (p.get ());
125
- video->set_intrinsics ([profile, this ]()
124
+ std::weak_ptr<ds5_fisheye_sensor> wp =
125
+ std::dynamic_pointer_cast<ds5_fisheye_sensor>(this ->shared_from_this ());
126
+ video->set_intrinsics ([profile, wp]()
126
127
{
127
- return get_intrinsics (profile);
128
+ auto sp = wp.lock ();
129
+ if (sp)
130
+ return sp->get_intrinsics (profile);
131
+ else
132
+ return rs2_intrinsics{};
128
133
});
129
134
}
130
135
Original file line number Diff line number Diff line change @@ -233,9 +233,15 @@ namespace librealsense
233
233
video->make_default ();
234
234
235
235
auto profile = to_profile (p.get ());
236
- video->set_intrinsics ([profile, this ]()
236
+ std::weak_ptr<sr300_color_sensor> wp =
237
+ std::dynamic_pointer_cast<sr300_color_sensor>(this ->shared_from_this ());
238
+ video->set_intrinsics ([profile, wp]()
237
239
{
238
- return get_intrinsics (profile);
240
+ auto sp = wp.lock ();
241
+ if (sp)
242
+ return sp->get_intrinsics (profile);
243
+ else
244
+ return rs2_intrinsics{};
239
245
});
240
246
}
241
247
@@ -285,9 +291,16 @@ namespace librealsense
285
291
video->make_default ();
286
292
287
293
auto profile = to_profile (p.get ());
288
- video->set_intrinsics ([profile, this ]()
294
+ std::weak_ptr<sr300_depth_sensor> wp =
295
+ std::dynamic_pointer_cast<sr300_depth_sensor>(this ->shared_from_this ());
296
+
297
+ video->set_intrinsics ([profile, wp]()
289
298
{
290
- return get_intrinsics (profile);
299
+ auto sp = wp.lock ();
300
+ if (sp)
301
+ return sp->get_intrinsics (profile);
302
+ else
303
+ return rs2_intrinsics{};
291
304
});
292
305
}
293
306
You can’t perform that action at this time.
0 commit comments