Hi
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)
{
TPtr8 aTempBuf(NULL,0,0);
TPtr8 aTempBuf1(NULL,0,0);
TPtr8 iPlayBufPtr(NULL,0,0);
CVoIPDataBuffer* iPlayBuf;
TBuf8<90> lPaddedPayload;
lPaddedPayload.Zero();
aTempBuf.Set(address->Des());
aTempBuf1.Zero();
TInt inlen=aTempBuf.Length();
if(inlen>80)
{
aTempBuf1.Set(aTempBuf.LeftTPtr(80));
TUint8 buf[2]; buf[0]=0x01; buf[1]=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
iPlayBuf->SetPayloadPtr(iPlayBufPtr);
iVoIPDnlink->BufferFilled(iPlayBuf);
User::Free(address);
CleanupStack::PopAndDestroy();
return;
}
}
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




