Skip to content

Commit

Permalink
Print Profile level ID as hex (#227)
Browse files Browse the repository at this point in the history
* print pofile-level-id as hex instead of integer

* cargo format
  • Loading branch information
nils-ohlmeier authored Aug 3, 2020
1 parent 6efcabe commit 899f9ec
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/attribute_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,13 +614,17 @@ impl fmt::Display for SdpAttributeFmtpParameters {
f,
"{parameters}{red}{dtmf}{unknown}",
parameters = non_empty_string_vec![
maybe_print_param("packetization-mode=", self.packetization_mode, 0),
maybe_print_param(
"profile-level-id=",
format!("{:06x}", self.profile_level_id),
"420010".to_string()
),
maybe_print_bool_param(
"level-asymmetry-allowed",
self.level_asymmetry_allowed,
false
),
maybe_print_param("profile-level-id=", self.profile_level_id, 0x0042_0010),
maybe_print_param("packetization-mode=", self.packetization_mode, 0),
maybe_print_param("max-fs=", self.max_fs, 0),
maybe_print_param("max-cpb=", self.max_cpb, 0),
maybe_print_param("max-dpb=", self.max_dpb, 0),
Expand Down Expand Up @@ -3614,6 +3618,9 @@ mod tests {
make_check_parse_and_serialize!(check_parse, SdpAttribute::Fmtp);

check_parse_and_serialize("fmtp:109 maxplaybackrate=46000;stereo=1;useinbandfec=1");
check_parse_and_serialize(
"fmtp:126 profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1",
);
check_parse_and_serialize("fmtp:66 0-15");
check_parse_and_serialize("fmtp:109 0-15,66");
check_parse_and_serialize("fmtp:66 111/115");
Expand Down

0 comments on commit 899f9ec

Please sign in to comment.