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