os/mm/devsound/sounddevbt/PlatSec/src/Server/AudioServer/MmfBtDevSoundServerStart.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/devsound/sounddevbt/PlatSec/src/Server/AudioServer/MmfBtDevSoundServerStart.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,60 @@
     1.4 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#include <e32std.h>
    1.20 +#include <ecom/ecom.h>
    1.21 +#include "MmfBtDevSoundServerStart.h"
    1.22 +#include "MmfBtDevSoundServer.h"
    1.23 +
    1.24 +
    1.25 +
    1.26 +
    1.27 +EXPORT_C TInt CMMFDevSoundServer::StartThread(TAny* aParms)
    1.28 +/**
    1.29 +Thread entry-point function.
    1.30 +The TServerStart objects is passed as the thread parameter
    1.31 +**/
    1.32 +	{
    1.33 +	TInt err = KErrNone;
    1.34 +	__UHEAP_MARK;
    1.35 +	TDevSoundServerStart* start = reinterpret_cast<TDevSoundServerStart*>(aParms);
    1.36 +	CTrapCleanup* cleanup = CTrapCleanup::New();
    1.37 +	if (!cleanup)
    1.38 +		err = KErrNoMemory;
    1.39 +	if (!err)
    1.40 +		{
    1.41 +		CActiveScheduler* sched=NULL;
    1.42 +		TRAP(err, sched=new(ELeave) CActiveScheduler);
    1.43 +		if (!err)
    1.44 +			{
    1.45 +			CActiveScheduler::Install(sched);
    1.46 +			CMMFDevSoundServer* server = NULL;
    1.47 +			TRAPD(err,server = CMMFDevSoundServer::NewL(start->iAudioServer, start->iProcessId));
    1.48 +			
    1.49 +			if(!err)
    1.50 +				{
    1.51 +				// Sync with the client and enter the active scheduler
    1.52 +				RThread::Rendezvous(KErrNone);
    1.53 +				sched->Start();
    1.54 +				}
    1.55 +			delete server;
    1.56 +			delete sched;		
    1.57 +			}
    1.58 +		}
    1.59 +	delete cleanup;
    1.60 +	REComSession::FinalClose();
    1.61 +	__UHEAP_MARKEND;
    1.62 +	return err;
    1.63 +	}