1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT

use crate::ffi;
use glib::{bitflags::bitflags, translate::*};

bitflags! {
    /// Various flags to control the operation of the fd backed memory.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "GstFdMemoryFlags")]
    pub struct FdMemoryFlags: u32 {
        /// no flag
        #[doc(alias = "GST_FD_MEMORY_FLAG_NONE")]
        const NONE = ffi::GST_FD_MEMORY_FLAG_NONE as _;
        /// once the memory is mapped,
        ///  keep it mapped until the memory is destroyed.
        #[doc(alias = "GST_FD_MEMORY_FLAG_KEEP_MAPPED")]
        const KEEP_MAPPED = ffi::GST_FD_MEMORY_FLAG_KEEP_MAPPED as _;
        /// do a private mapping instead of
        ///  the default shared mapping.
        #[doc(alias = "GST_FD_MEMORY_FLAG_MAP_PRIVATE")]
        const MAP_PRIVATE = ffi::GST_FD_MEMORY_FLAG_MAP_PRIVATE as _;
        /// don't close the file descriptor when
        ///  the memory is freed. Since: 1.10
        #[doc(alias = "GST_FD_MEMORY_FLAG_DONT_CLOSE")]
        const DONT_CLOSE = ffi::GST_FD_MEMORY_FLAG_DONT_CLOSE as _;
    }
}

#[doc(hidden)]
impl IntoGlib for FdMemoryFlags {
    type GlibType = ffi::GstFdMemoryFlags;

    #[inline]
    fn into_glib(self) -> ffi::GstFdMemoryFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstFdMemoryFlags> for FdMemoryFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::GstFdMemoryFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}