feat(protocol): freeze M4 native session RC6 contract
This commit is contained in:
@@ -38,6 +38,8 @@ fn evaluate(version: &str, kind: &str, input: &str) -> &'static str {
|
||||
values.get("device_key_id").cloned().unwrap_or_default(),
|
||||
values.get("pool_id").cloned().unwrap_or_default(),
|
||||
values.get("idempotency_key").cloned().unwrap_or_default(),
|
||||
vec![VideoProfile::new("h264".into(), 8, "4:2:0".into(), "bt709-limited".into(), "sdr".into()).unwrap()],
|
||||
BitratePreference::new("auto".into(), None).unwrap(),
|
||||
None,
|
||||
) {
|
||||
Ok(_) => "valid",
|
||||
@@ -184,6 +186,9 @@ fn classify_gateway_input(encoded: &str) -> &'static str {
|
||||
}
|
||||
7 if body.len() == 4 => "valid",
|
||||
7 => "invalid:length",
|
||||
8 if body.len() != 8 => "invalid:length",
|
||||
8 if body[0] > 15 || body[3] > 3 => "invalid:field",
|
||||
8 => "valid",
|
||||
_ => "invalid:kind",
|
||||
}
|
||||
}
|
||||
@@ -219,6 +224,12 @@ fn classify_gateway_feedback(encoded: &str) -> &'static str {
|
||||
2 => "invalid:field",
|
||||
3 if body.is_empty() => "valid",
|
||||
3 => "invalid:length",
|
||||
4 if body.len() == 24 && body[..16].iter().any(|value| *value != 0) && body[16..24].iter().any(|value| *value != 0) => "valid",
|
||||
4 if body.len() != 24 => "invalid:length",
|
||||
4 => "invalid:field",
|
||||
5 if body.len() == 16 && body.iter().any(|value| *value != 0) => "valid",
|
||||
5 if body.len() != 16 => "invalid:length",
|
||||
5 => "invalid:field",
|
||||
_ => "invalid:type",
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user