mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-11 19:55:25 +00:00
Return stream IDs directly instead of creating an owned String
This commit is contained in:
parent
7a33a4177f
commit
1ee7c8b9e3
1 changed files with 2 additions and 4 deletions
|
@ -95,7 +95,7 @@ impl Stream {
|
||||||
StreamType::from_bits_truncate(unsafe { gst_stream_get_stream_type(self.0) })
|
StreamType::from_bits_truncate(unsafe { gst_stream_get_stream_type(self.0) })
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_stream_id(&self) -> String {
|
pub fn get_stream_id(&self) -> &str {
|
||||||
extern "C" {
|
extern "C" {
|
||||||
fn gst_stream_get_stream_id(collection: *mut c_void) -> *mut c_char;
|
fn gst_stream_get_stream_id(collection: *mut c_void) -> *mut c_char;
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,6 @@ impl Stream {
|
||||||
CStr::from_ptr(gst_stream_get_stream_id(self.0))
|
CStr::from_ptr(gst_stream_get_stream_id(self.0))
|
||||||
.to_str()
|
.to_str()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.into()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +208,7 @@ impl StreamCollection {
|
||||||
unsafe { gst_stream_collection_get_size(self.0) }
|
unsafe { gst_stream_collection_get_size(self.0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_upstream_id(&self) -> String {
|
pub fn get_upstream_id(&self) -> &str {
|
||||||
extern "C" {
|
extern "C" {
|
||||||
fn gst_stream_collection_get_upstream_id(collection: *mut c_void) -> *mut c_char;
|
fn gst_stream_collection_get_upstream_id(collection: *mut c_void) -> *mut c_char;
|
||||||
}
|
}
|
||||||
|
@ -218,7 +217,6 @@ impl StreamCollection {
|
||||||
CStr::from_ptr(gst_stream_collection_get_upstream_id(self.0))
|
CStr::from_ptr(gst_stream_collection_get_upstream_id(self.0))
|
||||||
.to_str()
|
.to_str()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.into()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue