fix: Resolve Wayland EIO (-5) DMA-BUF to VAAPI mapping crash by passing DRM format modifiers
This commit is contained in:
parent
5fac181cfe
commit
82904833f0
3 changed files with 5 additions and 4 deletions
|
|
@ -12,7 +12,7 @@ pub enum Frame {
|
|||
DmaBuf {
|
||||
width: u32,
|
||||
height: u32,
|
||||
format: u32,
|
||||
format: u32, modifier: u64,
|
||||
fd: RawFd,
|
||||
stride: u32,
|
||||
offset: u32,
|
||||
|
|
|
|||
|
|
@ -78,7 +78,8 @@ impl PipeWireStream {
|
|||
let frame = Frame::DmaBuf {
|
||||
width: user_data.format.size().width,
|
||||
height: user_data.format.size().height,
|
||||
format: 0x34325241, // DRM_FORMAT_ARGB8888
|
||||
format: 0x34325241, // DRM_FORMAT_ARGB8888
|
||||
modifier: user_data.format.modifier(),
|
||||
fd: data.fd(),
|
||||
stride: data.chunk().stride() as u32,
|
||||
offset: data.chunk().offset(),
|
||||
|
|
|
|||
|
|
@ -140,13 +140,13 @@ impl VaapiEncoder {
|
|||
av_frame_free(&mut nv12_frame);
|
||||
av_frame_free(&mut bgra_frame);
|
||||
}
|
||||
Frame::DmaBuf { width: dma_width, height: dma_height, format, fd, stride, offset } => {
|
||||
Frame::DmaBuf { width: dma_width, height: dma_height, format, modifier, fd, stride, offset } => {
|
||||
let mut drm_desc = AVDRMFrameDescriptor {
|
||||
nb_objects: 1,
|
||||
objects: [AVDRMObjectDescriptor {
|
||||
fd: *fd,
|
||||
size: 0, // usually ignored or mapped by driver
|
||||
format_modifier: 0, // DRM_FORMAT_MOD_LINEAR (or read from PipeWire format)
|
||||
format_modifier: *modifier,
|
||||
}, std::mem::zeroed(), std::mem::zeroed(), std::mem::zeroed()],
|
||||
nb_layers: 1,
|
||||
layers: [AVDRMLayerDescriptor {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue