From 7cc57f4164533c1c9a04fb0f708dde0934abc16f Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 3 Dec 2020 11:37:19 +0100 Subject: [PATCH] video: implement Eq and PartialEq on VideoAlignment --- gstreamer-video/src/video_buffer_pool.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gstreamer-video/src/video_buffer_pool.rs b/gstreamer-video/src/video_buffer_pool.rs index e3a1e5754..bdf49b898 100644 --- a/gstreamer-video/src/video_buffer_pool.rs +++ b/gstreamer-video/src/video_buffer_pool.rs @@ -82,6 +82,18 @@ impl VideoAlignment { } } +impl PartialEq for VideoAlignment { + fn eq(&self, other: &VideoAlignment) -> bool { + self.get_padding_top() == other.get_padding_top() + && self.get_padding_bottom() == other.get_padding_bottom() + && self.get_padding_left() == other.get_padding_left() + && self.get_padding_right() == other.get_padding_right() + && self.get_stride_align() == other.get_stride_align() + } +} + +impl Eq for VideoAlignment {} + pub trait VideoBufferPoolConfig { fn get_video_alignment(&self) -> Option;