mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-09-13 02:54:26 +08:00
fix(hwcodec): release V4L2M2M packets before delivery
Copy compressed V4L2M2M output before asynchronous delivery. This releases driver capture buffers and prevents encoder stalls. Signed-off-by: BigfootACA <bigfoot@radxa.com>
This commit is contained in:
@@ -592,6 +592,16 @@ impl Encoder {
|
|||||||
Some(Encoder::packet_callback),
|
Some(Encoder::packet_callback),
|
||||||
);
|
);
|
||||||
if result == -11 || result == 0 {
|
if result == -11 || result == 0 {
|
||||||
|
if self.ctx.name.contains("v4l2m2m") {
|
||||||
|
return Ok(frames
|
||||||
|
.into_iter()
|
||||||
|
.map(|frame| EncodeBytesFrame {
|
||||||
|
data: Bytes::copy_from_slice(frame.data.as_ref()),
|
||||||
|
pts: frame.pts,
|
||||||
|
key: frame.key,
|
||||||
|
})
|
||||||
|
.collect());
|
||||||
|
}
|
||||||
return Ok(frames);
|
return Ok(frames);
|
||||||
}
|
}
|
||||||
Err(result)
|
Err(result)
|
||||||
|
|||||||
Reference in New Issue
Block a user