mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-24 09:00:32 +00:00
Tags: use SendValue
for generic getters and iterator
This commit is contained in:
parent
be9ef0d152
commit
0b9edee8d7
1 changed files with 6 additions and 6 deletions
|
@ -14,7 +14,7 @@ use std::mem;
|
||||||
use ffi;
|
use ffi;
|
||||||
use glib;
|
use glib;
|
||||||
use glib::translate::{from_glib, from_glib_full, ToGlib, ToGlibPtr, ToGlibPtrMut};
|
use glib::translate::{from_glib, from_glib_full, ToGlib, ToGlibPtr, ToGlibPtrMut};
|
||||||
use glib::value::{FromValueOptional, SetValue, ToSendValue, TypedValue, Value};
|
use glib::value::{FromValueOptional, SendValue, SetValue, ToSendValue, TypedValue, Value};
|
||||||
use glib::StaticType;
|
use glib::StaticType;
|
||||||
|
|
||||||
use miniobject::*;
|
use miniobject::*;
|
||||||
|
@ -237,9 +237,9 @@ impl TagListRef {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_generic(&self, tag_name: &str) -> Option<Value> {
|
pub fn get_generic(&self, tag_name: &str) -> Option<SendValue> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut value: Value = mem::zeroed();
|
let mut value: SendValue = mem::zeroed();
|
||||||
|
|
||||||
let found: bool = from_glib(ffi::gst_tag_list_copy_value(
|
let found: bool = from_glib(ffi::gst_tag_list_copy_value(
|
||||||
value.to_glib_none_mut().0,
|
value.to_glib_none_mut().0,
|
||||||
|
@ -279,7 +279,7 @@ impl TagListRef {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_index_generic<'a>(&'a self, tag_name: &str, idx: u32) -> Option<&'a Value> {
|
pub fn get_index_generic<'a>(&'a self, tag_name: &str, idx: u32) -> Option<&'a SendValue> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let value = ffi::gst_tag_list_get_value_index(
|
let value = ffi::gst_tag_list_get_value_index(
|
||||||
self.as_ptr(),
|
self.as_ptr(),
|
||||||
|
@ -291,7 +291,7 @@ impl TagListRef {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
Some(&*(value as *const Value))
|
Some(&*(value as *const SendValue))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -461,7 +461,7 @@ impl<'a> GenericTagIterator<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Iterator for GenericTagIterator<'a> {
|
impl<'a> Iterator for GenericTagIterator<'a> {
|
||||||
type Item = &'a Value;
|
type Item = &'a SendValue;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
if self.idx >= self.size {
|
if self.idx >= self.size {
|
||||||
|
|
Loading…
Reference in a new issue