Thank you Quinn, copying data works! I have tested.
Sorry for my sloppy answer. The piece of code are in a Swift library that is intended to be run on iOS 26, iPadOS 26 and MacOS 26 and later. But I currently only run them on iPhone/iPad.
Oh, hey, that wasn’t the answer I was expecting!
The chunks are format descriptions of HEVC buffer, more specifically, VPS, SPS and PPS. I searched web and learned the sizes are typically less than 500 bytes. That manipulation runs when encountering I-frame, usually once in a second.
I realized that my intuitions borrowed from C pointer misled me. I should check out manual memory management and your links.
I wish I could give your helps credits again! These teach me a lot. And I am pretty sure right now the original Accepted Answer truly solves my original problem. I will start a new post if I encounter problems. Thank you!
Topic:
App & System Services
SubTopic:
Networking
Tags: