mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-26 03:21:03 +00:00
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 {
|
||||
pub fn get_structure(&self) -> &StructureRef {
|
||||
pub fn get_structure(&self) -> Option<&StructureRef> {
|
||||
unsafe {
|
||||
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