uvc: send SET_CUR response after data
This commit is contained in:
parent
cb024953f1
commit
1b9a0f7ee2
@ -215,7 +215,15 @@ fn main() -> Result<()> {
|
|||||||
data.length
|
data.length
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
handle_data(&mut state, &mut pending, interfaces, data, debug);
|
handle_data(
|
||||||
|
fd,
|
||||||
|
uvc_send_response,
|
||||||
|
&mut state,
|
||||||
|
&mut pending,
|
||||||
|
interfaces,
|
||||||
|
data,
|
||||||
|
debug,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
if debug {
|
if debug {
|
||||||
@ -370,18 +378,15 @@ fn handle_setup(
|
|||||||
}
|
}
|
||||||
let interface = map_interface(interface_raw, selector, interfaces, debug);
|
let interface = map_interface(interface_raw, selector, interfaces, debug);
|
||||||
|
|
||||||
if !is_in && req.b_request == UVC_SET_CUR {
|
if !is_in && req.b_request == UVC_SET_CUR {
|
||||||
if interface != interfaces.streaming {
|
if interface != interfaces.streaming {
|
||||||
let _ = send_stall(fd, uvc_send_response);
|
let _ = send_stall(fd, uvc_send_response);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
*pending = Some(PendingRequest { interface, selector });
|
*pending = Some(PendingRequest { interface, selector });
|
||||||
let len = req.w_length as usize;
|
if debug {
|
||||||
let payload = vec![0u8; len.min(UVC_DATA_SIZE)];
|
eprintln!(
|
||||||
let _ = send_response(fd, uvc_send_response, &payload);
|
"[lesavka-uvc] SET_CUR queued len={} iface={} sel={}",
|
||||||
if debug {
|
|
||||||
eprintln!(
|
|
||||||
"[lesavka-uvc] SET_CUR queued len={} iface={} sel={}",
|
|
||||||
req.w_length, interface, selector
|
req.w_length, interface, selector
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -452,6 +457,8 @@ fn maybe_update_ctrl_len(state: &mut UvcState, w_length: u16, debug: bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn handle_data(
|
fn handle_data(
|
||||||
|
fd: i32,
|
||||||
|
uvc_send_response: libc::c_ulong,
|
||||||
state: &mut UvcState,
|
state: &mut UvcState,
|
||||||
pending: &mut Option<PendingRequest>,
|
pending: &mut Option<PendingRequest>,
|
||||||
interfaces: UvcInterfaces,
|
interfaces: UvcInterfaces,
|
||||||
@ -507,6 +514,7 @@ fn handle_data(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let _ = send_response(fd, uvc_send_response, &[]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user