diff --git a/Gir_Gst.toml b/Gir_Gst.toml index 9b8f11f99..f2fd0ff03 100644 --- a/Gir_Gst.toml +++ b/Gir_Gst.toml @@ -152,6 +152,11 @@ name = "Gst.Query" status = "manual" ref_mode = "ref" +[[object]] +name = "Gst.Context" +status = "manual" +ref_mode = "ref" + [[object]] name = "Gst.DateTime" status = "generate" @@ -233,6 +238,11 @@ status = "generate" # Pass by value ignore = true + [[object.function]] + name = "get_context_unlocked" + # Unsafe + ignore = true + [[object]] name = "Gst.ElementFactory" status = "generate" diff --git a/gstreamer/src/auto/element.rs b/gstreamer/src/auto/element.rs index 56d777325..aaea46ca0 100644 --- a/gstreamer/src/auto/element.rs +++ b/gstreamer/src/auto/element.rs @@ -5,6 +5,7 @@ use Bus; use Caps; use Clock; use ClockTime; +use Context; use ElementFactory; use Error; use Format; @@ -112,11 +113,9 @@ pub trait ElementExt { fn get_compatible_pad_template(&self, compattempl: &PadTemplate) -> Option; - //fn get_context(&self, context_type: &str) -> /*Ignored*/Option; + fn get_context(&self, context_type: &str) -> Option; - //fn get_context_unlocked(&self, context_type: &str) -> /*Ignored*/Option; - - //fn get_contexts(&self) -> /*Ignored*/Vec; + fn get_contexts(&self) -> Vec; fn get_factory(&self) -> Option; @@ -186,7 +185,7 @@ pub trait ElementExt { fn set_clock>(&self, clock: &P) -> Result<(), glib::error::BoolError>; - //fn set_context(&self, context: /*Ignored*/&mut Context); + fn set_context(&self, context: &Context); fn set_locked_state(&self, locked_state: bool) -> bool; @@ -295,17 +294,17 @@ impl + IsA> ElementExt for O { } } - //fn get_context(&self, context_type: &str) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::gst_element_get_context() } - //} + fn get_context(&self, context_type: &str) -> Option { + unsafe { + from_glib_full(ffi::gst_element_get_context(self.to_glib_none().0, context_type.to_glib_none().0)) + } + } - //fn get_context_unlocked(&self, context_type: &str) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::gst_element_get_context_unlocked() } - //} - - //fn get_contexts(&self) -> /*Ignored*/Vec { - // unsafe { TODO: call ffi::gst_element_get_contexts() } - //} + fn get_contexts(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_full(ffi::gst_element_get_contexts(self.to_glib_none().0)) + } + } fn get_factory(&self) -> Option { unsafe { @@ -524,9 +523,11 @@ impl + IsA> ElementExt for O { } } - //fn set_context(&self, context: /*Ignored*/&mut Context) { - // unsafe { TODO: call ffi::gst_element_set_context() } - //} + fn set_context(&self, context: &Context) { + unsafe { + ffi::gst_element_set_context(self.to_glib_none().0, context.to_glib_none().0); + } + } fn set_locked_state(&self, locked_state: bool) -> bool { unsafe {