In RtpPacketReceived Function , received the RTP packet , assigned the RTP data in “address” (HBufC8)variable and called the SetPlayBuffer function.
void CRTPEngine::RtpPacketReceived( TRtpId aStreamId, const TRtpRecvHeader& aHeaderInfo, const TDesC8& aPayloadData )
address =HBufC8::NewLC(160); //address declare as global
address = aPayloadData.AllocL();
TDesC8 aPayLoad = aPayloadData; SetPlayBuffer(aPayLoad);
In SetPlayBuffer Function I want to append (0x00, 0x01).before RTP packet(address) then copy to TPtr8.
Here I get crash when I copy to TPtr8 .
void CVoIPTestEngine::SetPlayBuffer(TDesC8& aPayLoadData)
TUint8 buf; buf=0x01; buf=0x00; //Two Byte To append
lPaddedPayload.Append(buf,2); //Append the Byte
lPaddedPayload.Append(aTempBuf1); //append the RTP
iPlayBufPtr.Copy( lPaddedPayload ); //Copy to TPtr8 Exe Crash error User 23
My requirement is I want to append 2 byte before the Receiving RTP packet and copy that data to TPtr8.
Please give me suggestion on this problem