fix, mac hwcodec decoding align use dst_align (#8215)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2024-05-30 23:40:25 +08:00
committed by GitHub
parent d4dda94e2a
commit 8919ea65e3
7 changed files with 114 additions and 246 deletions

View File

@@ -1052,7 +1052,7 @@ impl VideoHandler {
log::info!("new video handler for display #{_display}, format: {format:?}, luid: {luid:?}");
VideoHandler {
decoder: Decoder::new(format, luid),
rgb: ImageRgb::new(ImageFormat::ARGB, crate::get_dst_stride_rgba()),
rgb: ImageRgb::new(ImageFormat::ARGB, crate::get_dst_align_rgba()),
texture: std::ptr::null_mut(),
recorder: Default::default(),
record: false,
@@ -1105,7 +1105,7 @@ impl VideoHandler {
/// Reset the decoder, change format if it is Some
pub fn reset(&mut self, format: Option<CodecFormat>) {
#[cfg(target_os = "macos")]
self.rgb.set_stride(crate::get_dst_stride_rgba());
self.rgb.set_align(crate::get_dst_align_rgba());
let luid = Self::get_adapter_luid();
let format = format.unwrap_or(self.decoder.format());
self.decoder = Decoder::new(format, luid);