portl4t / ts-mp4

MP4 streaming media, implement as plugin of Apache TrafficServer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No TSIOBufferReaderCopy interface

hy05190134 opened this issue · comments

TSIOBufferReaderCopy(meta_reader, &mdhd64, sizeof(mp4_mdhd64_atom));
TSIOBufferCopy(mvhd_atom.buffer, meta_reader, atom_size, 0);

mp4_meta.cc use a lot of TSIOBufferReaderCopy to deep copy string into meta_reader, but the interface is deprecated maybe. So can I use code below to take place of the code above ?

TSIOBufferWrite((TSIOBuffer) meta_reader, &mdhd64, sizeof(mp4_mdhd64_atom))

Absolutely not, the two functions have different use. As described in InkAPI.cc, TSIOBufferReaderCopy(...) was not in SDK3.0. There is not evidence said that this function was deprecated.

Without TSIOBufferReaderCopy(...), you have to iterate all the block within the MIOBuffer to deep copy the string.

Hi hy05190134, I think your are right, TSIOBufferReaderCopy(...) was a private api in master, I had fix this issues by changing TSIOBufferReaderCopy(...) to IOBufferReaderCopy(...). Thanks for your advice.