video: Rename VideoOverlayComposition iterator struct

This commit is contained in:
Sebastian Dröge 2021-10-17 11:24:33 +03:00
parent e989899467
commit 7037f6d836
2 changed files with 12 additions and 9 deletions

View file

@ -61,8 +61,11 @@ mod functions;
pub use crate::functions::*;
mod video_rectangle;
pub use crate::video_rectangle::*;
mod video_overlay_composition;
pub use crate::video_overlay_composition::*;
pub mod video_overlay_composition;
pub use crate::video_overlay_composition::{
VideoOverlayComposition, VideoOverlayCompositionRef, VideoOverlayRectangle,
VideoOverlayRectangleRef,
};
pub mod video_meta;
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]

View file

@ -288,8 +288,8 @@ impl VideoOverlayCompositionRef {
}
}
pub fn iter(&self) -> VideoOverlayCompositionIterator {
VideoOverlayCompositionIterator {
pub fn iter(&self) -> Iter {
Iter {
composition: self,
idx: 0,
len: self.n_rectangles(),
@ -298,7 +298,7 @@ impl VideoOverlayCompositionRef {
}
impl<'a> IntoIterator for &'a VideoOverlayComposition {
type IntoIter = VideoOverlayCompositionIterator<'a>;
type IntoIter = Iter<'a>;
type Item = VideoOverlayRectangle;
fn into_iter(self) -> Self::IntoIter {
@ -306,13 +306,13 @@ impl<'a> IntoIterator for &'a VideoOverlayComposition {
}
}
pub struct VideoOverlayCompositionIterator<'a> {
pub struct Iter<'a> {
composition: &'a VideoOverlayCompositionRef,
idx: u32,
len: u32,
}
impl<'a> Iterator for VideoOverlayCompositionIterator<'a> {
impl<'a> Iterator for Iter<'a> {
type Item = VideoOverlayRectangle;
fn next(&mut self) -> Option<Self::Item> {
@ -337,7 +337,7 @@ impl<'a> Iterator for VideoOverlayCompositionIterator<'a> {
}
}
impl<'a> DoubleEndedIterator for VideoOverlayCompositionIterator<'a> {
impl<'a> DoubleEndedIterator for Iter<'a> {
fn next_back(&mut self) -> Option<Self::Item> {
if self.idx == self.len {
return None;
@ -351,4 +351,4 @@ impl<'a> DoubleEndedIterator for VideoOverlayCompositionIterator<'a> {
}
}
impl<'a> ExactSizeIterator for VideoOverlayCompositionIterator<'a> {}
impl<'a> ExactSizeIterator for Iter<'a> {}