Skip to content

docs: Embeddable APIs#172

Open
tmathern wants to merge 25 commits intomainfrom
mathern/embeddable-docs
Open

docs: Embeddable APIs#172
tmathern wants to merge 25 commits intomainfrom
mathern/embeddable-docs

Conversation

@tmathern
Copy link
Collaborator

@tmathern tmathern commented Mar 9, 2026

No description provided.

@tmathern tmathern changed the title (wip embeddable docs) docs: Embeddable APIs Mar 9, 2026
@tmathern tmathern requested review from crandmck and gpeacock March 9, 2026 16:49
@tmathern tmathern marked this pull request as ready for review March 9, 2026 16:49
@crandmck
Copy link
Contributor

We should update this PR depending on how the comments on contentauth/c2pa-rs#1900 are resolved.


Use this workflow with MP4 and other BMFF formats, which always require a placeholder. The `prefer_box_hash` setting has no effect on BMFF formats: they always use `BmffHash` regardless of the setting. No special Builder settings are required as the SDK selects `BmffHash` automatically based on the format.

BMFF containers (ISO Base Media File Format) store media data in `mdat` (media data) boxes, which hold the raw audio, video, and other media samples. These `mdat` boxes can be very large, making it expensive to re-read the entire file to compute a hash after signing. The SDK addresses this with a Merkle tree structure in the `BmffHash` assertion: it divides `mdat` content into fixed-size chunks and computes a hash for each chunk (a "leaf" in the tree). These leaf hashes are combined into a Merkle root hash that covers the entire `mdat` content. The `placeholder()` method pre-allocates slots in the `BmffHash` assertion for these Merkle leaf hashes, sized according to the `core.merkle_tree_chunk_size_in_kb` setting. This pre-allocation is necessary because the final manifest must be exactly the same size as the placeholder for in-place patching to work.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, will update accordingly but will take a few cycles to do so.

Copy link
Collaborator Author

@tmathern tmathern Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mauricefisher64 Are additional bindings needed?
Eg. c2pa_builder_set_fixed_size_merkle & friends are for the streaming APIs, so we don't need them here now, and can ignore them in those docs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants