egl: Do not expose multi-planar buffers for now

This commit is contained in:
Victor Brekenfeld 2021-04-26 21:41:59 +02:00
parent 1f70aa6a08
commit 8e3b0c0b9b
2 changed files with 8 additions and 4 deletions

View File

@ -576,7 +576,6 @@ impl fmt::Debug for EGLBufferReader {
#[cfg(feature = "use_system_lib")]
impl EGLBufferReader {
fn new(display: Arc<EGLDisplayHandle>, wayland: *mut wl_display) -> Self {
Self {
display,
wayland,
@ -610,9 +609,9 @@ impl EGLBufferReader {
x if x == ffi::egl::TEXTURE_RGB as i32 => Format::RGB,
x if x == ffi::egl::TEXTURE_RGBA as i32 => Format::RGBA,
ffi::egl::TEXTURE_EXTERNAL_WL => Format::External,
ffi::egl::TEXTURE_Y_UV_WL => Format::Y_UV,
ffi::egl::TEXTURE_Y_U_V_WL => Format::Y_U_V,
ffi::egl::TEXTURE_Y_XUXV_WL => Format::Y_XUXV,
ffi::egl::TEXTURE_Y_UV_WL => return Err(BufferAccessError::UnsupportedMultiPlanarFormat(Format::Y_UV)),
ffi::egl::TEXTURE_Y_U_V_WL => return Err(BufferAccessError::UnsupportedMultiPlanarFormat(Format::Y_U_V)),
ffi::egl::TEXTURE_Y_XUXV_WL => return Err(BufferAccessError::UnsupportedMultiPlanarFormat(Format::Y_XUXV)),
x => panic!("EGL returned invalid texture type: {}", x),
};

View File

@ -93,6 +93,9 @@ pub enum BufferAccessError {
/// The required EGL extension is not supported by the underlying EGL implementation
#[error("{0}")]
EglExtensionNotSupported(#[from] EglExtensionNotSupportedError),
/// We currently do not support multi-planar buffers
#[error("Multi-planar formats (like {0:?}) are unsupported")]
UnsupportedMultiPlanarFormat(Format),
}
#[cfg(feature = "wayland_frontend")]
@ -105,6 +108,8 @@ impl fmt::Debug for BufferAccessError {
write!(formatter, "BufferAccessError::EGLImageCreationFailed")
}
BufferAccessError::EglExtensionNotSupported(ref err) => write!(formatter, "{:?}", err),
BufferAccessError::UnsupportedMultiPlanarFormat(ref fmt) =>
write!(formatter, "BufferAccessError::UnsupportedMultiPlanerFormat({:?})", fmt),
}
}
}