Skip to content

Commit 2bed2dd

Browse files
authored
Merge pull request #5357 from arilowen/fix-l500-resolutions
Fix l500 resolutions
2 parents aa8ef3c + 5577d7c commit 2bed2dd

File tree

12 files changed

+67
-47
lines changed

12 files changed

+67
-47
lines changed

src/context.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ namespace librealsense
241241
assign_stream(_default_stream, p);
242242
environment::get_instance().get_extrinsics_graph().register_same_extrinsics(*_default_stream, *p);
243243
}
244-
add_source_profiles_missing_data();
245244

246245
return results;
247246
}

src/ds5/ds5-color.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ namespace librealsense
6767
std::unique_ptr<frame_timestamp_reader> ds5_timestamp_reader_metadata(new ds5_timestamp_reader_from_metadata(std::move(ds5_timestamp_reader_backup)));
6868

6969
auto enable_global_time_option = std::shared_ptr<global_time_option>(new global_time_option());
70-
auto raw_color_ep = std::make_shared<uvc_sensor>("Raw RGB Sensor",
70+
auto raw_color_ep = std::make_shared<uvc_sensor>("Raw RGB Camera",
7171
backend.create_uvc_device(color_devices_info.front()),
7272
std::unique_ptr<frame_timestamp_reader>(new global_timestamp_reader(std::move(ds5_timestamp_reader_metadata), _tf_keeper, enable_global_time_option)),
7373
this);
@@ -223,7 +223,6 @@ namespace librealsense
223223
return rs2_intrinsics{};
224224
});
225225
}
226-
add_source_profiles_missing_data();
227226

228227
return results;
229228
}

src/ds5/ds5-color.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace librealsense
4343
std::shared_ptr<uvc_sensor> uvc_sensor,
4444
std::map<uint32_t, rs2_format> ds5_color_fourcc_to_rs2_format,
4545
std::map<uint32_t, rs2_stream> ds5_color_fourcc_to_rs2_stream)
46-
: synthetic_sensor("RGB Sensor", uvc_sensor, owner, ds5_color_fourcc_to_rs2_format, ds5_color_fourcc_to_rs2_stream),
46+
: synthetic_sensor("RGB Camera", uvc_sensor, owner, ds5_color_fourcc_to_rs2_format, ds5_color_fourcc_to_rs2_stream),
4747
_owner(owner)
4848
{}
4949

src/ds5/ds5-device.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,27 @@
4141
namespace librealsense
4242
{
4343
std::map<uint32_t, rs2_format> ds5_depth_fourcc_to_rs2_format = {
44+
{rs_fourcc('Y','U','Y','2'), RS2_FORMAT_YUYV},
45+
{rs_fourcc('Y','U','Y','V'), RS2_FORMAT_YUYV},
46+
{rs_fourcc('U','Y','V','Y'), RS2_FORMAT_UYVY},
4447
{rs_fourcc('G','R','E','Y'), RS2_FORMAT_Y8},
4548
{rs_fourcc('Y','8','I',' '), RS2_FORMAT_Y8I},
4649
{rs_fourcc('W','1','0',' '), RS2_FORMAT_W10},
4750
{rs_fourcc('Y','1','6',' '), RS2_FORMAT_Y16},
4851
{rs_fourcc('Y','1','2','I'), RS2_FORMAT_Y12I},
4952
{rs_fourcc('Z','1','6',' '), RS2_FORMAT_Z16},
50-
{rs_fourcc('U','Y','V','Y'), RS2_FORMAT_UYVY},
5153
{rs_fourcc('R','G','B','2'), RS2_FORMAT_BGR8}
5254

5355
};
5456
std::map<uint32_t, rs2_stream> ds5_depth_fourcc_to_rs2_stream = {
57+
{rs_fourcc('Y','U','Y','2'), RS2_STREAM_INFRARED},
58+
{rs_fourcc('Y','U','Y','V'), RS2_STREAM_INFRARED},
59+
{rs_fourcc('U','Y','V','Y'), RS2_STREAM_INFRARED},
5560
{rs_fourcc('G','R','E','Y'), RS2_STREAM_INFRARED},
5661
{rs_fourcc('Y','8','I',' '), RS2_STREAM_INFRARED},
5762
{rs_fourcc('W','1','0',' '), RS2_STREAM_INFRARED},
5863
{rs_fourcc('Y','1','6',' '), RS2_STREAM_INFRARED},
5964
{rs_fourcc('Y','1','2','I'), RS2_STREAM_INFRARED},
60-
{rs_fourcc('U','Y','V','Y'), RS2_STREAM_INFRARED},
6165
{rs_fourcc('R','G','B','2'), RS2_STREAM_INFRARED},
6266
{rs_fourcc('Z','1','6',' '), RS2_STREAM_DEPTH},
6367
};
@@ -284,7 +288,7 @@ namespace librealsense
284288
public:
285289
explicit ds5_depth_sensor(ds5_device* owner,
286290
std::shared_ptr<uvc_sensor> uvc_sensor)
287-
: synthetic_sensor("Depth Sensor", uvc_sensor, owner, ds5_depth_fourcc_to_rs2_format, ds5_depth_fourcc_to_rs2_stream),
291+
: synthetic_sensor(ds::DEPTH_STEREO, uvc_sensor, owner, ds5_depth_fourcc_to_rs2_format, ds5_depth_fourcc_to_rs2_stream),
288292
_owner(owner),
289293
_depth_units(-1)
290294
{}
@@ -364,7 +368,6 @@ namespace librealsense
364368
});
365369
}
366370
}
367-
add_source_profiles_missing_data();
368371

