clippy: clear the workspace errors and apply the machine fixes

- Mark the raw-pointer interop entry points unsafe with # Safety docs
  (oak-core upload/download/frame-from-pixels, oak-audio convert) and
  satisfy the existing callers (tests).
- mut_from_ref: allow with the ABI contract documented (the handle
  get_mut helpers in oak-timeline/oak-render/oak-task take the shared
  reference the C ABI passes; exclusivity is the caller's unsafe
  contract).
- Fix the eq_op in the white-balance normalization (green / green).
- Apply cargo clippy --fix across the workspace (redundant closures and
  field names, field reassignment, items after test modules, ...).
- Revert the replace_box fix in image_effect's clip_define: a
  redefinition must allocate a new box, otherwise the old clip handle
  stays valid and the HS-map replace contract (clip != clip2) breaks.
- 283 warnings remain; they are all non-machine-applicable
  (chunks_exact -> as_chunks needs a manual iter_mut, too_many_arguments,
  complex types, missing Safety docs, ...) and are tracked as the
  follow-up.
This commit is contained in:
2026-09-15 19:29:32 +08:00
parent 7e87ec135e
commit ee7ea18d94
146 changed files with 5235 additions and 4046 deletions
+5 -5
View File
@@ -1178,12 +1178,12 @@ impl DecoderState {
ctx.run(&f, &mut out).map_err(ffmpeg_err)?;
let bytes = if f32_ok {
let stride = out.stride(0);
convert_rgba_f32_le(&out.data(0), w, h, stride)
convert_rgba_f32_le(out.data(0), w, h, stride)
} else if out_fmt == Pixel::YUV444P16LE {
convert_yuv444p16_to_rgba_f32(&out, w, h, yuv_matrix_for(raw_space, src_w, src_h), full_range)
} else {
let stride = out.stride(0);
convert_rgba8_to_f32(&out.data(0), w, h, stride)
convert_rgba8_to_f32(out.data(0), w, h, stride)
};
let meta = crate::decoder::DecodedColorMeta {
color_primaries: raw_primaries,
@@ -2084,9 +2084,9 @@ fn probe_file(filename: &str, cancelled: Option<&CancelAtom>) -> Option<FootageD
vp.set_channel_count(VIDEO_CHANNELS);
vp.set_interlacing(Interlacing::None);
vp.set_pixel_aspect_ratio(1, 1);
vp.set_frame_rate(frame_rate.0 as i32, frame_rate.1 as i32);
vp.set_frame_rate(frame_rate.0, frame_rate.1);
vp.set_start_time(stream.start_time());
vp.set_time_base(tb.0 as i32, tb.1 as i32);
vp.set_time_base(tb.0, tb.1);
vp.set_duration(stream.duration());
vp.set_premultiplied_alpha(false);
// Stream colorimetry (drives the input→working transform
@@ -2134,7 +2134,7 @@ fn probe_file(filename: &str, cancelled: Option<&CancelAtom>) -> Option<FootageD
format: 0,
stream_index: i as i32,
duration: stream_duration,
time_base: (tb.0 as i32, tb.1 as i32),
time_base: (tb.0, tb.1),
}));
}
_ => {}