forked from mirrors/gstreamer-rs
Query::get_structure() can also return NULL
This commit is contained in:
parent
1f80df493a
commit
963557b79f
1 changed files with 6 additions and 2 deletions
|
@ -120,10 +120,14 @@ impl GstRc<QueryRef> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl QueryRef {
|
impl QueryRef {
|
||||||
pub fn get_structure(&self) -> &StructureRef {
|
pub fn get_structure(&self) -> Option<&StructureRef> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let structure = ffi::gst_query_get_structure(self.as_mut_ptr());
|
let structure = ffi::gst_query_get_structure(self.as_mut_ptr());
|
||||||
StructureRef::from_glib_borrow(structure)
|
if structure.is_null() {
|
||||||
|
None
|
||||||
|
} else {
|
||||||
|
Some(StructureRef::from_glib_borrow(structure))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue