mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-01-11 01:35:26 +00:00
Add unset_*_flags functions
Implemented for element, object, pad, and pipeline https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/104
This commit is contained in:
parent
6403c06990
commit
1a65c674a9
4 changed files with 40 additions and 0 deletions
|
@ -141,6 +141,8 @@ pub trait ElementExtManual: 'static {
|
|||
|
||||
fn set_element_flags(&self, flags: ElementFlags);
|
||||
|
||||
fn unset_element_flags(&self, flags: ElementFlags);
|
||||
|
||||
fn get_element_flags(&self) -> ElementFlags;
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
|
@ -321,6 +323,14 @@ impl<O: IsA<Element>> ElementExtManual for O {
|
|||
}
|
||||
}
|
||||
|
||||
fn unset_element_flags(&self, flags: ElementFlags) {
|
||||
unsafe {
|
||||
let ptr: *mut gst_sys::GstObject = self.as_ptr() as *mut _;
|
||||
let _guard = ::utils::MutexGuard::lock(&(*ptr).lock);
|
||||
(*ptr).flags &= !flags.to_glib();
|
||||
}
|
||||
}
|
||||
|
||||
fn get_element_flags(&self) -> ElementFlags {
|
||||
unsafe {
|
||||
let ptr: *mut gst_sys::GstObject = self.as_ptr() as *mut _;
|
||||
|
|
|
@ -29,6 +29,8 @@ pub trait GstObjectExtManual: 'static {
|
|||
|
||||
fn set_object_flags(&self, flags: ObjectFlags);
|
||||
|
||||
fn unset_object_flags(&self, flags: ObjectFlags);
|
||||
|
||||
fn get_object_flags(&self) -> ObjectFlags;
|
||||
}
|
||||
|
||||
|
@ -76,6 +78,14 @@ impl<O: IsA<::Object>> GstObjectExtManual for O {
|
|||
}
|
||||
}
|
||||
|
||||
fn unset_object_flags(&self, flags: ObjectFlags) {
|
||||
unsafe {
|
||||
let ptr: *mut gst_sys::GstObject = self.as_ptr() as *mut _;
|
||||
let _guard = ::utils::MutexGuard::lock(&(*ptr).lock);
|
||||
(*ptr).flags &= !flags.to_glib();
|
||||
}
|
||||
}
|
||||
|
||||
fn get_object_flags(&self) -> ObjectFlags {
|
||||
unsafe {
|
||||
let ptr: *mut gst_sys::GstObject = self.as_ptr() as *mut _;
|
||||
|
|
|
@ -270,6 +270,8 @@ pub trait PadExtManual: 'static {
|
|||
|
||||
fn set_bin_flags(&self, flags: BinFlags);
|
||||
|
||||
fn unset_bin_flags(&self, flags: BinFlags);
|
||||
|
||||
fn get_bin_flags(&self) -> BinFlags;
|
||||
}
|
||||
|
||||
|
@ -1009,6 +1011,14 @@ impl<O: IsA<Pad>> PadExtManual for O {
|
|||
}
|
||||
}
|
||||
|
||||
fn unset_bin_flags(&self, flags: BinFlags) {
|
||||
unsafe {
|
||||
let ptr: *mut gst_sys::GstObject = self.as_ptr() as *mut _;
|
||||
let _guard = ::utils::MutexGuard::lock(&(*ptr).lock);
|
||||
(*ptr).flags &= !flags.to_glib();
|
||||
}
|
||||
}
|
||||
|
||||
fn get_bin_flags(&self) -> BinFlags {
|
||||
unsafe {
|
||||
let ptr: *mut gst_sys::GstObject = self.as_ptr() as *mut _;
|
||||
|
|
|
@ -19,6 +19,8 @@ use PipelineFlags;
|
|||
pub trait GstPipelineExtManual: 'static {
|
||||
fn set_pipeline_flags(&self, flags: PipelineFlags);
|
||||
|
||||
fn unset_pipeline_flags(&self, flags: PipelineFlags);
|
||||
|
||||
fn get_pipeline_flags(&self) -> PipelineFlags;
|
||||
}
|
||||
|
||||
|
@ -31,6 +33,14 @@ impl<O: IsA<::Pipeline>> GstPipelineExtManual for O {
|
|||
}
|
||||
}
|
||||
|
||||
fn unset_pipeline_flags(&self, flags: PipelineFlags) {
|
||||
unsafe {
|
||||
let ptr: *mut gst_sys::GstObject = self.as_ptr() as *mut _;
|
||||
let _guard = ::utils::MutexGuard::lock(&(*ptr).lock);
|
||||
(*ptr).flags &= !flags.to_glib();
|
||||
}
|
||||
}
|
||||
|
||||
fn get_pipeline_flags(&self) -> PipelineFlags {
|
||||
unsafe {
|
||||
let ptr: *mut gst_sys::GstObject = self.as_ptr() as *mut _;
|
||||
|
|
Loading…
Reference in a new issue