From 007f80ca32ec3c45dfb4b6d9dde7e14ee8c22ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 16 Jul 2019 11:44:40 +0300 Subject: [PATCH] buffer: Allow setting/unsetting buffer flags As there are extension flags types, we need separate setter/unsetter functions for the flags, or otherwise we would always clear the extension flags types (e.g. GstVideoBufferFlags). --- gstreamer/src/buffer.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gstreamer/src/buffer.rs b/gstreamer/src/buffer.rs index 7e3d49dc5..325166422 100644 --- a/gstreamer/src/buffer.rs +++ b/gstreamer/src/buffer.rs @@ -381,7 +381,11 @@ impl BufferRef { } pub fn set_flags(&mut self, flags: BufferFlags) { - self.0.mini_object.flags = flags.bits(); + self.0.mini_object.flags |= flags.bits(); + } + + pub fn unset_flags(&mut self, flags: BufferFlags) { + self.0.mini_object.flags &= !flags.bits(); } pub fn get_meta(&self) -> Option> {