369372
return results;
370373
}
@@ -451,7 +454,6 @@ namespace librealsense
451454
});
452455
}
453456
}
454-
add_source_profiles_missing_data();
455457

456458
return results;
457459
}
@@ -915,7 +917,7 @@ namespace librealsense
915917
std::unique_ptr<frame_timestamp_reader> ds5_timestamp_reader_metadata(new ds5_timestamp_reader_from_metadata(std::move(ds5_timestamp_reader_backup)));
916918

917919
auto enable_global_time_option = std::shared_ptr<global_time_option>(new global_time_option());
918-
auto raw_depth_ep = std::make_shared<uvc_sensor>("Depth Sensor", std::make_shared<platform::multi_pins_uvc_device>(depth_devices), std::unique_ptr<frame_timestamp_reader>(new global_timestamp_reader(std::move(ds5_timestamp_reader_metadata), _tf_keeper, enable_global_time_option)), this);
920+
auto raw_depth_ep = std::make_shared<uvc_sensor>(ds::DEPTH_STEREO, std::make_shared<platform::multi_pins_uvc_device>(depth_devices), std::unique_ptr<frame_timestamp_reader>(new global_timestamp_reader(std::move(ds5_timestamp_reader_metadata), _tf_keeper, enable_global_time_option)), this);
919921
auto depth_ep = std::make_shared<ds5u_depth_sensor>(this, raw_depth_ep);
920922

921923
depth_ep->register_option(RS2_OPTION_GLOBAL_TIME_ENABLED, enable_global_time_option);
@@ -926,11 +928,8 @@ namespace librealsense
926928
depth_ep->register_processing_block({ {RS2_FORMAT_W10} }, { {RS2_FORMAT_RAW10, RS2_STREAM_INFRARED, 1} }, []() { return std::make_shared<w10_converter>(RS2_FORMAT_RAW10); });
927929
depth_ep->register_processing_block({ {RS2_FORMAT_W10} }, { {RS2_FORMAT_Y10BPACK, RS2_STREAM_INFRARED, 1} }, []() { return std::make_shared<w10_converter>(RS2_FORMAT_Y10BPACK); });
928930

929-
depth_ep->register_processing_block({ {RS2_FORMAT_UYVY} }, { {RS2_FORMAT_RGB8, RS2_STREAM_INFRARED} }, []() { return std::make_shared<uyvy_converter>(RS2_FORMAT_RGB8, RS2_STREAM_INFRARED); });
930-
depth_ep->register_processing_block({ {RS2_FORMAT_UYVY} }, { {RS2_FORMAT_RGBA8, RS2_STREAM_INFRARED} }, []() { return std::make_shared<uyvy_converter>(RS2_FORMAT_RGBA8, RS2_STREAM_INFRARED); });
931-
depth_ep->register_processing_block({ {RS2_FORMAT_UYVY} }, { {RS2_FORMAT_BGR8, RS2_STREAM_INFRARED} }, []() { return std::make_shared<uyvy_converter>(RS2_FORMAT_BGR8, RS2_STREAM_INFRARED); });
932-
depth_ep->register_processing_block({ {RS2_FORMAT_UYVY} }, { {RS2_FORMAT_BGRA8, RS2_STREAM_INFRARED} }, []() { return std::make_shared<uyvy_converter>(RS2_FORMAT_BGRA8, RS2_STREAM_INFRARED); });
933-
depth_ep->register_processing_block(processing_block_factory::create_id_pbf(RS2_FORMAT_UYVY, RS2_STREAM_INFRARED));
931+
depth_ep->register_processing_block(processing_block_factory::create_pbf_vector<uyvy_converter>(RS2_FORMAT_UYVY, map_supported_color_formats(RS2_FORMAT_UYVY), RS2_STREAM_INFRARED));
932+
934933

935934
return depth_ep;
936935
}

src/ds5/ds5-nonmonochrome.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,26 @@ namespace librealsense
2828
using namespace ds;
2929

