Commit 06d65476 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Implement glib::SendUnique on Adapter

It can be safely sent between threads as long as all references are in
the same thread.
parent fbe6d5ce
...@@ -39,7 +39,7 @@ manual = [ ...@@ -39,7 +39,7 @@ manual = [
name = "GstBase.Adapter" name = "GstBase.Adapter"
status = "generate" status = "generate"
trait = false trait = false
concurrency = "none" concurrency = "send-unique"
[[object.function]] [[object.function]]
name = "map" name = "map"
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
use ffi; use ffi;
use glib; use glib;
use glib::ObjectExt;
use glib::translate::*; use glib::translate::*;
use glib_ffi; use glib_ffi;
use gobject_ffi; use gobject_ffi;
...@@ -193,3 +194,9 @@ impl Default for Adapter { ...@@ -193,3 +194,9 @@ impl Default for Adapter {
Self::new() Self::new()
} }
} }
unsafe impl glib::SendUnique for Adapter {
fn is_unique(&self) -> bool {
self.ref_count() == 1
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment