refactor resolution, mid commit

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-05-17 23:19:20 +08:00
parent 154b86d2a5
commit a603e046e3
9 changed files with 196 additions and 55 deletions

View File

@@ -191,6 +191,12 @@ pub struct Config2 {
pub options: HashMap<String, String>,
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct Resolution {
pub w: i32,
pub h: i32,
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PeerConfig {
#[serde(default, deserialize_with = "deserialize_vec_u8")]
@@ -246,6 +252,9 @@ pub struct PeerConfig {
#[serde(flatten)]
pub view_only: ViewOnly,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_resolution: Option<Resolution>,
// The other scalar value must before this
#[serde(default, deserialize_with = "PeerConfig::deserialize_options")]
pub options: HashMap<String, String>, // not use delete to represent default values