mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-21 08:03:50 +08:00
cameradisableFullDisable
This commit is contained in:
@@ -272,6 +272,7 @@ void camerad_thread() {
|
||||
for (const auto &config : ALL_CAMERA_CONFIGS) {
|
||||
auto cam = std::make_unique<CameraState>(&m, config);
|
||||
cam->init(&v, device_id, ctx);
|
||||
if (!cam->camera.enabled) continue;
|
||||
cams.emplace_back(std::move(cam));
|
||||
}
|
||||
|
||||
|
||||
@@ -280,7 +280,12 @@ void SpectraCamera::camera_open(VisionIpcServer *v, cl_device_id device_id, cl_c
|
||||
return;
|
||||
}
|
||||
|
||||
if (!enabled) return;
|
||||
if (!enabled) {
|
||||
// Disabled or failed cameras still run through sensor setup, but they
|
||||
// should not keep an idle session around for the rest of camerad's life.
|
||||
camera_close();
|
||||
return;
|
||||
}
|
||||
|
||||
buf.out_img_width = sensor->frame_width / sensor->out_scale;
|
||||
buf.out_img_height = (sensor->hdr_offset > 0 ? (sensor->frame_height - sensor->hdr_offset) / 2 : sensor->frame_height) / sensor->out_scale;
|
||||
|
||||
Reference in New Issue
Block a user