mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 01:49:05 +00:00
Add libzrtp beta
This commit is contained in:
committed by
Travis Cross
parent
f61ed4a163
commit
5a61e580b9
79
projects/symbian/DelayRuner.cpp
Normal file
79
projects/symbian/DelayRuner.cpp
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
============================================================================
|
||||
Name : CDelayRuner.cpp
|
||||
Author : R. Drutsky
|
||||
Version : 1.0
|
||||
Copyright : Copyright (c) 2010 Soft Industry
|
||||
Description : CCDelayRuner implementation
|
||||
============================================================================
|
||||
*/
|
||||
|
||||
#include "DelayRuner.h"
|
||||
#include "zrtp_iface_system.h"
|
||||
|
||||
void zrtp_internal_delete_task_from_list(zrtp_stream_t* ctx, zrtp_retry_task_t* ztask);
|
||||
|
||||
CDelayRuner::CDelayRuner() :
|
||||
CActive(EPriorityLow) // Standard priority
|
||||
{
|
||||
}
|
||||
|
||||
CDelayRuner* CDelayRuner::NewLC()
|
||||
{
|
||||
CDelayRuner* self = new (ELeave) CDelayRuner();
|
||||
CleanupStack::PushL(self);
|
||||
self->ConstructL();
|
||||
return self;
|
||||
}
|
||||
|
||||
CDelayRuner* CDelayRuner::NewL()
|
||||
{
|
||||
CDelayRuner* self = CDelayRuner::NewLC();
|
||||
CleanupStack::Pop(); // self;
|
||||
return self;
|
||||
}
|
||||
|
||||
void CDelayRuner::ConstructL()
|
||||
{
|
||||
User::LeaveIfError(iTimer.CreateLocal()); // Initialize timer
|
||||
CActiveScheduler::Add(this); // Add to scheduler
|
||||
}
|
||||
|
||||
CDelayRuner::~CDelayRuner()
|
||||
{
|
||||
Cancel(); // Cancel any request, if outstanding
|
||||
iTimer.Close(); // Destroy the RTimer object
|
||||
// Delete instance variables if any
|
||||
}
|
||||
|
||||
void CDelayRuner::DoCancel()
|
||||
{
|
||||
iTimer.Cancel();
|
||||
}
|
||||
|
||||
void CDelayRuner::StartL(zrtp_stream_t *ctx, zrtp_retry_task_t* ztask)
|
||||
{
|
||||
Cancel(); // Cancel any request, just to be sure
|
||||
//iState = EUninitialized;
|
||||
iCtx = ctx;
|
||||
iZTask = ztask;
|
||||
iTimer.After(iStatus, ztask->timeout * 1000); // Set for later
|
||||
SetActive(); // Tell scheduler a request is active
|
||||
}
|
||||
|
||||
void CDelayRuner::RunL()
|
||||
{
|
||||
if (iStatus == KErrNone)
|
||||
{
|
||||
// Do something useful
|
||||
iZTask->_is_busy = 1 ; // may be we don't need this
|
||||
(iZTask->callback)(iCtx,iZTask);
|
||||
iZTask->_is_busy = 0 ; // may be we don't need this
|
||||
}
|
||||
zrtp_internal_delete_task_from_list(iCtx,iZTask);
|
||||
}
|
||||
|
||||
TInt CDelayRuner::RunError(TInt aError)
|
||||
{
|
||||
return aError;
|
||||
}
|
Reference in New Issue
Block a user