1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use ffi::*;
use util::*;

pub struct Structure{
    structure: *mut GstStructure,
}

impl Structure{
    pub unsafe fn new_from_gst_structure(structure: *mut GstStructure) -> Option<Structure>{
        if structure!=ptr::null_mut(){
            Some(Structure{
                structure: structure
            })
        }else{
            None
        }
    }

    pub fn name(&self) -> &str{
        unsafe{
            let cname = gst_structure_get_name(self.structure);
            from_c_str!(cname)
        }
    }
}