2020-12-15 10:53:31 +00:00
|
|
|
// Take a look at the license at the top of the repository in the LICENSE file.
|
2019-06-04 09:34:50 +00:00
|
|
|
|
2020-11-21 13:46:48 +00:00
|
|
|
use crate::PluginFeature;
|
|
|
|
use crate::Rank;
|
2019-06-04 09:34:50 +00:00
|
|
|
|
|
|
|
use glib::object::IsA;
|
|
|
|
use glib::translate::{from_glib, ToGlib, ToGlibPtr};
|
|
|
|
|
|
|
|
pub trait PluginFeatureExtManual: 'static {
|
|
|
|
fn get_rank(&self) -> Rank;
|
|
|
|
fn set_rank(&self, rank: Rank);
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<O: IsA<PluginFeature>> PluginFeatureExtManual for O {
|
|
|
|
fn get_rank(&self) -> Rank {
|
|
|
|
unsafe {
|
2020-11-21 13:46:48 +00:00
|
|
|
let rank = ffi::gst_plugin_feature_get_rank(self.as_ref().to_glib_none().0);
|
2019-06-04 09:34:50 +00:00
|
|
|
from_glib(rank as i32)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_rank(&self, rank: Rank) {
|
|
|
|
unsafe {
|
2020-11-21 13:46:48 +00:00
|
|
|
ffi::gst_plugin_feature_set_rank(self.as_ref().to_glib_none().0, rank.to_glib() as u32);
|
2019-06-04 09:34:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|