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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
use nutype_enum::{bitwise_enum, nutype_enum};
use crate::ffi::*;
const _: () = {
assert!(std::mem::size_of::<AVDictionaryFlags>() == std::mem::size_of_val(&AV_DICT_MATCH_CASE));
};
nutype_enum! {
/// Dictionary flags used in FFmpeg's AVDictionary API.
///
/// See FFmpeg's `AVDictionary` in the official documentation:
/// <https://ffmpeg.org/doxygen/trunk/group__lavu__dict.html>
pub enum AVDictionaryFlags(i32) {
/// Match keys case-sensitively.
/// Corresponds to `AV_DICT_MATCH_CASE`.
MatchCase = AV_DICT_MATCH_CASE as _,
/// Do not differentiate keys with different suffixes.
/// Corresponds to `AV_DICT_IGNORE_SUFFIX`.
IgnoreSuffix = AV_DICT_IGNORE_SUFFIX as _,
/// Do not duplicate the key string.
/// Corresponds to `AV_DICT_DONT_STRDUP_KEY`.
DontStrDupKey = AV_DICT_DONT_STRDUP_KEY as _,
/// Do not duplicate the value string.
/// Corresponds to `AV_DICT_DONT_STRDUP_VAL`.
DontStrDupVal = AV_DICT_DONT_STRDUP_VAL as _,
/// Do not overwrite existing entries.
/// Corresponds to `AV_DICT_DONT_OVERWRITE`.
DontOverwrite = AV_DICT_DONT_OVERWRITE as _,
/// Append the new value to an existing key instead of replacing it.
/// Corresponds to `AV_DICT_APPEND`.
Append = AV_DICT_APPEND as _,
/// Allow multiple entries with the same key.
/// Corresponds to `AV_DICT_MULTIKEY`.
MultiKey = AV_DICT_MULTIKEY as _,
}
}
bitwise_enum!(AVDictionaryFlags);
impl PartialEq<i32> for AVDictionaryFlags {
fn eq(&self, other: &i32) -> bool {
self.0 == *other
}
}
impl From<u32> for AVDictionaryFlags {
fn from(value: u32) -> Self {
AVDictionaryFlags(value as _)
}
}
impl From<AVDictionaryFlags> for u32 {
fn from(value: AVDictionaryFlags) -> Self {
value.0 as u32
}
}