mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-23 08:36:31 +00:00
Implement glib::SendUnique on Adapter
It can be safely sent between threads as long as all references are in the same thread.
This commit is contained in:
parent
fbe6d5ce38
commit
06d654760d
2 changed files with 8 additions and 1 deletions
|
@ -39,7 +39,7 @@ manual = [
|
|||
name = "GstBase.Adapter"
|
||||
status = "generate"
|
||||
trait = false
|
||||
concurrency = "none"
|
||||
concurrency = "send-unique"
|
||||
|
||||
[[object.function]]
|
||||
name = "map"
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::ObjectExt;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
|
@ -193,3 +194,9 @@ impl Default for Adapter {
|
|||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl glib::SendUnique for Adapter {
|
||||
fn is_unique(&self) -> bool {
|
||||
self.ref_count() == 1
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue