diff --git a/Cargo.lock b/Cargo.lock index 7d01d2392..5d80303b9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1344,9 +1344,9 @@ dependencies = [ [[package]] name = "cros-codecs" -version = "0.0.4" +version = "0.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "277a30a0ddadfa014380ee30cc60330d260369855417c492fa94421d7c7e9229" +checksum = "4862478feb3de946be3e4b7f316b18957a45d88d1c3695c606bdf6e76a2d2bfb" dependencies = [ "anyhow", "bitreader", @@ -1355,6 +1355,7 @@ dependencies = [ "crc32fast", "enumn", "log", + "nix", "thiserror 1.0.69", ] diff --git a/net/hlsmultivariantsink/Cargo.toml b/net/hlsmultivariantsink/Cargo.toml index c614841ae..05e401fa9 100644 --- a/net/hlsmultivariantsink/Cargo.toml +++ b/net/hlsmultivariantsink/Cargo.toml @@ -17,7 +17,7 @@ chrono = "0.4" sprintf = "0.2" gst-pbutils = { workspace = true, features = ["v1_22"] } [target.'cfg(target_os = "linux")'.dependencies] -cros-codecs = { version = "0.0.4", default-features = false } +cros-codecs = { version = "0.0.5", default-features = false } [dev-dependencies] gst-audio.workspace = true diff --git a/net/hlsmultivariantsink/src/imp.rs b/net/hlsmultivariantsink/src/imp.rs index 1437eb626..b3750b67f 100644 --- a/net/hlsmultivariantsink/src/imp.rs +++ b/net/hlsmultivariantsink/src/imp.rs @@ -1317,8 +1317,8 @@ impl HlsMultivariantSink { let mut cursor = Cursor::new(buffer); let mut parser = H264Parser::Parser::default(); - while let Ok(nalu) = H264Parser::Nalu::<_>::next(&mut cursor) { - if let H264Parser::NaluType::Sps = nalu.header().nalu_type() { + while let Ok(nalu) = H264Parser::Nalu::next(&mut cursor) { + if let H264Parser::NaluType::Sps = nalu.header.type_ { let sps = parser.parse_sps(&nalu).unwrap(); let profile = sps.profile_idc; @@ -1371,26 +1371,26 @@ impl HlsMultivariantSink { let mut cursor = Cursor::new(buffer); let mut parser = H265Parser::Parser::default(); - while let Ok(nalu) = H265Parser::Nalu::<_>::next(&mut cursor) { - if let H265Parser::NaluType::SpsNut = nalu.header().nalu_type() { + while let Ok(nalu) = H265Parser::Nalu::next(&mut cursor) { + if let H265Parser::NaluType::SpsNut = nalu.header.type_ { let sps = parser.parse_sps(&nalu).unwrap(); - let profile_tier_level = sps.profile_tier_level(); + let profile_tier_level = &sps.profile_tier_level; /* Adapted from hevc_get_mime_codec() in codec-utils.c */ let mut codec_str = "hvc1".to_owned(); - let profile_space = profile_tier_level.general_profile_space(); + let profile_space = profile_tier_level.general_profile_space; if profile_space != 0 { codec_str.push_str(&(65 + profile_space - 1).to_string()); } - let tier_flag = if profile_tier_level.general_tier_flag() { + let tier_flag = if profile_tier_level.general_tier_flag { 'H' } else { 'L' }; - let profile_idc = profile_tier_level.general_profile_idc(); - let level_idc = profile_tier_level.general_level_idc() as u16; - let compatibility_flag = profile_tier_level.general_profile_compatibility_flag(); + let profile_idc = profile_tier_level.general_profile_idc; + let level_idc = profile_tier_level.general_level_idc as u16; + let compatibility_flag = profile_tier_level.general_profile_compatibility_flag; let mut compat_flags = 0; compatibility_flag @@ -1411,14 +1411,14 @@ impl HlsMultivariantSink { let compat_flag_parameter = compat_flags.rotate_left(16); let constraint_flags = [ - profile_tier_level.general_progressive_source_flag(), - profile_tier_level.general_interlaced_source_flag(), - profile_tier_level.general_non_packed_constraint_flag(), - profile_tier_level.general_frame_only_constraint_flag(), - profile_tier_level.general_max_12bit_constraint_flag(), - profile_tier_level.general_max_10bit_constraint_flag(), - profile_tier_level.general_max_8bit_constraint_flag(), - profile_tier_level.general_max_422chroma_constraint_flag(), + profile_tier_level.general_progressive_source_flag, + profile_tier_level.general_interlaced_source_flag, + profile_tier_level.general_non_packed_constraint_flag, + profile_tier_level.general_frame_only_constraint_flag, + profile_tier_level.general_max_12bit_constraint_flag, + profile_tier_level.general_max_10bit_constraint_flag, + profile_tier_level.general_max_8bit_constraint_flag, + profile_tier_level.general_max_422chroma_constraint_flag, ]; let mut constraint_indicator_flag = 0;