// ----------------------------------------------------------------------------- // CG711PayloadFormatRead::FillSinkBuffer // Fill SinkBuffer. // ----------------------------------------------------------------------------- // void CG711PayloadFormatRead::FillSinkBufferL() { DP_G711_READ( "CG711PayloadFormatRead::FillSinkBuffer()" ); CMMFDataBuffer* curFrameBuffer = NULL; if ( EBufferOne == iCurrentBuffer ) { curFrameBuffer = iFrameBufferOne; } else { curFrameBuffer = iFrameBufferTwo; } TDes8& curFrameData( curFrameBuffer->Data() ); curFrameData.SetLength( KVoIPHeaderLength ); // Put next frame decoded from RTP payload to the framebuffer iBufferToReadExists = GetNextFrame( curFrameData ); // G.711 Gwc expects 2 bytes for dtx-decision if ( iCnFrame ) { DP_G711_READ( "CG711PayloadFormatRead::FillSinkBufferL add dtx-header" ); curFrameData[0] = KVoIPCNFrame; curFrameData[1] = 0; } else { DP_G711_READ( "CG711PayloadFormatRead::FillSinkBufferL add voice-header" ); curFrameData[0] = KVoIPAudioFrame; curFrameData[1] = 0; } curFrameBuffer->SetFrameNumber( iRecvHeader.iTimestamp + ( ( iFrameIndex - 1 ) * TUint( iCInfo.iHwFrameTime * KDefaultSampleRateInkHz ) ) ); DP_G711_READ2( "CG711PayloadFormatRead::FillSinkBuffer - FRAMENUM: %u", curFrameBuffer->FrameNumber() ); const TInt dataLen( ( iCInfo.iHwFrameTime * KBitsPerByte ) + KVoIPHeaderLength ); curFrameData.SetLength( dataLen ); curFrameBuffer->SetStatus( EFull ); DP_G711_READ2( "CG711PayloadFormatRead: Filled framebuffer with buf. size: %d", curFrameBuffer->BufferSize() ); iStateMachine->ChangeState( EEmptyDataToSink ); DP_G711_READ( "CG711PayloadFormatRead::FillSinkBuffer - DONE" ); }
/** Verify CMMFBuffer buffer framenumbers * Use case: N/A * @test Req. under test REQ172.7.25 */ TVerdict CTestStep_MMF_BASECL_U_0008::DoTestStepL( void ) { TVerdict verdict = EPass; CMMFDataBuffer* descriptorBuffer = CMMFDataBuffer::NewL(); //create descriptor buffer //check initial frame number is 0 if (descriptorBuffer->FrameNumber() != 0) verdict = EFail; //check setting a framenumber descriptorBuffer->SetFrameNumber(KMMFTestFrameNumber); if (descriptorBuffer->FrameNumber() != KMMFTestFrameNumber) verdict = EFail; //check incrementing the framenumber descriptorBuffer->NextFrame(); if (descriptorBuffer->FrameNumber() != (KMMFTestFrameNumber+1)) verdict = EFail; delete descriptorBuffer; return verdict; }