-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update/u3v refactor #254
Update/u3v refactor #254
Conversation
xinyuli1204
commented
Mar 4, 2024
•
edited
Loading
edited
- Polymorphic U3V class implementation
- Following consistent naming convention (snake case) ( sync_frame_count, set_realtime, set_gain ....)
- fix u3vGendc on main branch
- Return -1 for devices has no frame count #253 integrate design for frame count in this issue
…-kit into Update/u3v-refactor
@@ -312,6 +286,10 @@ class U3V { | |||
} | |||
} | |||
|
|||
|
|||
virtual void get(std::vector<Halide::Buffer<>>& outs){}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to be pure virtual function (virtual void get(...) = 0
) to avoid mistake on overriding in the derived.
src/bb/image-io/rt_u3v.h
Outdated
} | ||
|
||
|
||
void set_realtime(std::vector<ArvBuffer *> &bufs, int timeout_us = 3 * 1000 * 1000){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method doesn't look like "setting realtime". Maybe consume_old_buffer
or ensure_newest_buffer
or something else similar is better?
} | ||
void get(std::vector<Halide::Buffer<>>& outs) override{ | ||
auto timeout_us = 30 * 1000 * 1000; | ||
if (sim_mode_){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is sim_mode in U3VRealCam
required? It looks force_sim_mode leads to use U3VFakeCam
class, not sim_mode in U3vRealCam
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fixstars-iizuka if u3vRealCam doesn't detect any device it will fall back to sim_mode
for example:
Node n = b.add("image_io_u3v_cameraN_u8x2")().set_param(
Param("num_devices", num_device),
Param("pixel_format", "Mono8")
);
the force_sim_mode is false, but since there is no device detected it fallback to sim_mode