1// Take a look at the license at the top of the repository in the LICENSE file.
23use glib::{prelude::*, translate::*};
45use crate::{ffi, prelude::*, Plugin, PluginFlags, StructureRef};
67impl Plugin {
8/// Gets the plugin specific data cache. If it is [`None`] there is no cached data
9 /// stored. This is the case when the registry is getting rebuilt.
10 ///
11 /// # Returns
12 ///
13 /// The cached data as a
14 /// [`Structure`][crate::Structure] or [`None`].
15#[doc(alias = "get_cache_data")]
16 #[doc(alias = "gst_plugin_get_cache_data")]
17pub fn cache_data(&self) -> Option<&StructureRef> {
18unsafe {
19let cache_data = ffi::gst_plugin_get_cache_data(self.to_glib_none().0);
20if cache_data.is_null() {
21None
22} else {
23Some(StructureRef::from_glib_borrow(cache_data))
24 }
25 }
26 }
2728#[doc(alias = "get_plugin_flags")]
29pub fn plugin_flags(&self) -> PluginFlags {
30unsafe {
31let ptr: *mut ffi::GstObject = self.as_ptr() as *mut _;
32let _guard = self.object_lock();
33 from_glib((*ptr).flags)
34 }
35 }
36}