2017-07-29 13:37:06 +00:00
|
|
|
// This file was generated by gir (a01311c+) from gir-files (???)
|
|
|
|
// DO NOT EDIT
|
|
|
|
|
|
|
|
use ffi;
|
|
|
|
use glib::translate::*;
|
|
|
|
use glib_ffi;
|
|
|
|
use gobject_ffi;
|
|
|
|
use std::mem;
|
|
|
|
use std::ptr;
|
|
|
|
use glib::Value;
|
|
|
|
use IteratorResult;
|
|
|
|
|
|
|
|
glib_wrapper! {
|
|
|
|
pub struct Iterator(Boxed<ffi::GstIterator>);
|
|
|
|
|
|
|
|
match fn {
|
|
|
|
copy => |ptr| ffi::gst_iterator_copy(mut_override(ptr)),
|
|
|
|
free => |ptr| ffi::gst_iterator_free(ptr),
|
|
|
|
get_type => || ffi::gst_iterator_get_type(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Iterator {
|
2017-09-10 11:54:43 +00:00
|
|
|
#[cfg_attr(feature = "cargo-clippy", allow(should_implement_trait))]
|
2017-07-29 13:37:06 +00:00
|
|
|
pub fn next(&mut self) -> Result<Value, IteratorResult> {
|
|
|
|
unsafe {
|
|
|
|
let mut value = Value::uninitialized();
|
2017-07-31 11:16:42 +00:00
|
|
|
let res = from_glib(ffi::gst_iterator_next(
|
|
|
|
self.to_glib_none_mut().0,
|
|
|
|
value.to_glib_none_mut().0,
|
|
|
|
));
|
2017-07-29 13:37:06 +00:00
|
|
|
if res == IteratorResult::Ok {
|
|
|
|
Ok(value)
|
|
|
|
} else {
|
|
|
|
Err(res)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn resync(&mut self) {
|
|
|
|
unsafe {
|
|
|
|
ffi::gst_iterator_resync(self.to_glib_none_mut().0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl Send for Iterator {}
|