Skip to content

Commit

Permalink
Fix generate config JSON default deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
quietvoid committed Dec 31, 2021
1 parent cda8770 commit 6673e09
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dolby_vision/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### ???

- Fixed deserialize default value for `GenerateConfig`.`cm_version` field.

## 1.5.2

Changed DM data logic to write the number of blocks and align even if there are none.
Expand Down
2 changes: 2 additions & 0 deletions dolby_vision/src/rpu/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ const OUT_NAL_HEADER: &[u8] = &[0, 0, 0, 1];
#[derive(Debug)]
#[cfg_attr(feature = "serde_feature", derive(Deserialize, Serialize))]
pub struct GenerateConfig {
#[cfg_attr(feature = "serde_feature", serde(default = "CmVersion::v40"))]
pub cm_version: CmVersion,

pub length: usize,

/// Optional, specifies a L2 block for this target
Expand Down
10 changes: 10 additions & 0 deletions dolby_vision/src/rpu/vdr_dm_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,3 +472,13 @@ impl VdrDmData {
Ok(())
}
}

impl CmVersion {
pub fn v29() -> Self {
CmVersion::V29
}

pub fn v40() -> Self {
CmVersion::V40
}
}

0 comments on commit 6673e09

Please sign in to comment.