I add this code in doGetNextFrame(): if (fMaxSize > fInputBufferSize) { fInputBufferSize = fMaxSize; delete[] fInputBuffer; fInputBuffer = new unsigned char[fInputBufferSize]; *( reinterpret_cast<u_int32_t*>(fInputBuffer) ) = htonl(0x01); } // Arrange to read data directly into the client's buffer: fInputSource->getNextFrame ( fInputBuffer + 4, fMaxSize - 4,afterGettingFrame, this,FramedSource::handleClosure, this );
and this in afterGettingFrame1(): fFrameSize = frameSize + 4; memmove(fTo, fInputBuffer, fFrameSize); (...omitted code...) Although it works fine, but noticed that there is a memory copy which I think is redundant. I have tried to let fTo point directly to fInputBuffer, but that caused the generated data full of garbage. I don't known why. who will use fTo later and where is fTo's initialization? Thanks again for your help!
_______________________________________________ live-devel mailing list live-devel@lists.live555.com http://lists.live555.com/mailman/listinfo/live-devel