コード例 #1
0
/** Verify CMMFBuffer timestamping
 * Use case: N/A
 * @test Req. under test REQ172.7.25
 */
TVerdict CTestStep_MMF_BASECL_U_0007::DoTestStepL( void )
	 {
	 TVerdict verdict = EPass;
	 const TInt KMMFTestTime = 1234567890;
	 CMMFDataBuffer* descriptorBuffer = CMMFDataBuffer::NewL(); //create descriptor buffer

	 //check that the initial time to play is 0
	 if (descriptorBuffer->TimeToPlay() != TTimeIntervalMicroSeconds(0)) verdict = EFail;

	 //assign a timestamp and check it is set correctly
	 descriptorBuffer->SetTimeToPlay(TTimeIntervalMicroSeconds(KMMFTestTime));
	 if (descriptorBuffer->TimeToPlay() != TTimeIntervalMicroSeconds(KMMFTestTime)) verdict = EFail;
 
	 delete descriptorBuffer;
	 return verdict;
	 }
コード例 #2
0
// ---------------------------------------------------------------------------
// CDTMFPayloadFormatWrite::DeliverPacketL
// Prepare the RTP packet header and deliver the packet to the datasink.
// ---------------------------------------------------------------------------
//
void CDTMFPayloadFormatWrite::DeliverPacketL( CMMFDataBuffer& aPayload, 
                                              TBool aMarkerBit )
    {
    DP_DTMF_WRITE4( 
        _L("CDTMFPayloadFormatWrite::DeliverPacketL - TSTAMP: %u, TDUR: %d, tick = %u"),
        TUint32( aPayload.TimeToPlay().Int64() ), iToneDuration, 
        User::NTickCount() );
    
    if ( KSignalOutbandDtmf == iGenerationMode )
        {
        // Set the marker bit if it is very first packet.
        if ( aMarkerBit )
            {
            iRtpSendHeader.iMarker = 1;
            }
        else
            {
            iRtpSendHeader.iMarker = 0;
            }
            
        // Construct RTP header.
        if ( EGenRedUsed == iCInfo.iAlgoUsed )
            {
            iRtpSendHeader.iPayloadType = iCInfo.iRedundantPayload;
            }
        else
            {
            iRtpSendHeader.iPayloadType = iCInfo.iPayloadType;
            }

        // Timestamp must be updated before coming here
        iRtpSendHeader.iTimestamp = TUint32( aPayload.TimeToPlay().Int64() );

        // Deliver the packet
        iRtpDataSink->EmptyBufferL( &aPayload, this,
            TMediaId( KUidMediaTypeAudio ), iRtpSendHeader );

        // Do not reset payload buffer because update packets
        // are send based on same buffer.
        }
    else
        {
        DP_DTMF_WRITE( _L("CDTMFPayloadFormatWrite::DeliverPacketL - INBAND TONE") );
        }
    }