// Copyright (c) 2019 Vivia Nikolaidou // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use glib; use glib::object::{Cast, ObjectExt}; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::IsA; use gobject_sys; use PipelineFlags; pub trait GstPipelineExtManual: 'static { fn set_pipeline_flags(&self, flags: PipelineFlags); fn get_pipeline_flags(&self) -> PipelineFlags; } impl> GstPipelineExtManual for O { fn set_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 _; let _guard = ::utils::MutexGuard::lock(&(*ptr).lock); from_glib((*ptr).flags) } } }