Closed chmgr closed 2 years ago
I implemented SetDataBytes()
as the reverse function to DataBytes()
. I also added a test verifying that DataBytes()
returns the same data as set via SetDataBytes()
. It might be better to check against Data()
when #4 is fixed.
I also had the need to inject raw video inside an encoding workflow and after trying out several solutions, I ended up using this method (which frees the malloced data once data is not referenced anymore) and then providing the packets to a decoder using codec id rawvideo
: it manages memory properly and all internal logic such as padding is handled by the decoder. In all honesty, based on the available libav
API, I even have the feeling that libav
developers wanted people to do it that way 🤔
Anyway, thanks for taking the time to write this PR, I'll close it now, but feel free to comment it 👍
implemented as discussed here #4