fix(uvc): match v4l2 ioctl layout

This commit is contained in:
Brad Stein 2026-04-28 21:49:58 -03:00
parent 0ebb150ebe
commit d302764b4a
6 changed files with 11 additions and 6 deletions

6
Cargo.lock generated
View File

@ -1642,7 +1642,7 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
[[package]]
name = "lesavka_client"
version = "0.14.46"
version = "0.14.47"
dependencies = [
"anyhow",
"async-stream",
@ -1676,7 +1676,7 @@ dependencies = [
[[package]]
name = "lesavka_common"
version = "0.14.46"
version = "0.14.47"
dependencies = [
"anyhow",
"base64",
@ -1688,7 +1688,7 @@ dependencies = [
[[package]]
name = "lesavka_server"
version = "0.14.46"
version = "0.14.47"
dependencies = [
"anyhow",
"base64",

View File

@ -4,7 +4,7 @@ path = "src/main.rs"
[package]
name = "lesavka_client"
version = "0.14.46"
version = "0.14.47"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "lesavka_common"
version = "0.14.46"
version = "0.14.47"
edition = "2024"
build = "build.rs"

View File

@ -894,6 +894,7 @@ if [[ "$UVC_ENV_CHANGED" == "1" ]] && is_attached_state "$UDC_STATE"; then
fi
if [[ -n ${LESAVKA_ALLOW_GADGET_RESET:-} ]] || [[ "$FORCE_GADGET_REBUILD" == "1" ]] || ! is_attached_state "$UDC_STATE"; then
echo "⚠️ UDC state is '$UDC_STATE' - forcing a Lesavka gadget rebuild before server start."
sudo systemctl stop lesavka-server >/dev/null 2>&1 || true
sudo systemctl stop lesavka-uvc >/dev/null 2>&1 || true
sudo systemctl reset-failed lesavka-uvc >/dev/null 2>&1 || true
sudo env \

View File

@ -10,7 +10,7 @@ bench = false
[package]
name = "lesavka_server"
version = "0.14.46"
version = "0.14.47"
edition = "2024"
autobins = false

View File

@ -117,6 +117,9 @@ union V4l2FormatUnion {
#[repr(C)]
struct V4l2Format {
type_: u32,
// v4l2_format's union is 8-byte aligned on aarch64; this pad keeps
// our ioctl request size at the kernel's expected 208 bytes.
_padding: u32,
fmt: V4l2FormatUnion,
}
@ -315,6 +318,7 @@ impl UvcVideoStream {
fn set_format(&self, cfg: UvcConfig) -> Result<()> {
let mut fmt = V4l2Format {
type_: V4L2_BUF_TYPE_VIDEO_OUTPUT,
_padding: 0,
fmt: V4l2FormatUnion {
pix: V4l2PixFormat {
width: cfg.width,