3030
auto pid = group.uvc_devices.front().pid;
31+
auto& depth_ep = get_depth_sensor();
3132
if ((_fw_version >= firmware_version("5.5.8.0")) && (!val_in_range(pid, { RS_USB2_PID, RS465_PID })))
3233
{
33-
auto& depth_ep = get_depth_sensor();
3434
depth_ep.register_option(RS2_OPTION_ENABLE_AUTO_WHITE_BALANCE,
3535
std::make_shared<uvc_xu_option<uint8_t>>(get_raw_depth_sensor(),
3636
depth_xu,
3737
DS5_ENABLE_AUTO_WHITE_BALANCE,
3838
"Enable Auto White Balance"));
3939

4040
// RS400 rolling-shutter Skus allow to get low-quality color image from the same viewport as the depth
41-
depth_ep.register_processing_block({ {RS2_FORMAT_UYVY} }, { {RS2_FORMAT_RGB8, RS2_STREAM_INFRARED} }, []() { return std::make_shared<uyvy_converter>(RS2_FORMAT_RGB8, RS2_STREAM_INFRARED); });
42-
depth_ep.register_processing_block({ {RS2_FORMAT_UYVY} }, { {RS2_FORMAT_RGBA8, RS2_STREAM_INFRARED} }, []() { return std::make_shared<uyvy_converter>(RS2_FORMAT_RGBA8, RS2_STREAM_INFRARED); });
43-
depth_ep.register_processing_block({ {RS2_FORMAT_UYVY} }, { {RS2_FORMAT_BGR8, RS2_STREAM_INFRARED} }, []() { return std::make_shared<uyvy_converter>(RS2_FORMAT_BGR8, RS2_STREAM_INFRARED); });
44-
depth_ep.register_processing_block({ {RS2_FORMAT_UYVY} }, { {RS2_FORMAT_BGRA8, RS2_STREAM_INFRARED} }, []() { return std::make_shared<uyvy_converter>(RS2_FORMAT_BGRA8, RS2_STREAM_INFRARED); });
45-
depth_ep.register_processing_block(processing_block_factory::create_id_pbf(RS2_FORMAT_UYVY, RS2_STREAM_INFRARED));
46-
4741
depth_ep.register_processing_block({ {RS2_FORMAT_BGR8} }, { {RS2_FORMAT_RGB8, RS2_STREAM_INFRARED} }, []() { return std::make_shared<bgr_to_rgb>(); });
4842

4943
depth_ep.register_processing_block(processing_block_factory::create_id_pbf(RS2_FORMAT_Z16, RS2_STREAM_DEPTH));
5044
depth_ep.register_processing_block({ {RS2_FORMAT_W10} }, { {RS2_FORMAT_RAW10, RS2_STREAM_INFRARED, 1} }, []() { return std::make_shared<w10_converter>(RS2_FORMAT_RAW10); });
5145
depth_ep.register_processing_block({ {RS2_FORMAT_W10} }, { {RS2_FORMAT_Y10BPACK, RS2_STREAM_INFRARED, 1} }, []() { return std::make_shared<w10_converter>(RS2_FORMAT_Y10BPACK); });
5246
}
5347

48+
depth_ep.register_processing_block(processing_block_factory::create_pbf_vector<yuy2_converter>(RS2_FORMAT_YUYV, map_supported_color_formats(RS2_FORMAT_YUYV), RS2_STREAM_INFRARED));
49+
depth_ep.register_processing_block(processing_block_factory::create_pbf_vector<uyvy_converter>(RS2_FORMAT_UYVY, map_supported_color_formats(RS2_FORMAT_UYVY), RS2_STREAM_INFRARED));
50+
5451
get_depth_sensor().unregister_option(RS2_OPTION_EMITTER_ON_OFF);
5552

5653
if ((_fw_version >= firmware_version("5.9.13.6") &&

src/ivcam/sr300.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ namespace librealsense
9494
std::shared_ptr<synthetic_sensor> sr300_camera::create_color_device(std::shared_ptr<context> ctx,
9595
const platform::uvc_device_info& color)
9696
{
97-
auto raw_color_ep = std::make_shared<uvc_sensor>("Raw RGB Sensor", ctx->get_backend().create_uvc_device(color),
97+
auto raw_color_ep = std::make_shared<uvc_sensor>("Raw RGB Camera", ctx->get_backend().create_uvc_device(color),
9898
std::unique_ptr<frame_timestamp_reader>(new sr300_timestamp_reader_from_metadata()),
9999
this);
100100
auto color_ep = std::make_shared<sr300_color_sensor>(this,

src/ivcam/sr300.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ namespace librealsense
280280
return rs2_intrinsics{};
281281
});
282282
}
283-
add_source_profiles_missing_data();
284283

285284
return results;
286285
}
@@ -343,7 +342,6 @@ namespace librealsense
343342
return rs2_intrinsics{};
344343
});
345344
}
346-
add_source_profiles_missing_data();
347345

