gstreamer_allocators/auto/
flags.rs

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::ffi;
7use glib::{bitflags::bitflags, translate::*};
8
9bitflags! {
10    /// Various flags to control the operation of the fd backed memory.
11    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
12    #[doc(alias = "GstFdMemoryFlags")]
13    pub struct FdMemoryFlags: u32 {
14        /// no flag
15        #[doc(alias = "GST_FD_MEMORY_FLAG_NONE")]
16        const NONE = ffi::GST_FD_MEMORY_FLAG_NONE as _;
17        /// once the memory is mapped,
18        ///  keep it mapped until the memory is destroyed.
19        #[doc(alias = "GST_FD_MEMORY_FLAG_KEEP_MAPPED")]
20        const KEEP_MAPPED = ffi::GST_FD_MEMORY_FLAG_KEEP_MAPPED as _;
21        /// do a private mapping instead of
22        ///  the default shared mapping.
23        #[doc(alias = "GST_FD_MEMORY_FLAG_MAP_PRIVATE")]
24        const MAP_PRIVATE = ffi::GST_FD_MEMORY_FLAG_MAP_PRIVATE as _;
25        /// don't close the file descriptor when
26        ///  the memory is freed. Since: 1.10
27        #[doc(alias = "GST_FD_MEMORY_FLAG_DONT_CLOSE")]
28        const DONT_CLOSE = ffi::GST_FD_MEMORY_FLAG_DONT_CLOSE as _;
29    }
30}
31
32#[doc(hidden)]
33impl IntoGlib for FdMemoryFlags {
34    type GlibType = ffi::GstFdMemoryFlags;
35
36    #[inline]
37    fn into_glib(self) -> ffi::GstFdMemoryFlags {
38        self.bits()
39    }
40}
41
42#[doc(hidden)]
43impl FromGlib<ffi::GstFdMemoryFlags> for FdMemoryFlags {
44    #[inline]
45    unsafe fn from_glib(value: ffi::GstFdMemoryFlags) -> Self {
46        skip_assert_initialized!();
47        Self::from_bits_truncate(value)
48    }
49}