gstreamer: Return any lifetime instead of 'static

Following https://github.com/gtk-rs/glib/pull/633
This commit is contained in:
Jan Alexander Steffens (heftig) 2020-04-30 09:49:06 +02:00
parent f28a92c46c
commit 1d2609d448
No known key found for this signature in database
GPG key ID: DE5E0C5F25941CA5
2 changed files with 4 additions and 4 deletions

View file

@ -443,7 +443,7 @@ impl StructureRef {
} }
} }
pub fn get_name(&self) -> &'static str { pub fn get_name<'a>(&self) -> &'a str {
unsafe { unsafe {
CStr::from_ptr(gst_sys::gst_structure_get_name(&self.0)) CStr::from_ptr(gst_sys::gst_structure_get_name(&self.0))
.to_str() .to_str()
@ -500,7 +500,7 @@ impl StructureRef {
Iter::new(self) Iter::new(self)
} }
pub fn get_nth_field_name(&self, idx: u32) -> Option<&'static str> { pub fn get_nth_field_name<'a>(&self, idx: u32) -> Option<&'a str> {
unsafe { unsafe {
let field_name = gst_sys::gst_structure_nth_field_name(&self.0, idx); let field_name = gst_sys::gst_structure_nth_field_name(&self.0, idx);
if field_name.is_null() { if field_name.is_null() {

View file

@ -798,7 +798,7 @@ pub fn tag_get_type(name: &str) -> glib::Type {
unsafe { from_glib(gst_sys::gst_tag_get_type(name.to_glib_none().0)) } unsafe { from_glib(gst_sys::gst_tag_get_type(name.to_glib_none().0)) }
} }
pub fn tag_get_nick(name: &str) -> Option<&'static str> { pub fn tag_get_nick<'b>(name: &str) -> Option<&'b str> {
skip_assert_initialized!(); skip_assert_initialized!();
unsafe { unsafe {
let ptr = gst_sys::gst_tag_get_nick(name.to_glib_none().0); let ptr = gst_sys::gst_tag_get_nick(name.to_glib_none().0);
@ -811,7 +811,7 @@ pub fn tag_get_nick(name: &str) -> Option<&'static str> {
} }
} }
pub fn tag_get_description(name: &str) -> Option<&'static str> { pub fn tag_get_description<'b>(name: &str) -> Option<&'b str> {
skip_assert_initialized!(); skip_assert_initialized!();
unsafe { unsafe {
let ptr = gst_sys::gst_tag_get_description(name.to_glib_none().0); let ptr = gst_sys::gst_tag_get_description(name.to_glib_none().0);