scuffle_ffmpeg/enums/
av_dict_flags.rs

1use nutype_enum::{bitwise_enum, nutype_enum};
2
3use crate::ffi::*;
4
5const _: () = {
6    assert!(std::mem::size_of::<AVDictionaryFlags>() == std::mem::size_of_val(&AV_DICT_MATCH_CASE));
7};
8
9nutype_enum! {
10    /// Dictionary flags used in FFmpeg's AVDictionary API.
11    ///
12    /// See FFmpeg's `AVDictionary` in the official documentation:
13    /// <https://ffmpeg.org/doxygen/trunk/group__lavu__dict.html>
14    pub enum AVDictionaryFlags(i32) {
15        /// Match keys case-sensitively.
16        /// Corresponds to `AV_DICT_MATCH_CASE`.
17        MatchCase = AV_DICT_MATCH_CASE as _,
18
19        /// Do not differentiate keys with different suffixes.
20        /// Corresponds to `AV_DICT_IGNORE_SUFFIX`.
21        IgnoreSuffix = AV_DICT_IGNORE_SUFFIX as _,
22
23        /// Do not duplicate the key string.
24        /// Corresponds to `AV_DICT_DONT_STRDUP_KEY`.
25        DontStrDupKey = AV_DICT_DONT_STRDUP_KEY as _,
26
27        /// Do not duplicate the value string.
28        /// Corresponds to `AV_DICT_DONT_STRDUP_VAL`.
29        DontStrDupVal = AV_DICT_DONT_STRDUP_VAL as _,
30
31        /// Do not overwrite existing entries.
32        /// Corresponds to `AV_DICT_DONT_OVERWRITE`.
33        DontOverwrite = AV_DICT_DONT_OVERWRITE as _,
34
35        /// Append the new value to an existing key instead of replacing it.
36        /// Corresponds to `AV_DICT_APPEND`.
37        Append = AV_DICT_APPEND as _,
38
39        /// Allow multiple entries with the same key.
40        /// Corresponds to `AV_DICT_MULTIKEY`.
41        MultiKey = AV_DICT_MULTIKEY as _,
42    }
43}
44
45bitwise_enum!(AVDictionaryFlags);
46
47impl PartialEq<i32> for AVDictionaryFlags {
48    fn eq(&self, other: &i32) -> bool {
49        self.0 == *other
50    }
51}
52
53impl From<u32> for AVDictionaryFlags {
54    fn from(value: u32) -> Self {
55        AVDictionaryFlags(value as _)
56    }
57}
58
59impl From<AVDictionaryFlags> for u32 {
60    fn from(value: AVDictionaryFlags) -> Self {
61        value.0 as u32
62    }
63}