fix: workaround physical display rotation (#9696)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2024-10-19 10:57:42 +08:00
committed by GitHub
parent 675ffe0381
commit 8c8a643cce
3 changed files with 21 additions and 6 deletions

View File

@@ -156,7 +156,7 @@ pub trait TraitPixelBuffer {
#[cfg(not(any(target_os = "ios")))]
pub enum Frame<'a> {
PixelBuffer(PixelBuffer<'a>),
Texture(*mut c_void),
Texture((*mut c_void, usize)),
}
#[cfg(not(any(target_os = "ios")))]
@@ -164,7 +164,7 @@ impl Frame<'_> {
pub fn valid<'a>(&'a self) -> bool {
match self {
Frame::PixelBuffer(pixelbuffer) => !pixelbuffer.data().is_empty(),
Frame::Texture(texture) => !texture.is_null(),
Frame::Texture((texture, _)) => !texture.is_null(),
}
}
@@ -186,7 +186,7 @@ impl Frame<'_> {
pub enum EncodeInput<'a> {
YUV(&'a [u8]),
Texture(*mut c_void),
Texture((*mut c_void, usize)),
}
impl<'a> EncodeInput<'a> {
@@ -197,7 +197,7 @@ impl<'a> EncodeInput<'a> {
}
}
pub fn texture(&self) -> ResultType<*mut c_void> {
pub fn texture(&self) -> ResultType<(*mut c_void, usize)> {
match self {
Self::Texture(f) => Ok(*f),
_ => bail!("not texture frame"),