mux_media/types/
codec_id.rs1use crate::ffmpeg::codec::id::Id;
2
3#[derive(Copy, Clone, Debug)]
5pub struct CodecId(pub Id);
6
7deref_singleton_tuple_struct!(CodecId, Id);
8
9impl Default for CodecId {
10 fn default() -> Self {
11 CodecId(Id::None)
12 }
13}
14
15impl CodecId {
16 pub(crate) fn is_attach(self) -> bool {
17 match self.0 {
18 Id::PNG => true,
19 Id::LJPEG | Id::JPEGLS | Id::JPEG2000 => true,
20 _ => false,
21 }
22 }
23
24 pub(crate) fn is_font(self) -> bool {
25 match self.0 {
26 Id::TTF => true,
27 Id::OTF => true,
28 _ => false,
29 }
30 }
31}