Skip to content

fix: Add handling for missing VideoFormat on Linux#169

Open
meocoder31099 wants to merge 1 commit intoCapSoftware:mainfrom
meocoder31099:main
Open

fix: Add handling for missing VideoFormat on Linux#169
meocoder31099 wants to merge 1 commit intoCapSoftware:mainfrom
meocoder31099:main

Conversation

@meocoder31099
Copy link

@meocoder31099 meocoder31099 commented Aug 4, 2025

In the current code, VideoFormat::RGBA is included in the list of output formats for the buffer

pw::spa::pod::property!(
FormatProperties::VideoFormat,
Choice,
Enum,
Id,
pw::spa::param::video::VideoFormat::RGB,
pw::spa::param::video::VideoFormat::RGBA,
pw::spa::param::video::VideoFormat::RGBx,
pw::spa::param::video::VideoFormat::BGRx,
),

but the case where VideoFormat is VideoFormat::RGBA is not handled
if let Err(e) = match user_data.format.format() {
VideoFormat::RGBx => user_data.tx.send(Frame::RGBx(RGBxFrame {
display_time: timestamp as u64,
width: frame_size.width as i32,
height: frame_size.height as i32,
data: frame_data,
})),
VideoFormat::RGB => user_data.tx.send(Frame::RGB(RGBFrame {
display_time: timestamp as u64,
width: frame_size.width as i32,
height: frame_size.height as i32,
data: frame_data,
})),
VideoFormat::xBGR => user_data.tx.send(Frame::XBGR(XBGRFrame {
display_time: timestamp as u64,
width: frame_size.width as i32,
height: frame_size.height as i32,
data: frame_data,
})),
VideoFormat::BGRx => user_data.tx.send(Frame::BGRx(BGRxFrame {
display_time: timestamp as u64,
width: frame_size.width as i32,
height: frame_size.height as i32,
data: frame_data,
})),
_ => panic!("Unsupported frame format received"),
} {
eprintln!("{e}");
}

This PR will fix it.

Summary by CodeRabbit

  • New Features
    • Added support for processing and transmitting video frames in the RGBA format on Linux systems.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant