@@ -64,6 +64,30 @@ class platform_camera_sensor : public synthetic_sensor
64
64
65
65
} // namespace
66
66
67
+ void platform_camera::initialize ()
68
+ {
69
+ auto const n_sensors = get_sensors_count ();
70
+ for (auto i = 0 ; i < n_sensors; ++i)
71
+ {
72
+ if (auto sensor = dynamic_cast <platform_camera_sensor*>(&(get_sensor (i))))
73
+ {
74
+ if (sensor->get_device ().get_info (RS2_CAMERA_INFO_NAME) == " Platform Camera" )
75
+ {
76
+ sensor->try_register_pu (RS2_OPTION_BACKLIGHT_COMPENSATION);
77
+ sensor->try_register_pu (RS2_OPTION_BRIGHTNESS);
78
+ sensor->try_register_pu (RS2_OPTION_CONTRAST);
79
+ sensor->try_register_pu (RS2_OPTION_EXPOSURE);
80
+ sensor->try_register_pu (RS2_OPTION_GAMMA);
81
+ sensor->try_register_pu (RS2_OPTION_HUE);
82
+ sensor->try_register_pu (RS2_OPTION_SATURATION);
83
+ sensor->try_register_pu (RS2_OPTION_SHARPNESS);
84
+ sensor->try_register_pu (RS2_OPTION_WHITE_BALANCE);
85
+ sensor->try_register_pu (RS2_OPTION_ENABLE_AUTO_EXPOSURE);
86
+ sensor->try_register_pu (RS2_OPTION_ENABLE_AUTO_WHITE_BALANCE);
87
+ }
88
+ }
89
+ }
90
+ }
67
91
68
92
platform_camera::platform_camera ( std::shared_ptr< const device_info > const & dev_info,
69
93
const std::vector< platform::uvc_device_info > & uvc_infos,
@@ -118,20 +142,13 @@ platform_camera::platform_camera( std::shared_ptr< const device_info > const & d
118
142
color_ep->register_metadata ( RS2_FRAME_METADATA_FRAME_TIMESTAMP,
119
143
make_uvc_header_parser ( &platform::uvc_header::timestamp ) );
120
144
121
- color_ep->try_register_pu ( RS2_OPTION_BACKLIGHT_COMPENSATION );
122
- color_ep->try_register_pu ( RS2_OPTION_BRIGHTNESS );
123
- color_ep->try_register_pu ( RS2_OPTION_CONTRAST );
124
- color_ep->try_register_pu ( RS2_OPTION_EXPOSURE );
125
- color_ep->try_register_pu ( RS2_OPTION_GAMMA );
126
- color_ep->try_register_pu ( RS2_OPTION_HUE );
127
- color_ep->try_register_pu ( RS2_OPTION_SATURATION );
128
- color_ep->try_register_pu ( RS2_OPTION_SHARPNESS );
129
- color_ep->try_register_pu ( RS2_OPTION_WHITE_BALANCE );
130
- color_ep->try_register_pu ( RS2_OPTION_ENABLE_AUTO_EXPOSURE );
131
- color_ep->try_register_pu ( RS2_OPTION_ENABLE_AUTO_WHITE_BALANCE );
145
+ // Create a thread to call initialize after a delay
146
+ std::thread ([this ]() {
147
+ std::this_thread::sleep_for (std::chrono::seconds (2 )); // Delay for 2 seconds
148
+ this ->initialize ();
149
+ }).detach (); // Detach the thread to let it run independently
132
150
}
133
151
134
-
135
152
std::vector< tagged_profile > platform_camera::get_profiles_tags () const
136
153
{
137
154
std::vector< tagged_profile > markers;
0 commit comments