348346
return results;
349347
}

src/l500/l500-color.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@ namespace librealsense
1414
using namespace ivcam2;
1515

1616
std::map<uint32_t, rs2_format> l500_color_fourcc_to_rs2_format = {
17-
{rs_fourcc('Y','U','Y','2'), RS2_FORMAT_YUYV}
17+
{rs_fourcc('Y','U','Y','2'), RS2_FORMAT_YUYV},
18+
{rs_fourcc('Y','U','Y','V'), RS2_FORMAT_YUYV},
19+
{rs_fourcc('U','Y','V','Y'), RS2_FORMAT_UYVY}
1820
};
1921

2022
std::map<uint32_t, rs2_stream> l500_color_fourcc_to_rs2_stream = {
2123
{rs_fourcc('Y','U','Y','2'), RS2_STREAM_COLOR},
24+
{rs_fourcc('Y','U','Y','V'), RS2_STREAM_COLOR},
25+
{rs_fourcc('U','Y','V','Y'), RS2_STREAM_COLOR}
2226
};
2327

2428
std::shared_ptr<synthetic_sensor> l500_color::create_color_device(std::shared_ptr<context> ctx, const std::vector<platform::uvc_device_info>& color_devices_info)
@@ -27,7 +31,7 @@ namespace librealsense
2731

2832
std::unique_ptr<frame_timestamp_reader> timestamp_reader_metadata(new ivcam2::l500_timestamp_reader_from_metadata(backend.create_time_service()));
2933
auto enable_global_time_option = std::shared_ptr<global_time_option>(new global_time_option());
30-
auto raw_color_ep = std::make_shared<uvc_sensor>("RGB Sensor", ctx->get_backend().create_uvc_device(color_devices_info.front()),
34+
auto raw_color_ep = std::make_shared<uvc_sensor>("RGB Camera", ctx->get_backend().create_uvc_device(color_devices_info.front()),
3135
std::unique_ptr<frame_timestamp_reader>(new global_timestamp_reader(std::move(timestamp_reader_metadata), _tf_keeper, enable_global_time_option)),
3236
this);
3337
auto color_ep = std::make_shared<l500_color_sensor>(this, raw_color_ep, ctx, l500_color_fourcc_to_rs2_format, l500_color_fourcc_to_rs2_stream);

src/l500/l500-color.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace librealsense
4848
std::shared_ptr<context> ctx,
4949
std::map<uint32_t, rs2_format> l500_color_fourcc_to_rs2_format,
5050
std::map<uint32_t, rs2_stream> l500_color_fourcc_to_rs2_stream)
51-
: synthetic_sensor("RGB Sensor", uvc_sensor, owner, l500_color_fourcc_to_rs2_format, l500_color_fourcc_to_rs2_stream),
51+
: synthetic_sensor("RGB Camera", uvc_sensor, owner, l500_color_fourcc_to_rs2_format, l500_color_fourcc_to_rs2_stream),
5252
_owner(owner)
5353
{}
5454

@@ -118,7 +118,6 @@ namespace librealsense
118118
return rs2_intrinsics{};
119119
});
120120
}
121-
add_source_profiles_missing_data();
122121

123122
return results;
124123
}

src/l500/l500-depth.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ namespace librealsense
8686
{
8787
public:
8888
explicit l500_depth_sensor(l500_device* owner, std::shared_ptr<uvc_sensor> uvc_sensor, std::map<uint32_t,rs2_format> l500_depth_fourcc_to_rs2_format_map, std::map<uint32_t, rs2_stream> l500_depth_fourcc_to_rs2_stream_map)
89-
: synthetic_sensor("Depth Sensor", uvc_sensor, owner, l500_depth_fourcc_to_rs2_format_map, l500_depth_fourcc_to_rs2_stream_map), _owner(owner), _depth_invalidation_enabled(false)
89+
: synthetic_sensor("L500 Depth Sensor", uvc_sensor, owner, l500_depth_fourcc_to_rs2_format_map, l500_depth_fourcc_to_rs2_stream_map), _owner(owner), _depth_invalidation_enabled(false)
9090
{
9191
register_option(RS2_OPTION_DEPTH_UNITS, std::make_shared<const_value_option>("Number of meters represented by a single depth unit",
9292
lazy<float>([&]() {
@@ -194,7 +194,6 @@ namespace librealsense
194194
return rs2_intrinsics{};
195195
});
196196
}
197-
add_source_profiles_missing_data();
198197

199198
return results;
200199
}

0 commit comments

Comments
 (0)