1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6use crate::Object;
7use glib::{prelude::*, translate::*};
8use std::ptr;
9
10glib::wrapper! {
11 #[doc(alias = "GstTaskPool")]
12 pub struct TaskPool(Object<ffi::GstTaskPool, ffi::GstTaskPoolClass>) @extends Object;
13
14 match fn {
15 type_ => || ffi::gst_task_pool_get_type(),
16 }
17}
18
19impl TaskPool {
20 pub const NONE: Option<&'static TaskPool> = None;
21
22 #[doc(alias = "gst_task_pool_new")]
23 pub fn new() -> TaskPool {
24 assert_initialized_main_thread!();
25 unsafe { from_glib_full(ptr:ffi::gst_task_pool_new()) }
26 }
27}
28
29impl Default for TaskPool {
30 fn default() -> Self {
31 Self::new()
32 }
33}
34
35unsafe impl Send for TaskPool {}
36unsafe impl Sync for TaskPool {}
37
38mod sealed {
39 pub trait Sealed {}
40 impl<T: super::IsA<super::TaskPool>> Sealed for T {}
41}
42
43pub trait TaskPoolExt: IsA<TaskPool> + sealed::Sealed + 'static {
44 #[doc(alias = "gst_task_pool_cleanup")]
45 fn cleanup(&self) {
46 unsafe {
47 ffi::gst_task_pool_cleanup(self.as_ref().to_glib_none().0);
48 }
49 }
50
51 #[doc(alias = "gst_task_pool_prepare")]
52 fn prepare(&self) -> Result<(), glib::Error> {
53 unsafe {
54 let mut error: *mut GError = ptr::null_mut();
55 let _ = ffi::gst_task_pool_prepare(self.as_ref().to_glib_none().0, &mut error);
56 if error.is_null() {
57 Ok(())
58 } else {
59 Err(from_glib_full(ptr:error))
60 }
61 }
62 }
63}
64
65impl<O: IsA<TaskPool>> TaskPoolExt for O {}
66