mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-28 20:41:31 +00:00
analytics: Remove unnecessarily mutable references
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1574>
This commit is contained in:
parent
370737fa1a
commit
a538e20581
4 changed files with 16 additions and 16 deletions
|
@ -95,8 +95,8 @@ impl<'a> AnalyticsMtdRef<'a, AnalyticsClassificationMtd> {
|
|||
#[doc(alias = "gst_analytics_cls_mtd_get_length")]
|
||||
pub fn len(&self) -> usize {
|
||||
unsafe {
|
||||
let mut mtd = from(ffi::GstAnalyticsMtd::unsafe_from(self));
|
||||
ffi::gst_analytics_cls_mtd_get_length(&mut mtd)
|
||||
let mtd = from(ffi::GstAnalyticsMtd::unsafe_from(self));
|
||||
ffi::gst_analytics_cls_mtd_get_length(&mtd)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -109,8 +109,8 @@ impl<'a> AnalyticsMtdRef<'a, AnalyticsClassificationMtd> {
|
|||
assert!(index < self.len());
|
||||
|
||||
unsafe {
|
||||
let mut mtd = from(ffi::GstAnalyticsMtd::unsafe_from(self));
|
||||
ffi::gst_analytics_cls_mtd_get_level(&mut mtd, index)
|
||||
let mtd = from(ffi::GstAnalyticsMtd::unsafe_from(self));
|
||||
ffi::gst_analytics_cls_mtd_get_level(&mtd, index)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,8 +119,8 @@ impl<'a> AnalyticsMtdRef<'a, AnalyticsClassificationMtd> {
|
|||
assert!(index < self.len());
|
||||
|
||||
unsafe {
|
||||
let mut mtd = from(ffi::GstAnalyticsMtd::unsafe_from(self));
|
||||
from_glib(ffi::gst_analytics_cls_mtd_get_quark(&mut mtd, index))
|
||||
let mtd = from(ffi::GstAnalyticsMtd::unsafe_from(self));
|
||||
from_glib(ffi::gst_analytics_cls_mtd_get_quark(&mtd, index))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -84,8 +84,8 @@ impl<'a> AnalyticsMtdRef<'a, AnalyticsODMtd> {
|
|||
#[doc(alias = "gst_analytics_od_mtd_get_obj_type")]
|
||||
pub fn obj_type(&self) -> Option<glib::Quark> {
|
||||
unsafe {
|
||||
let mut mtd = from(ffi::GstAnalyticsMtd::unsafe_from(self));
|
||||
let type_ = ffi::gst_analytics_od_mtd_get_obj_type(&mut mtd);
|
||||
let mtd = from(ffi::GstAnalyticsMtd::unsafe_from(self));
|
||||
let type_ = ffi::gst_analytics_od_mtd_get_obj_type(&mtd);
|
||||
if type_ == 0 {
|
||||
None
|
||||
} else {
|
||||
|
@ -99,9 +99,9 @@ impl<'a> AnalyticsMtdRef<'a, AnalyticsODMtd> {
|
|||
let mut loc = AnalyticsODLocation::default();
|
||||
|
||||
let success = unsafe {
|
||||
let mut mtd = from(ffi::GstAnalyticsMtd::unsafe_from(self));
|
||||
let mtd = from(ffi::GstAnalyticsMtd::unsafe_from(self));
|
||||
ffi::gst_analytics_od_mtd_get_location(
|
||||
&mut mtd,
|
||||
&mtd,
|
||||
&mut loc.x,
|
||||
&mut loc.y,
|
||||
&mut loc.w,
|
||||
|
@ -120,9 +120,9 @@ impl<'a> AnalyticsMtdRef<'a, AnalyticsODMtd> {
|
|||
#[doc(alias = "gst_analytics_od_mtd_get_confidence_lvl")]
|
||||
pub fn confidence_level(&self) -> f32 {
|
||||
unsafe {
|
||||
let mut mtd = from(ffi::GstAnalyticsMtd::unsafe_from(self));
|
||||
let mtd = from(ffi::GstAnalyticsMtd::unsafe_from(self));
|
||||
let mut lvl: f32 = 0.0;
|
||||
ffi::gst_analytics_od_mtd_get_confidence_lvl(&mut mtd, &mut lvl);
|
||||
ffi::gst_analytics_od_mtd_get_confidence_lvl(&mtd, &mut lvl);
|
||||
lvl
|
||||
}
|
||||
}
|
||||
|
|
|
@ -282,8 +282,8 @@ impl<'a, T: AnalyticsMtd> AnalyticsMtdRef<'a, T> {
|
|||
#[doc(alias = "gst_analytics_mtd_get_mtd_type")]
|
||||
pub fn mtd_type(&self) -> ffi::GstAnalyticsMtdType {
|
||||
unsafe {
|
||||
let mut mtd = ffi::GstAnalyticsMtd::unsafe_from(self);
|
||||
ffi::gst_analytics_mtd_get_mtd_type(&mut mtd)
|
||||
let mtd = ffi::GstAnalyticsMtd::unsafe_from(self);
|
||||
ffi::gst_analytics_mtd_get_mtd_type(&mtd)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,9 +68,9 @@ impl<'a> AnalyticsMtdRef<'a, AnalyticsTrackingMtd> {
|
|||
let mut tracking_lost: i32 = 0;
|
||||
|
||||
unsafe {
|
||||
let mut mtd = from(ffi::GstAnalyticsMtd::unsafe_from(self));
|
||||
let mtd = from(ffi::GstAnalyticsMtd::unsafe_from(self));
|
||||
ffi::gst_analytics_tracking_mtd_get_info(
|
||||
&mut mtd,
|
||||
&mtd,
|
||||
&mut tracking_id,
|
||||
&mut tracking_first_seen,
|
||||
&mut tracking_last_seen,
|
||||
|
|
Loading…
Reference in a new issue