Add Sample::get_info() and deprecate get_structure()

For consistency with the C API naming.
This commit is contained in:
Sebastian Dröge 2017-12-30 12:03:03 +02:00
parent 4a9cb50670
commit 65468c1fc8

View file

@ -83,7 +83,7 @@ impl SampleRef {
unsafe { from_glib_none(ffi::gst_sample_get_segment(self.as_mut_ptr())) } unsafe { from_glib_none(ffi::gst_sample_get_segment(self.as_mut_ptr())) }
} }
pub fn get_structure(&self) -> Option<&StructureRef> { pub fn get_info(&self) -> Option<&StructureRef> {
unsafe { unsafe {
let ptr = ffi::gst_sample_get_info(self.as_mut_ptr()); let ptr = ffi::gst_sample_get_info(self.as_mut_ptr());
if ptr.is_null() { if ptr.is_null() {
@ -93,6 +93,11 @@ impl SampleRef {
} }
} }
} }
#[deprecated(since = "0.10.1", note = "please use `get_info` instead")]
pub fn get_structure(&self) -> Option<&StructureRef> {
self.get_info()
}
} }
impl StaticType for SampleRef { impl StaticType for SampleRef {