Repository navigation
Conversation
apljungquist
left a comment
There was a problem hiding this comment.
Looks like an improvement over status quo, but I think it could be even better. If you want to go ahead with it as is, then tag Gustaf and ask for his approval.
Thanks for contributing this; I expect I will need it soon since I'm starting to use scene metadata on a project and I may need to deploy to AXIS OS 11 soon.
| mdb_sys::mdb_on_error_t, | ||
| >( | ||
| Self::on_error::<F> | ||
| as unsafe extern "C" fn(*const mdb_sys::mdb_error_t, *mut libc::c_void), |
There was a problem hiding this comment.
Do we need both the as cast and the transmute?
There was a problem hiding this comment.
Neither, as it turns out. mdb-sys now blocklists mdb_on_error_t and declares it once with *const mdb_error_t, so mdb passes Some(Self::on_error::<F>) with no cast, transmute or unsafe (e2112d9).
|
@guoxe could you take a look? @apljungquist approved; the review points are addressed in e2112d9 and cd6d0f5. CI needs a workflow approval to run, and I will update the consume_analytics_metadata checksum from its output if it changed. |
…ed_files CI runs it with SDK 12, whose headers differ.
mdb didn't build against SDK 1.15 (AXIS OS 11). In that SDK
mdb_on_error_ttakesmdb_error_t *, while SDK 12 takesconst mdb_error_t *. bindgen now skipsmdb_on_error_tand mdb-sys declares it once with theconstpointer, which has the same ABI, so mdb passes its callback without a cast for either SDK.SDK 1.3 has no mdb, so AXIS OS 10.12 stays unsupported.
make check_mdb_axis_os_11(part ofcheck_other) checks mdb against committed AXIS OS 11 host bindings, selected with themdb-sys/axis-os-11feature. They are regenerated withmake crates/mdb-sys/src/bindings_axis_os_11.rsin an SDK 1.15 container;check_generated_filesleaves them alone because CI runs it with SDK 12.I tested
consume_analytics_metadataon an AXIS OS 11.11 camera (P3248-LV) and an AXIS OS 12.11 camera (P3268-LV). Both receive scene description messages.