// ----------------------------------------------------------------------------- // CCMRVideoCodecs::GetSupportedVideoCodecsL // Get the supported & installed video codecs. // This can be called also when the recorder is not open // (other items were commented in a header). // ----------------------------------------------------------------------------- // void CCMRVideoCodecs::GetSupportedVideoCodecsL(CDesC8Array& aVideoMimeTypes) const { aVideoMimeTypes.Reset(); // copy from iVideoMimeTypes TInt i; for ( i = 0; i < iVideoMimeTypes->Count(); i++ ) { aVideoMimeTypes.AppendL( iVideoMimeTypes->MdcaPoint(i) ); } }
// ------------------------------------------------------------------------------------------------ // CNSmlDPInformation::InternalizeL // ------------------------------------------------------------------------------------------------ EXPORT_C void CNSmlDPInformation::InternalizeL( RReadStream& aStream ) { TPckg<TSmlDataProviderId> id( iInfo->iId ); aStream.ReadL( id ); iInfo->iVersion.iMajor = aStream.ReadInt32L(); iInfo->iVersion.iMinor = aStream.ReadInt32L(); iInfo->iVersion.iBuild = aStream.ReadInt32L(); iInfo->iProtocolVer = static_cast<TSmlProtocolVersion>( aStream.ReadInt32L() ); delete iInfo->iDisplayName; iInfo->iDisplayName = NULL; iInfo->iDisplayName = HBufC::NewL( aStream, aStream.ReadUint32L() ); delete iInfo->iMimeTypes; iInfo->iMimeTypes = NULL; TInt mimetypesCount = aStream.ReadUint32L(); CDesC8Array* mimetypes = new (ELeave) CDesC8ArrayFlat( Max<TInt>( 2, mimetypesCount ) ); CleanupStack::PushL( mimetypes ); for (TInt i = 0 ; i < mimetypesCount; i++ ) { HBufC8* tempBuf8 = HBufC8::NewLC( aStream, aStream.ReadUint32L() ); mimetypes->AppendL( *tempBuf8 ); CleanupStack::PopAndDestroy(); // tempBuf8 } delete iInfo->iMimeVersions; iInfo->iMimeVersions = NULL; TInt mimeversCount = aStream.ReadUint32L(); CDesC8Array* mimevers = new (ELeave) CDesC8ArrayFlat( Max<TInt>( 2, mimeversCount ) ); CleanupStack::PushL( mimevers ); for (TInt i = 0 ; i < mimeversCount; i++ ) { HBufC8* tempBuf8 = HBufC8::NewLC( aStream, aStream.ReadUint32L() ); mimevers->AppendL( *tempBuf8 ); CleanupStack::PopAndDestroy(); // tempBuf8 } iInfo->iMimeTypes = mimetypes; iInfo->iMimeVersions = mimevers; CleanupStack::Pop(2); // mimetypes, mimevers }
// ----------------------------------------------------------------------------- // CUpnpSsdpServer::ResponseL // // ----------------------------------------------------------------------------- // void CUpnpSsdpServer::ResponseL(CUpnpSsdpMessage* aMsg) { if ( !aMsg ) { return; } // a search message is received // seek for devices and services matching to the search // get device list from message handler RPointerArray<CUpnpDeviceLibraryElement>& devs = iSsdpServerObserver->DeviceList(); TInt devCount=0; // get number of devices devCount=devs.Count(); TInt j=0; for(j=0;j<devCount;j++) { CUpnpDeviceLibraryElement* dev = (CUpnpDeviceLibraryElement*) devs[j]; if (dev->Local()) { // for every device // make this device respond if needed SingleDeviceResponseL(dev, aMsg); // get the service list of this device CDesC8Array* services = &dev->ServiceList(); // get the first service for(TInt i=0; i<services->Count(); i++) { TPtrC8 serviceType = (*services)[i]; SingleServiceResponseL(dev, serviceType, aMsg); } } } }
// --------------------------------------------------------------------------- // CNATFWIceSettings::SetUtilityPluginsL // --------------------------------------------------------------------------- // void CNATFWIceSettings::SetUtilityPluginsL( const CDesC8Array& aUtilityPlugins ) { __ASSERT_ALWAYS( &aUtilityPlugins, User::Leave( KErrArgument ) ); iUtilityPlugins->Reset(); TInt pluginIdCount = aUtilityPlugins.Count(); for ( TInt i( 0 ); i < pluginIdCount; ++i ) { iUtilityPlugins->AppendL( aUtilityPlugins[ i ] ); } }
void CRuleManager::ReadFromFile(const TDesC8& aFile,TInt aPos,CRule* aRule) { CDesC8Array *array = CCommonUtils::SplitText(aFile.Left(aPos),KCharRuleSymbolSplit); if (array->Count() == 6) { CRule* rule = aRule; HBufC* name = CCommonUtils::ConvertToUnicodeFromUTF8((*array)[0]); rule->SetName(name->Des()); delete name; TInt uid = CCommonUtils::StrToInt((*array)[1]); rule->SetUid(TUid::Uid(uid)); TInt type = CCommonUtils::StrToInt((*array)[2]); rule->SetType(type); if (type == 0) { TInt countdown = CCommonUtils::StrToInt((*array)[3]); rule->SetCountDown(countdown); } else { TTime time; TBuf<8> timetxt; timetxt.Copy((*array)[3]); TimeSet(timetxt,time); rule->SetClock(time); } HBufC* rulename = CCommonUtils::ConvertToUnicodeFromUTF8((*array)[4]); rule->SetRuleName(rulename->Des()); delete rulename; TInt lunch = CCommonUtils::StrToInt((*array)[5]); rule->SetLunchRun(lunch); } delete array; }
// --------------------------------------------------------------------------- // CStunTurnTests::ConstructL // Symbian 2nd phase constructor can leave. // --------------------------------------------------------------------------- // void CStunTurnTests::ConstructL( const TDesC8& aDomain, const CDesC8Array& aPlugins ) { iTestDomain = aDomain.AllocL(); iPlugins = new ( ELeave ) CDesC8ArrayFlat( KDefaultGranularity ); TInt count = aPlugins.Count(); for ( TInt i( 0 ); i < count; i++ ) { iPlugins->AppendL( aPlugins[i] ); } }
void CSdlAppUi::AddCmdLineParamsL(CDesC8Array& aArgs) { _LIT8(KAddonParam, "--addondir=?:\\uqm-addons"); _LIT16(KTestFolder, "?:\\uqm-addons"); RFs fs; fs.Connect(); for (TInt8 c = 'e'; c < 'z'; ++c) { TBuf16<32> buf(KTestFolder); buf[0] = c; if (BaflUtils::FolderExists(fs, buf)) { TBuf8<32> arg(KAddonParam); arg[11] = c; aArgs.AppendL(arg); break; } } fs.Close(); }
// ----------------------------------------------------------------------------- // CUpnpSsdpServer::SingleDeviceAdvertiseByebyeL // // ----------------------------------------------------------------------------- // void CUpnpSsdpServer::SingleDeviceAdvertiseByebyeL(CUpnpDeviceLibraryElement& aDev) { HBufC8* nt=NULL; HBufC8* usn=NULL; CDesC8Array* services = &aDev.ServiceList(); if (aDev.IsRootDevice()) { nt=HBufC8::NewLC(KUPnPRootDevice().Length()); nt->Des().Copy(KUPnPRootDevice()); usn=HBufC8::NewLC(KUPnPUuid().Length() +aDev.UUID().Length() +UpnpString::KDblColon().Length() +KUPnPRootDevice().Length()); usn->Des().Zero(); usn->Des().Append(KUPnPUuid()); usn->Des().Append(aDev.UUID()); usn->Des().Append(UpnpString::KDblColon()); usn->Des().Append(KUPnPRootDevice()); SendAdvertiseByebyeL(*nt, *usn); CleanupStack::PopAndDestroy(usn); usn=NULL; CleanupStack::PopAndDestroy(nt); nt=NULL; } nt=HBufC8::NewLC(KUPnPUuid().Length()+aDev.UUID().Length()); nt->Des().Zero(); nt->Des().Append(KUPnPUuid()); nt->Des().Append(aDev.UUID()); usn=HBufC8::NewLC(KUPnPUuid().Length()+aDev.UUID().Length()); usn->Des().Zero(); usn->Des().Append(KUPnPUuid()); usn->Des().Append(aDev.UUID()); SendAdvertiseByebyeL(*nt, *usn); CleanupStack::PopAndDestroy(usn); usn=NULL; CleanupStack::PopAndDestroy(nt); nt=NULL; nt=HBufC8::NewLC(aDev.DeviceType().Length()); nt->Des().Zero(); nt->Des().Append(aDev.DeviceType()); usn=HBufC8::NewLC(KUPnPUuid().Length() +aDev.UUID().Length() +UpnpString::KDblColon().Length() +aDev.DeviceType().Length()); usn->Des().Zero(); usn->Des().Append(KUPnPUuid()); usn->Des().Append(aDev.UUID()); usn->Des().Append(UpnpString::KDblColon()); usn->Des().Append(aDev.DeviceType()); SendAdvertiseByebyeL(*nt, *usn); CleanupStack::PopAndDestroy(usn); usn=NULL; CleanupStack::PopAndDestroy(nt); nt=NULL; TInt i=0; if(!services) { return; } TInt NumOfServices=services->Count(); for(i=0; i<NumOfServices; i++) { nt=HBufC8::NewLC(KUPnPServiceSchema().Length() +(*services)[i].Length()); nt->Des().Zero(); nt->Des().Append(KUPnPServiceSchema()); nt->Des().Append((*services)[i]); usn=HBufC8::NewLC(KUPnPUuid().Length() +aDev.UUID().Length() +UpnpString::KDblColon().Length() +KUPnPServiceSchema().Length() +(*services)[i].Length()); usn->Des().Zero(); usn->Des().Append(KUPnPUuid()); usn->Des().Append(aDev.UUID()); usn->Des().Append(UpnpString::KDblColon()); usn->Des().Append(KUPnPServiceSchema()); usn->Des().Append((*services)[i]); SendAdvertiseByebyeL(*nt, *usn); CleanupStack::PopAndDestroy(usn); usn=NULL; CleanupStack::PopAndDestroy(nt); nt=NULL; } }
// -------------------------------------------------------------------------- // UPnPDlnaUtility::GetSupportedProfilesL // Returns Supported dlna profiles, Only player mode supported. // -------------------------------------------------------------------------- EXPORT_C CDesC8Array& UPnPDlnaUtility::GetSupportedProfilesL( const TDlnaMode aMode ) { CDesC8Array* array = new (ELeave) CDesC8ArrayFlat( 10 ); CleanupStack::PushL( array ); // At the m switch( aMode ) { case EDMPMode: { // Video profiles that can be played on device array->AppendL( KAvcMp4BlCif15Aac520() ); array->AppendL( KMpeg4H2633gppP3L10Amr() ); array->AppendL( KMpeg4P23gppSpL0bAmr() ); array->AppendL( KMpeg4P2Mp4AspAac() ); array->AppendL( KMpeg4P2Mp4AspHeaac() ); array->AppendL( KMpeg4P2Mp4AspL4SoAac() ); array->AppendL( KMpeg4P2Mp4AspL4SoHeaac() ); array->AppendL( KMpeg4P2Mp4SpVgaAac() ); array->AppendL( KMpeg4P2Mp4AspL4SoHeaac() ); array->AppendL( KMpeg4P2Mp4SpVgaAac() ); array->AppendL( KMpeg4P2Mp4SpVgaHeaac() ); array->AppendL( KMpeg4P2Mp4SpL2Aac() ); array->AppendL( KMpeg4P2Mp4spAac() ); array->AppendL( KMpeg4P23gppSpL0bAac() ); array->AppendL( KAvcMp4BlCif15Aac() ); array->AppendL( KAvcMp4BlCif15AacLtp() ); array->AppendL( KAvcMp4BlCif15AacLtp520() ); array->AppendL( KAvcMp4BlCif30Aac940() ); array->AppendL( KAvcMp4BlL12Cif15Heaac() ); array->AppendL( KAvcTSBlCif15Aac() ); // Audio profiles that can be played on device array->AppendL( KAacIso() ); array->AppendL( KAacIso320() ); array->AppendL( KAacAdts() ); array->AppendL( KAacAdts320() ); array->AppendL( KAacMult5Iso() ); array->AppendL( KHeaacL2Iso() ); array->AppendL( KHeaacL2Iso320() ); array->AppendL( KHeaacL2Adts() ); array->AppendL( KHeaacL2Adts320() ); array->AppendL( KAmr3gpp() ); array->AppendL( KAmrWbplus() ); array->AppendL( KMp3() ); array->AppendL( KMp3x() ); array->AppendL( KWmaBase() ); array->AppendL( KWmaFull() ); // Image profiles that can be played on device array->AppendL( KJpegLrg() ); array->AppendL( KJpegMed() ); array->AppendL( KJpegSm() ); array->AppendL( KPngLrg() ); //fix for EFCG-7E2DKU array->AppendL( KJpegLrgIco() ); array->AppendL( KJpegSmIco() ); array->AppendL( KJpegTn() ); array->AppendL( KPngTn() ); array->AppendL( KPngSmIco() ); array->AppendL( KPngLrgIco() ); break; } case EDMSMode: case EDMUMode: case EDMDMode: default: { User::Leave( KErrNotSupported ); break; } } CleanupStack::Pop( array ); return *array; }
// ----------------------------------------------------------------------------- // TMCETestUIEngineCmdTerminateEvent::ExecuteL // ----------------------------------------------------------------------------- // EXPORT_C void TMCETestUIEngineCmdTerminateEvent::ExecuteL() { TNotifyValues notifyValues; if( iEngine.NotifyValues( notifyValues) ) { CDesC8Array* headers; headers = new (ELeave) CDesC8ArrayFlat( 1 ); CleanupStack::PushL( headers ); CMCETestUIQuestionDataQuery* question = CMCETestUIQuestionDataQuery::NewLC(); question->SetCaptionL( KUserQuestionInputEventHeader ); question->SetDefaultValueL(notifyValues.headers ); question->SetAnswerL( notifyValues.headers ); TBufC8<100> headersbuffer( question->Answer8() ); CleanupStack::PopAndDestroy( question ); headers->AppendL( headersbuffer ); /* CMCETestUIQuestionDataQuery* question2 = CMCETestUIQuestionDataQuery::NewLC(); question2->SetCaptionL( KUserQuestionInputEventContentType ); question2->SetDefaultValueL(notifyValues.contentType ); question2->SetAnswerL( notifyValues.contentType ); HBufC8 *contentType = HBufC8::NewLC( question2->Answer8().Length() ); contentType->Des().Copy( question2->Answer8() ); CleanupStack::PopAndDestroy( question2 ); CMCETestUIQuestionDataQuery* question3 = CMCETestUIQuestionDataQuery::NewLC(); question3->SetCaptionL( KUserQuestionInputEventContent ); question3->SetDefaultValueL(notifyValues.contentType ); question3->SetAnswerL( notifyValues.contentType ); HBufC8 *content = HBufC8::NewLC( question3->Answer8().Length() ); content->Des().Copy( question3->Answer8() ); CleanupStack::PopAndDestroy( question3 ); CleanupStack::Pop( content ); CleanupStack::Pop( contentType ); */ HBufC8 *contentType = HBufC8::NewLC( KNotifyContentType().Length() ); contentType->Des().Copy( KNotifyContentType ); HBufC8 *content = HBufC8::NewLC( KNotifyContent().Length() ); content->Des().Copy( KNotifyContent ); CleanupStack::Pop( content ); CleanupStack::Pop( contentType ); CleanupStack::Pop( headers ); if( headers == 0 ) { MCE_TESTUI_DEBUG1( "Terminate Event with values"); iEvent.Event().TerminateL( headers, contentType, content ); } else { MCE_TESTUI_DEBUG1( "Terminate Event without values"); iEvent.Event().TerminateL( ); } iEngine.EngineStateChangedL(); } }
void TCmdAddAudioStream::ExecuteL() { // ---------- Setup -------------------------------------------------------- // Get session CMceSession* session = reinterpret_cast<CMceSession*> (GetObjectForIdL(KSessionId, ETrue)); // Get existing stream CMceMediaStream* mainStream = reinterpret_cast<CMceMediaStream*> (GetObjectForIdL(KStreamId, EFalse)); TBool suppressRtcp = ExtractBooleanL( KParamSuppressRtcp, EFalse ); //source path for audiofile TPtrC8 pathAudioFile = ExtractTextL( KParamAudioFileSource, EFalse ); //get path for media file sink TPtrC8 mediaFileSink = ExtractTextL( KParamMediaFileSink, EFalse ); // ---------- Execution ---------------------------------------------------- CMceAudioStream* audioStream = CMceAudioStream::NewLC(); // Add source TPtrC8 source = ExtractTextL( KParamSource, EFalse ); if (source == KValueSourceRTP ) { CMceRtpSource* rtpSource = CMceRtpSource::NewLC(); audioStream->SetSourceL(rtpSource); CleanupStack::Pop(rtpSource); } else if (source == KValueSourceMic ) { CMceMicSource* mic = CMceMicSource::NewLC(); audioStream->SetSourceL(mic); CleanupStack::Pop(mic); } else if (pathAudioFile.Compare( KNullDesC8 ) != 0) { // If source path was defined use the file audio specified in path iSessionHelper.SetMediaFileSourceL( iContext.MCEManager(), *audioStream, pathAudioFile ); } else { if( mediaFileSink.Compare( KNullDesC8 ) == 0 ) User::Leave( KErrNotSupported ); } // Add sinks CDesC8Array* sinks = ExtractArrayL( KParamSinks, EFalse ); if ( sinks ) { CleanupStack::PushL( sinks ); for ( TInt i = 0; i < sinks->Count(); i++ ) { if ( (*sinks)[i] == KValueSinkRTP ) { //CMceRtpSink* rtpSink = CMceRtpSink::NewLC(); //enable all RtpSink with RTCP CMceRtpSink* rtpSink = CMceRtpSink::NewL(suppressRtcp); CleanupStack::PushL(rtpSink); audioStream->AddSinkL(rtpSink); CleanupStack::Pop(rtpSink); } else if ( (*sinks)[i] == KValueSinkSpeaker ) { CMceSpeakerSink* speaker = CMceSpeakerSink::NewLC(); audioStream->AddSinkL(speaker); CleanupStack::Pop(speaker); } else if ( (*sinks)[i] == KValueSinkFile ) { const RPointerArray<CMceMediaStream>& streams = session->Streams(); for ( TInt i = 0; i < streams.Count(); ++i ) { CMceMediaStream* tmpStream; tmpStream = streams[i]; if ( tmpStream->Type() == KMceAudio ) { //use the same source which was used for outgoing audio stream if( tmpStream->Source()->Type() != KMceRTPSource ) { audioStream->SetSourceL( tmpStream->Source() ); } else { if(tmpStream->BoundStream()) if( tmpStream->BoundStreamL().Source()->Type() != KMceRTPSource ) audioStream->SetSourceL(tmpStream->BoundStreamL().Source()); } break; } } if( mediaFileSink.Compare( KNullDesC8 ) != 0 ) { iSessionHelper.SetMediaFileSinkL(*audioStream, mediaFileSink); } else { iSessionHelper.SetMediaFileSinkL(*audioStream, TPtrC8( KTestAudioFileName )); } session->AddStreamL(audioStream); } else { User::Leave( KErrNotSupported ); } } CleanupStack::PopAndDestroy( sinks ); } // Modify codecs CDesC8Array* codecs = ExtractArrayL( KParamCodecs, EFalse ); if ( codecs ) { CleanupStack::PushL( codecs ); if ( codecs->Count() > 0) { const RPointerArray<CMceAudioCodec>& streamCodecs = audioStream->Codecs(); if ( (*codecs)[0] == KValueCodecNone ) { // Remove all codecs from stream for (TInt i = 0; i < streamCodecs.Count(); i++ ) { // No implementation yet in MMCE audioStream->RemoveCodecL( *(streamCodecs[i]) ); } } if ( (*codecs)[0] != KValueCodecNone && (*codecs)[0] != KValueCodecAll ) { for (TInt i = 0; i < codecs->Count(); i++ ) { audioStream->AddCodecL( GetAudioCodecCloneL( (*codecs)[i] ) ); } } } CleanupStack::PopAndDestroy( codecs ); } // Add streams if (mainStream) { mainStream->BindL( audioStream ); //if there are no codecs in the stream already, all the codecs will be //added to stream by mce. //Note: streams needs to be bound before adding stream to session session->AddStreamL( mainStream ); } else { //NOOP } CleanupStack::Pop( audioStream ); // ---------- Response creation -------------------------------------------- AddIdResponseL(KSessionId, session); // uses CleanupStack internally AddIdResponseL(KStreamId, *audioStream); }
// --------------------------------------------------------------------------- // UT_CNSPController::UT_ReplaceArrayL // --------------------------------------------------------------------------- // void UT_CNSPController::UT_ReplaceArrayL() { _LIT8( KSTUNandICE, "nokia.stun,nokia.ice" ); _LIT8( KInvalidSpacing, "nokia.turn , nokia.ice" ); _LIT8( KInvalidSpacing2, "nokia.turn , nokia.ice,nokia.stun" ); _LIT8( KInvalidSpacing3, " nokia.turn , nokia.ice,nokia.stun" ); _LIT8( KEmptySpace, " " ); CDesC8Array* protocols = new (ELeave) CDesC8ArrayFlat( 5 ); CleanupStack::PushL( protocols ); // OK, ICE NSP_ASSERT_NO_LEAVE( iController->ReplaceArrayL( *protocols, KICE() ) ); NSP_ASSERT( 1 == protocols->MdcaCount() ); NSP_ASSERT( !protocols->MdcaPoint( 0 ).Compare( KICE() ) ); // OK, STUN & ICE NSP_ASSERT_NO_LEAVE( iController->ReplaceArrayL( *protocols, KSTUNandICE() ) ); NSP_ASSERT( 2 == protocols->MdcaCount() ); NSP_ASSERT( !protocols->MdcaPoint( 0 ).Compare( KSTUN() ) ); NSP_ASSERT( !protocols->MdcaPoint( 1 ).Compare( KICE() ) ); // OK, TURN & ICE, WITH INVALID SPACING IN STRING NSP_ASSERT_NO_LEAVE( iController->ReplaceArrayL( *protocols, KInvalidSpacing() ) ); NSP_ASSERT( 2 == protocols->MdcaCount() ); NSP_ASSERT( !protocols->MdcaPoint( 0 ).Compare( KTURN() ) ); NSP_ASSERT( !protocols->MdcaPoint( 1 ).Compare( KICE() ) ); // OK, TURN & ICE & STUN, WITH INVALID SPACING IN STRING NSP_ASSERT_NO_LEAVE( iController->ReplaceArrayL( *protocols, KInvalidSpacing2() ) ); NSP_ASSERT( 3 == protocols->MdcaCount() ); NSP_ASSERT( !protocols->MdcaPoint( 0 ).Compare( KTURN() ) ); NSP_ASSERT( !protocols->MdcaPoint( 1 ).Compare( KICE() ) ); NSP_ASSERT( !protocols->MdcaPoint( 2 ).Compare( KSTUN() ) ); // OK, TURN & ICE & STUN, WITH INVALID SPACING IN STRING NSP_ASSERT_NO_LEAVE( iController->ReplaceArrayL( *protocols, KInvalidSpacing3() ) ); NSP_ASSERT( 3 == protocols->MdcaCount() ); NSP_ASSERT( !protocols->MdcaPoint( 0 ).Compare( KTURN() ) ); NSP_ASSERT( !protocols->MdcaPoint( 1 ).Compare( KICE() ) ); NSP_ASSERT( !protocols->MdcaPoint( 2 ).Compare( KSTUN() ) ); // FAILURE IN CENREP SETTINGS, IN APROTOCOL NSP_ASSERT_LEAVE( iController->ReplaceArrayL( *protocols, KEmptySpace() ) ); NSP_ASSERT( 0 == protocols->MdcaCount() ); NSP_ASSERT_LEAVE( iController->ReplaceArrayL( *protocols, KNullDesC8() ) ); NSP_ASSERT( 0 == protocols->MdcaCount() ); CleanupStack::PopAndDestroy( protocols ); }