Skip to content

Generate skippable frame API#2439

Merged
Cyan4973 merged 3 commits intofacebook:devfrom
senhuang42:skippable_frame_api
Dec 28, 2020
Merged

Generate skippable frame API#2439
Cyan4973 merged 3 commits intofacebook:devfrom
senhuang42:skippable_frame_api

Conversation

@senhuang42
Copy link

ZSTD_writeSkippableFrame(void* dst, size_t dstCapacity, const void* src, size_t srcSize, U32 magicVariant)

Writes a skippable frame into dst buffer, using src content, and using one of the 16 available skippable frame magic numbers, controllable with magicVariant. More detailed documentation in zstd.h.

Test Plan:

  • Modify existing unit test to ensure roundtrip-ability

@terrelln
Copy link
Contributor

This looks good to me. Is there a particular use case that motivates adding this to the API?

@senhuang42
Copy link
Author

Was mentioned in #2275 that this might be a nice thing to have.

@Cyan4973
Copy link
Contributor

U32 magicVariant

In the future, if we ever come to settle on a few skippable frame IDs implying something meaningful, we could use an enum instead. Or in complementarity, as I think this is compatible with U32, so it should be fine.

Speaking of "meaningful" skippable frame IDs, maybe we could consider those from pzstd, and maybe the seekable format.

@Cyan4973 Cyan4973 merged commit cfff4c1 into facebook:dev Dec 28, 2020
Cyan4973 added a commit that referenced this pull request Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants