PeterBee97 commented on code in PR #18745:
URL: https://github.com/apache/nuttx/pull/18745#discussion_r3206137648
##########
arch/sim/src/sim/sim_camera.c:
##########
@@ -138,29 +150,7 @@ static const struct v4l2_frmsizeenum g_frmsizes[] =
}
};
-static struct v4l2_fmtdesc g_fmts[] =
-{
- {
- .pixelformat = V4L2_PIX_FMT_YUV420,
- .description = "YUV420",
- }
-};
-
-static sim_camera_priv_t g_sim_camera_priv =
-{
- .data =
- {
- &g_sim_camera_data_ops
- },
- .sensor =
- {
- .ops = &g_sim_camera_ops,
- .frmsizes_num = 1,
- .frmsizes = g_frmsizes,
- .fmtdescs_num = 1,
- .fmtdescs = g_fmts,
- }
-};
+static sim_camera_priv_t *g_sim_camera_privs;
Review Comment:
done (`privs` is now implicitly persistent allocated with no clear owner, is
that ok?)
##########
arch/sim/src/sim/sim_camera.c:
##########
@@ -386,11 +433,42 @@ static void sim_camera_interrupt(wdparm_t arg)
int sim_camera_initialize(void)
{
- sim_camera_priv_t *priv = &g_sim_camera_priv;
+ int count;
+ int first_error = 0;
- imgsensor_register(&priv->sensor);
- imgdata_register(&priv->data);
+ count = host_video_get_device_count();
+ if (count <= 0)
+ {
+ count = 1;
Review Comment:
fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]