Skip to content

Commit

Permalink
Add L255 to C API
Browse files Browse the repository at this point in the history
  • Loading branch information
quietvoid committed Jan 7, 2022
1 parent 377d963 commit a71f5b6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions dolby_vision/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Add support for variable length blocks: L8, L9, L10.
- Add L9 metadata by default when generating CM v4.0 RPUs.
- Add support for L255 block in DM v1 payload.

XML parser:
- Improve specific version support up to XML version 5.1.0.
Expand Down
12 changes: 11 additions & 1 deletion dolby_vision/src/c_structs/dm_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub struct DmData {
level10: Level10BlockList,
level11: *const ExtMetadataBlockLevel11,
level254: *const ExtMetadataBlockLevel254,
level255: *const ExtMetadataBlockLevel255,
}

#[repr(C)]
Expand Down Expand Up @@ -78,6 +79,7 @@ impl DmData {
self.level1 =
Box::into_raw(Box::new(b.clone())) as *const ExtMetadataBlockLevel1
}
ExtMetadataBlock::Level2(_) => {}
ExtMetadataBlock::Level3(b) => {
self.level3 =
Box::into_raw(Box::new(b.clone())) as *const ExtMetadataBlockLevel3
Expand All @@ -94,10 +96,12 @@ impl DmData {
self.level6 =
Box::into_raw(Box::new(b.clone())) as *const ExtMetadataBlockLevel6
}
ExtMetadataBlock::Level8(_) => {}
ExtMetadataBlock::Level9(b) => {
self.level9 =
Box::into_raw(Box::new(b.clone())) as *const ExtMetadataBlockLevel9
}
ExtMetadataBlock::Level10(_) => {}
ExtMetadataBlock::Level11(b) => {
self.level11 =
Box::into_raw(Box::new(b.clone())) as *const ExtMetadataBlockLevel11
Expand All @@ -106,7 +110,11 @@ impl DmData {
self.level254 =
Box::into_raw(Box::new(b.clone())) as *const ExtMetadataBlockLevel254
}
_ => {}
ExtMetadataBlock::Level255(b) => {
self.level255 =
Box::into_raw(Box::new(b.clone())) as *const ExtMetadataBlockLevel255
}
ExtMetadataBlock::Reserved(_) => {}
};
}

Expand All @@ -133,6 +141,7 @@ impl DmData {
self.level10.free();
Box::from_raw(self.level11 as *mut ExtMetadataBlockLevel11);
Box::from_raw(self.level254 as *mut ExtMetadataBlockLevel254);
Box::from_raw(self.level255 as *mut ExtMetadataBlockLevel255);
}
}

Expand All @@ -151,6 +160,7 @@ impl Default for DmData {
level10: Default::default(),
level11: null(),
level254: null(),
level255: null(),
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion dolby_vision/src/rpu/extension_metadata/blocks/level255.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ use serde::{Deserialize, Serialize};

use super::{ExtMetadataBlock, ExtMetadataBlockInfo};

/// Metadata level present in CM v2.9
/// Metadata level optionally present in CM v2.9.
/// Maybe for debugging?
#[repr(C)]
#[derive(Debug, Default, Clone)]
#[cfg_attr(feature = "serde_feature", derive(Deserialize, Serialize))]
Expand Down

0 comments on commit a71f5b6

Please sign in to comment.