2020-12-15 10:53:31 +00:00
|
|
|
// Take a look at the license at the top of the repository in the LICENSE file.
|
2017-12-17 12:26:17 +00:00
|
|
|
|
2023-01-03 18:58:25 +00:00
|
|
|
use glib::{prelude::*, translate::*};
|
2017-12-17 12:26:17 +00:00
|
|
|
|
2023-02-06 08:49:34 +00:00
|
|
|
use crate::{prelude::*, Plugin, PluginFlags, StructureRef};
|
2017-12-17 12:26:17 +00:00
|
|
|
|
|
|
|
impl Plugin {
|
2021-05-02 09:41:18 +00:00
|
|
|
#[doc(alias = "get_cache_data")]
|
2021-05-19 20:35:47 +00:00
|
|
|
#[doc(alias = "gst_plugin_get_cache_data")]
|
2021-04-11 19:39:50 +00:00
|
|
|
pub fn cache_data(&self) -> Option<&StructureRef> {
|
2017-12-17 12:26:17 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:48 +00:00
|
|
|
let cache_data = ffi::gst_plugin_get_cache_data(self.to_glib_none().0);
|
2017-12-17 12:26:17 +00:00
|
|
|
if cache_data.is_null() {
|
|
|
|
None
|
|
|
|
} else {
|
|
|
|
Some(StructureRef::from_glib_borrow(cache_data))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-05-11 10:13:33 +00:00
|
|
|
|
2021-05-02 09:41:18 +00:00
|
|
|
#[doc(alias = "get_plugin_flags")]
|
2023-01-03 22:07:17 +00:00
|
|
|
pub fn plugin_flags(&self) -> PluginFlags {
|
2019-05-11 10:13:33 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:48 +00:00
|
|
|
let ptr: *mut ffi::GstObject = self.as_ptr() as *mut _;
|
2023-02-06 08:49:34 +00:00
|
|
|
let _guard = self.object_lock();
|
2019-05-11 10:13:33 +00:00
|
|
|
from_glib((*ptr).flags)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|