use crate::ids::SfuRid;
use crate::media::SfuMediaPayload;
pub const LOW: SfuRid = SfuRid::LOW;
pub const MEDIUM: SfuRid = SfuRid::MEDIUM;
pub const HIGH: SfuRid = SfuRid::HIGH;
pub(crate) fn matches(desired: SfuRid, data: &SfuMediaPayload) -> bool {
match data.rid() {
None => true,
Some(rid) => rid == desired,
}
}
#[cfg(test)]
mod tests {
use str0m::media::Rid;
use super::*;
#[test]
fn const_matches_from_str() {
assert_eq!(LOW.to_str0m(), Rid::from("q"));
assert_eq!(MEDIUM.to_str0m(), Rid::from("h"));
assert_eq!(HIGH.to_str0m(), Rid::from("f"));
}
}