Skip to content

Commit

Permalink
rename variants
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev committed Mar 1, 2024
1 parent 1b5cf6f commit 79b0dc9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/levels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ use strum::{EnumCount, FromRepr};
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, FromRepr)]
pub enum ObuMetaType {
OBU_META_HDR_CLL = 1,
OBU_META_HDR_MDCV = 2,
OBU_META_SCALABILITY = 3,
OBU_META_ITUT_T35 = 4,
OBU_META_TIMECODE = 5,
HdrCll = 1,
HdrMdcv = 2,
Scalability = 3,
ItutT32 = 4,
Timecode = 5,
}

pub type TxfmSize = u8;
Expand Down
8 changes: 4 additions & 4 deletions src/obu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2351,7 +2351,7 @@ unsafe fn parse_obus(
}

match ObuMetaType::from_repr(meta_type) {
Some(ObuMetaType::OBU_META_HDR_CLL) => {
Some(ObuMetaType::HdrCll) => {
let debug = debug.named("CLLOBU");
let max_content_light_level = gb.get_bits(16) as c_int;
debug.log(
Expand All @@ -2378,7 +2378,7 @@ unsafe fn parse_obus(
max_frame_average_light_level,
})); // TODO(kkysen) fallible allocation
}
Some(ObuMetaType::OBU_META_HDR_MDCV) => {
Some(ObuMetaType::HdrMdcv) => {
let debug = debug.named("MDCVOBU");
let primaries = array::from_fn(|i| {
let primary = [gb.get_bits(16) as u16, gb.get_bits(16) as u16];
Expand Down Expand Up @@ -2408,7 +2408,7 @@ unsafe fn parse_obus(
min_luminance,
})); // TODO(kkysen) fallible allocation
}
Some(ObuMetaType::OBU_META_ITUT_T35) => {
Some(ObuMetaType::ItutT32) => {
let mut payload_size = len as c_int;
// Don't take into account all the trailing bits for `payload_size`.
while payload_size > 0 && r#in[init_byte_pos + payload_size as usize - 1] == 0 {
Expand Down Expand Up @@ -2441,7 +2441,7 @@ unsafe fn parse_obus(
}))); // TODO(kkysen) fallible allocation
}
}
Some(ObuMetaType::OBU_META_SCALABILITY | ObuMetaType::OBU_META_TIMECODE) => {} // Ignore metadata OBUs we don't care about.
Some(ObuMetaType::Scalability | ObuMetaType::Timecode) => {} // Ignore metadata OBUs we don't care about.
None => {
// Print a warning, but don't fail for unknown types.
writeln!(c.logger, "Unknown Metadata OBU type {meta_type}");
Expand Down

0 comments on commit 79b0dc9

Please sign in to comment.