|
49 | 49 | //! ``` |
50 | 50 |
|
51 | 51 | use crate::error::NativeErrorExt; |
52 | | -use crate::formats::yuv2rgb::write_rgb8_f32x8_par; |
53 | | -// use crate::formats::yuv2rgb::{write_rgb8_f32x8, write_rgb8_f32x8_par, write_rgb8_scalar, write_rgb8_scalar_par}; |
54 | | -use crate::formats::YUVSource; |
55 | 52 | use crate::formats::yuv2rgb::{write_rgb8_f32x8, write_rgb8_scalar, write_rgba8_f32x8, write_rgba8_scalar}; |
| 53 | +// use crate::formats::yuv2rgb::{write_rgb8_f32x8, write_rgb8_f32x8_par, write_rgb8_scalar, write_rgb8_scalar_par}; |
| 54 | +use crate::formats::{YUVSlices, YUVSource}; |
56 | 55 | use crate::{Error, OpenH264API, Timestamp}; |
57 | 56 | use openh264_sys2::{ |
58 | 57 | API, DECODER_OPTION, DECODER_OPTION_ERROR_CON_IDC, DECODER_OPTION_NUM_OF_FRAMES_REMAINING_IN_BUFFER, |
@@ -523,7 +522,7 @@ impl DecodedYUV<'_> { |
523 | 522 | /// Cut the YUV buffer into vertical sections. |
524 | 523 | /// |
525 | 524 | /// The slices do not overlap. If N does not divide the buffer, then the last YUVSlice has fewer pixel rows. |
526 | | - pub fn split<const N: usize>(&self) -> [YUVSlices; N] { |
| 525 | + pub fn split<const N: usize>(&'_ self) -> [YUVSlices<'_>; N] { |
527 | 526 | if N == 1 { |
528 | 527 | return [YUVSlices::new((self.y, self.u, self.v), self.dimensions(), self.strides()); N]; |
529 | 528 | } |
@@ -653,8 +652,8 @@ mod test { |
653 | 652 | use openh264_sys2::SSysMEMBuffer; |
654 | 653 |
|
655 | 654 | use crate::{ |
656 | | - formats::{YUVSlices, YUVSource}, |
657 | 655 | Timestamp, |
| 656 | + formats::{YUVSlices, YUVSource}, |
658 | 657 | }; |
659 | 658 |
|
660 | 659 | use super::DecodedYUV; |
@@ -727,11 +726,11 @@ mod test { |
727 | 726 | v_plane.extend_from_slice(slice.v()); |
728 | 727 | } |
729 | 728 |
|
730 | | - assert_eq!(buf.y.len(), y_plane.len()); |
731 | | - assert_eq!(buf.y, y_plane); |
732 | | - assert_eq!(buf.u.len(), u_plane.len()); |
733 | | - assert_eq!(buf.u, u_plane); |
734 | | - assert_eq!(buf.v.len(), v_plane.len()); |
735 | | - assert_eq!(buf.v, v_plane); |
| 729 | + assert_eq!(buf.y().len(), y_plane.len()); |
| 730 | + assert_eq!(buf.y(), y_plane); |
| 731 | + assert_eq!(buf.u().len(), u_plane.len()); |
| 732 | + assert_eq!(buf.u(), u_plane); |
| 733 | + assert_eq!(buf.v().len(), v_plane.len()); |
| 734 | + assert_eq!(buf.v(), v_plane); |
736 | 735 | } |
737 | 736 | } |
0 commit comments