Update contrib.
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include <mmf/common/mmfaudio.h>
17 #include "mmfstandardcustomcommands.h"
18 #include "MMFVideoFrameMessage.h"
19 #include "MMFSCCPanicCodes.h"
22 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
23 #include <mmf/common/mmfstandardcustomcommandsenums.h>
24 #include <mmf/common/mmfstandardcustomcommandsimpl.h>
25 #include <mmf/common/mmfvideoenums.h>
29 const TInt KBufExpandSize8 = 8;//two TInts!
30 const TInt KBufExpandSize32 = 32;
32 const TInt KBufMimeTypeGranularity = 4;
33 const TInt KMaxMimeTypeLength = 256;
35 class TMimeTypeBufferInfo
42 EXPORT_C RMMFAudioPlayDeviceCustomCommands::RMMFAudioPlayDeviceCustomCommands(RMMFController& aController) :
43 RMMFCustomCommandsBase(aController, KUidInterfaceMMFAudioPlayDevice)
47 EXPORT_C TInt RMMFAudioPlayDeviceCustomCommands::SetVolume(TInt aVolume) const
49 TPckgBuf<TMMFAudioConfig> configPackage;
50 configPackage().iVolume = aVolume;
51 return iController.CustomCommandSync(iDestinationPckg,
52 EMMFAudioPlayDeviceSetVolume,
58 EXPORT_C TInt RMMFAudioPlayDeviceCustomCommands::GetMaxVolume(TInt& aMaxVolume) const
60 TPckgBuf<TMMFAudioConfig> configPackage;
61 TInt error = iController.CustomCommandSync(iDestinationPckg,
62 EMMFAudioPlayDeviceGetMaxVolume,
67 aMaxVolume = configPackage().iMaxVolume;
71 EXPORT_C TInt RMMFAudioPlayDeviceCustomCommands::GetVolume(TInt& aVolume) const
73 TPckgBuf<TMMFAudioConfig> configPackage;
74 TInt error = iController.CustomCommandSync(iDestinationPckg,
75 EMMFAudioPlayDeviceGetVolume,
80 aVolume = configPackage().iVolume;
84 EXPORT_C TInt RMMFAudioPlayDeviceCustomCommands::SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration) const
86 TPckgBuf<TMMFAudioConfig> configPackage;
87 configPackage().iRampDuration = aRampDuration;
88 return iController.CustomCommandSync(iDestinationPckg,
89 EMMFAudioPlayDeviceSetVolumeRamp,
94 EXPORT_C TInt RMMFAudioPlayDeviceCustomCommands::SetBalance(TInt aBalance) const
96 TPckgBuf<TMMFAudioConfig> configPackage;
97 configPackage().iBalance = aBalance;
98 return iController.CustomCommandSync(iDestinationPckg,
99 EMMFAudioPlayDeviceSetBalance,
104 EXPORT_C TInt RMMFAudioPlayDeviceCustomCommands::GetBalance(TInt& aBalance) const
106 TPckgBuf<TMMFAudioConfig> configPackage;
107 TInt error = iController.CustomCommandSync(iDestinationPckg,
108 EMMFAudioPlayDeviceGetBalance,
113 aBalance = configPackage().iBalance;
117 EXPORT_C CMMFAudioPlayDeviceCustomCommandParser* CMMFAudioPlayDeviceCustomCommandParser::NewL(MMMFAudioPlayDeviceCustomCommandImplementor& aImplementor)
119 return new(ELeave) CMMFAudioPlayDeviceCustomCommandParser(aImplementor);
122 EXPORT_C CMMFAudioPlayDeviceCustomCommandParser::~CMMFAudioPlayDeviceCustomCommandParser()
126 CMMFAudioPlayDeviceCustomCommandParser::CMMFAudioPlayDeviceCustomCommandParser(MMMFAudioPlayDeviceCustomCommandImplementor& aImplementor) :
127 CMMFCustomCommandParserBase(KUidInterfaceMMFAudioPlayDevice),
128 iImplementor(aImplementor)
133 void CMMFAudioPlayDeviceCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
135 if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFAudioPlayDevice)
137 TRAPD(error, DoHandleRequestL(aMessage));
139 aMessage.Complete(error);
143 aMessage.Complete(KErrNotSupported);
147 void CMMFAudioPlayDeviceCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
149 TBool complete = ETrue;
150 switch (aMessage.Function())
152 case EMMFAudioPlayDeviceSetVolume:
153 complete = DoSetVolumeL(aMessage);
155 case EMMFAudioPlayDeviceGetMaxVolume:
156 complete = DoGetMaxVolumeL(aMessage);
158 case EMMFAudioPlayDeviceGetVolume:
159 complete = DoGetVolumeL(aMessage);
161 case EMMFAudioPlayDeviceSetVolumeRamp:
162 complete = DoSetVolumeRampL(aMessage);
164 case EMMFAudioPlayDeviceSetBalance:
165 complete = DoSetBalanceL(aMessage);
167 case EMMFAudioPlayDeviceGetBalance:
168 complete = DoGetBalanceL(aMessage);
171 User::Leave(KErrNotSupported);
175 aMessage.Complete(KErrNone);
179 TBool CMMFAudioPlayDeviceCustomCommandParser::DoSetVolumeL(TMMFMessage& aMessage)
181 TPckgBuf<TMMFAudioConfig> pckg;
182 aMessage.ReadData1FromClientL(pckg);
183 iImplementor.MapdSetVolumeL(pckg().iVolume);
187 TBool CMMFAudioPlayDeviceCustomCommandParser::DoGetMaxVolumeL(TMMFMessage& aMessage)
190 iImplementor.MapdGetMaxVolumeL(maxVol);
191 TPckgBuf<TMMFAudioConfig> pckg;
192 pckg().iMaxVolume = maxVol;
193 aMessage.WriteDataToClientL(pckg);
197 TBool CMMFAudioPlayDeviceCustomCommandParser::DoGetVolumeL(TMMFMessage& aMessage)
200 iImplementor.MapdGetVolumeL(vol);
201 TPckgBuf<TMMFAudioConfig> pckg;
202 pckg().iVolume = vol;
203 aMessage.WriteDataToClientL(pckg);
207 TBool CMMFAudioPlayDeviceCustomCommandParser::DoSetVolumeRampL(TMMFMessage& aMessage)
209 TPckgBuf<TMMFAudioConfig> pckg;
210 aMessage.ReadData1FromClientL(pckg);
211 iImplementor.MapdSetVolumeRampL(pckg().iRampDuration);
215 TBool CMMFAudioPlayDeviceCustomCommandParser::DoSetBalanceL(TMMFMessage& aMessage)
217 TPckgBuf<TMMFAudioConfig> pckg;
218 aMessage.ReadData1FromClientL(pckg);
219 iImplementor.MapdSetBalanceL(pckg().iBalance);
223 TBool CMMFAudioPlayDeviceCustomCommandParser::DoGetBalanceL(TMMFMessage& aMessage)
226 iImplementor.MapdGetBalanceL(bal);
227 TPckgBuf<TMMFAudioConfig> pckg;
228 pckg().iBalance = bal;
229 aMessage.WriteDataToClientL(pckg);
255 EXPORT_C RMMFAudioRecordDeviceCustomCommands::RMMFAudioRecordDeviceCustomCommands(RMMFController& aController) :
256 RMMFCustomCommandsBase(aController, KUidInterfaceMMFAudioRecordDevice)
260 EXPORT_C TInt RMMFAudioRecordDeviceCustomCommands::SetGain(TInt aGain) const
262 TPckgBuf<TMMFAudioConfig> configPackage;
263 configPackage().iGain = aGain;
264 return iController.CustomCommandSync(iDestinationPckg,
265 EMMFAudioRecordDeviceSetGain,
270 EXPORT_C TInt RMMFAudioRecordDeviceCustomCommands::GetMaxGain(TInt& aMaxGain) const
272 TPckgBuf<TMMFAudioConfig> configPackage;
273 TInt error = iController.CustomCommandSync(iDestinationPckg,
274 EMMFAudioRecordDeviceGetMaxGain,
279 aMaxGain = configPackage().iMaxGain;
283 EXPORT_C TInt RMMFAudioRecordDeviceCustomCommands::GetGain(TInt& aGain) const
285 TPckgBuf<TMMFAudioConfig> configPackage;
286 TInt error = iController.CustomCommandSync(iDestinationPckg,
287 EMMFAudioRecordDeviceGetGain,
292 aGain = configPackage().iGain;
296 EXPORT_C TInt RMMFAudioRecordDeviceCustomCommands::SetBalance(TInt aBalance) const
298 TPckgBuf<TMMFAudioConfig> configPackage;
299 configPackage().iBalance = aBalance;
300 return iController.CustomCommandSync(iDestinationPckg,
301 EMMFAudioRecordDeviceSetBalance,
306 EXPORT_C TInt RMMFAudioRecordDeviceCustomCommands::GetBalance(TInt& aBalance) const
308 TPckgBuf<TMMFAudioConfig> configPackage;
309 TInt error = iController.CustomCommandSync(iDestinationPckg,
310 EMMFAudioRecordDeviceGetBalance,
315 aBalance = configPackage().iBalance;
319 EXPORT_C CMMFAudioRecordDeviceCustomCommandParser* CMMFAudioRecordDeviceCustomCommandParser::NewL(MMMFAudioRecordDeviceCustomCommandImplementor& aImplementor)
321 return new(ELeave) CMMFAudioRecordDeviceCustomCommandParser(aImplementor);
324 CMMFAudioRecordDeviceCustomCommandParser::CMMFAudioRecordDeviceCustomCommandParser(MMMFAudioRecordDeviceCustomCommandImplementor& aImplementor) :
325 CMMFCustomCommandParserBase(KUidInterfaceMMFAudioRecordDevice),
326 iImplementor(aImplementor)
330 EXPORT_C CMMFAudioRecordDeviceCustomCommandParser::~CMMFAudioRecordDeviceCustomCommandParser()
334 void CMMFAudioRecordDeviceCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
336 if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFAudioRecordDevice)
338 TRAPD(error, DoHandleRequestL(aMessage));
340 aMessage.Complete(error);
344 aMessage.Complete(KErrNotSupported);
348 void CMMFAudioRecordDeviceCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
350 TBool complete = ETrue;
351 switch (aMessage.Function())
353 case EMMFAudioRecordDeviceSetGain:
354 complete = DoSetGainL(aMessage);
356 case EMMFAudioRecordDeviceGetMaxGain:
357 complete = DoGetMaxGainL(aMessage);
359 case EMMFAudioRecordDeviceGetGain:
360 complete = DoGetGainL(aMessage);
362 case EMMFAudioRecordDeviceSetBalance:
363 complete = DoSetBalanceL(aMessage);
365 case EMMFAudioRecordDeviceGetBalance:
366 complete = DoGetBalanceL(aMessage);
369 User::Leave(KErrNotSupported);
373 aMessage.Complete(KErrNone);
376 TBool CMMFAudioRecordDeviceCustomCommandParser::DoSetGainL(TMMFMessage& aMessage)
378 TPckgBuf<TMMFAudioConfig> pckg;
379 aMessage.ReadData1FromClientL(pckg);
380 iImplementor.MardSetGainL(pckg().iGain);
384 TBool CMMFAudioRecordDeviceCustomCommandParser::DoGetMaxGainL(TMMFMessage& aMessage)
387 iImplementor.MardGetMaxGainL(maxGain);
388 TPckgBuf<TMMFAudioConfig> pckg;
389 pckg().iMaxGain = maxGain;
390 aMessage.WriteDataToClientL(pckg);
394 TBool CMMFAudioRecordDeviceCustomCommandParser::DoGetGainL(TMMFMessage& aMessage)
397 iImplementor.MardGetGainL(gain);
398 TPckgBuf<TMMFAudioConfig> pckg;
400 aMessage.WriteDataToClientL(pckg);
404 TBool CMMFAudioRecordDeviceCustomCommandParser::DoSetBalanceL(TMMFMessage& aMessage)
406 TPckgBuf<TMMFAudioConfig> pckg;
407 aMessage.ReadData1FromClientL(pckg);
408 iImplementor.MardSetBalanceL(pckg().iBalance);
412 TBool CMMFAudioRecordDeviceCustomCommandParser::DoGetBalanceL(TMMFMessage& aMessage)
415 iImplementor.MardGetBalanceL(balance);
416 TPckgBuf<TMMFAudioConfig> pckg;
417 pckg().iBalance = balance;
418 aMessage.WriteDataToClientL(pckg);
442 EXPORT_C RMMFAudioPlayControllerCustomCommands::RMMFAudioPlayControllerCustomCommands(RMMFController& aController) :
443 RMMFCustomCommandsBase(aController, KUidInterfaceMMFAudioPlayController)
447 EXPORT_C TInt RMMFAudioPlayControllerCustomCommands::SetPlaybackWindow(const TTimeIntervalMicroSeconds& aStart, const TTimeIntervalMicroSeconds& aEnd) const
449 TPckgBuf<TMMFAudioConfig> configPackage;
450 configPackage().iStartPosition = aStart;
451 configPackage().iEndPosition = aEnd;
452 return iController.CustomCommandSync(iDestinationPckg,
453 EMMFAudioPlayControllerSetPlaybackWindow,
459 EXPORT_C TInt RMMFAudioPlayControllerCustomCommands::DeletePlaybackWindow()
461 return iController.CustomCommandSync(iDestinationPckg,
462 EMMFAudioPlayControllerDeletePlaybackWindow,
467 EXPORT_C TInt RMMFAudioPlayControllerCustomCommands::GetLoadingProgress(TInt& aPercentageComplete) const
469 TPckgBuf<TMMFAudioConfig> configPackage;
470 TInt error = iController.CustomCommandSync(iDestinationPckg,
471 EMMFAudioPlayControllerGetLoadingProgress,
476 aPercentageComplete = configPackage().iLoadingCompletePercentage;
482 EXPORT_C CMMFAudioPlayControllerCustomCommandParser* CMMFAudioPlayControllerCustomCommandParser::NewL(MMMFAudioPlayControllerCustomCommandImplementor& aImplementor)
484 return new(ELeave) CMMFAudioPlayControllerCustomCommandParser(aImplementor);
487 CMMFAudioPlayControllerCustomCommandParser::CMMFAudioPlayControllerCustomCommandParser(MMMFAudioPlayControllerCustomCommandImplementor& aImplementor) :
488 CMMFCustomCommandParserBase(KUidInterfaceMMFAudioPlayController),
489 iImplementor(aImplementor)
493 EXPORT_C CMMFAudioPlayControllerCustomCommandParser::~CMMFAudioPlayControllerCustomCommandParser()
497 void CMMFAudioPlayControllerCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
499 if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFAudioPlayController)
501 TRAPD(error, DoHandleRequestL(aMessage));
503 aMessage.Complete(error);
507 aMessage.Complete(KErrNotSupported);
511 void CMMFAudioPlayControllerCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
513 TBool complete = ETrue;
514 switch (aMessage.Function())
516 case EMMFAudioPlayControllerSetPlaybackWindow:
517 complete = DoSetPlaybackWindowL(aMessage);
519 case EMMFAudioPlayControllerDeletePlaybackWindow:
520 complete = DoDeletePlaybackWindowL(aMessage);
522 case EMMFAudioPlayControllerGetLoadingProgress:
523 complete = DoGetLoadingProgressL(aMessage);
526 User::Leave(KErrNotSupported);
530 aMessage.Complete(KErrNone);
533 TBool CMMFAudioPlayControllerCustomCommandParser::DoSetPlaybackWindowL(TMMFMessage& aMessage)
535 TPckgBuf<TMMFAudioConfig> pckg;
536 aMessage.ReadData1FromClientL(pckg);
537 iImplementor.MapcSetPlaybackWindowL(pckg().iStartPosition, pckg().iEndPosition);
541 TBool CMMFAudioPlayControllerCustomCommandParser::DoDeletePlaybackWindowL(TMMFMessage& /*aMessage*/)
543 iImplementor.MapcDeletePlaybackWindowL();
547 TBool CMMFAudioPlayControllerCustomCommandParser::DoGetLoadingProgressL(TMMFMessage& aMessage)
550 iImplementor.MapcGetLoadingProgressL(progress);
551 TPckgBuf<TMMFAudioConfig> pckg;
552 pckg().iLoadingCompletePercentage = progress;
553 aMessage.WriteDataToClientL(pckg);
567 EXPORT_C RMMFAudioRecordControllerCustomCommands::RMMFAudioRecordControllerCustomCommands(RMMFController& aController) :
568 RMMFCustomCommandsBase(aController, KUidInterfaceMMFAudioRecordController)
572 EXPORT_C TInt RMMFAudioRecordControllerCustomCommands::GetRecordTimeAvailable(TTimeIntervalMicroSeconds& aTime) const
574 TPckgBuf<TMMFAudioConfig> configPackage;
575 TInt error = iController.CustomCommandSync(iDestinationPckg,
576 EMMFAudioRecordControllerGetRecordTimeAvailable,
581 aTime = configPackage().iRecordTimeAvailable;
585 EXPORT_C TInt RMMFAudioRecordControllerCustomCommands::SetMaxDuration(const TTimeIntervalMicroSeconds& aMaxDuration) const
587 TPckgBuf<TMMFAudioConfig> configPackage;
588 configPackage().iMaxDuration = aMaxDuration;
589 return iController.CustomCommandSync(iDestinationPckg,
590 EMMFAudioRecordControllerSetMaxDuration,
595 EXPORT_C TInt RMMFAudioRecordControllerCustomCommands::SetMaxFileSize(TInt aMaxSize) const
597 TPckgBuf<TMMFAudioConfig> configPackage;
598 configPackage().iMaxFileSize = aMaxSize;
599 return iController.CustomCommandSync(iDestinationPckg,
600 EMMFAudioRecordControllerSetMaxFileSize,
605 EXPORT_C TInt RMMFAudioRecordControllerCustomCommands::Crop(TBool aToEnd)
607 TPckgBuf<TMMFAudioConfig> configPackage;
608 configPackage().iCropToEnd = aToEnd;
609 return iController.CustomCommandSync(iDestinationPckg,
610 EMMFAudioRecordControllerCrop,
615 EXPORT_C void RMMFAudioRecordControllerCustomCommands::AddMetaDataEntryL(const CMMFMetaDataEntry& aNewEntry)
617 CBufFlat* buf = CBufFlat::NewL(KBufExpandSize32);
618 CleanupStack::PushL(buf);
621 CleanupClosePushL(s);
622 aNewEntry.ExternalizeL(s);
623 TPtr8 bufData = buf->Ptr(0);
624 User::LeaveIfError(iController.CustomCommandSync(iDestinationPckg,
625 EMMFAudioRecordControllerAddMetaDataEntry,
628 CleanupStack::PopAndDestroy(2);//s, buf
631 EXPORT_C TInt RMMFAudioRecordControllerCustomCommands::RemoveMetaDataEntry(TInt aIndex)
633 TPckgBuf<TInt> pckg(aIndex);
634 return iController.CustomCommandSync(iDestinationPckg,
635 EMMFAudioRecordControllerRemoveMetaDataEntry,
640 EXPORT_C void RMMFAudioRecordControllerCustomCommands::ReplaceMetaDataEntryL(TInt aIndex, const CMMFMetaDataEntry& aNewEntry)
642 TPckgBuf<TInt> indexPckg(aIndex);
643 CBufFlat* buf = CBufFlat::NewL(KBufExpandSize32);
644 CleanupStack::PushL(buf);
647 CleanupClosePushL(s);
648 aNewEntry.ExternalizeL(s);
649 TPtr8 bufData = buf->Ptr(0);
650 User::LeaveIfError(iController.CustomCommandSync(iDestinationPckg,
651 EMMFAudioRecordControllerReplaceMetaDataEntry,
654 CleanupStack::PopAndDestroy(2);//s, buf
657 EXPORT_C CMMFAudioRecordControllerCustomCommandParser* CMMFAudioRecordControllerCustomCommandParser::NewL(MMMFAudioRecordControllerCustomCommandImplementor& aImplementor)
659 return new(ELeave) CMMFAudioRecordControllerCustomCommandParser(aImplementor);
662 CMMFAudioRecordControllerCustomCommandParser::CMMFAudioRecordControllerCustomCommandParser(MMMFAudioRecordControllerCustomCommandImplementor& aImplementor) :
663 CMMFCustomCommandParserBase(KUidInterfaceMMFAudioRecordController),
664 iImplementor(aImplementor)
668 EXPORT_C CMMFAudioRecordControllerCustomCommandParser::~CMMFAudioRecordControllerCustomCommandParser()
672 void CMMFAudioRecordControllerCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
674 if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFAudioRecordController)
676 TRAPD(error, DoHandleRequestL(aMessage));
678 aMessage.Complete(error);
682 aMessage.Complete(KErrNotSupported);
686 void CMMFAudioRecordControllerCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
688 TBool complete = ETrue;
689 switch (aMessage.Function())
691 case EMMFAudioRecordControllerGetRecordTimeAvailable:
692 complete = DoGetRecordTimeAvailableL(aMessage);
694 case EMMFAudioRecordControllerSetMaxDuration:
695 complete = DoSetMaxDurationL(aMessage);
697 case EMMFAudioRecordControllerSetMaxFileSize:
698 complete = DoSetMaxFileSizeL(aMessage);
700 case EMMFAudioRecordControllerCrop:
701 complete = DoCropL(aMessage);
703 case EMMFAudioRecordControllerAddMetaDataEntry:
704 complete = DoAddMetaDataEntryL(aMessage);
706 case EMMFAudioRecordControllerRemoveMetaDataEntry:
707 complete = DoRemoveMetaDataEntryL(aMessage);
709 case EMMFAudioRecordControllerReplaceMetaDataEntry:
710 complete = DoReplaceMetaDataEntryL(aMessage);
713 User::Leave(KErrNotSupported);
717 aMessage.Complete(KErrNone);
720 TBool CMMFAudioRecordControllerCustomCommandParser::DoGetRecordTimeAvailableL(TMMFMessage& aMessage)
722 TTimeIntervalMicroSeconds time;
723 iImplementor.MarcGetRecordTimeAvailableL(time);
724 TPckgBuf<TMMFAudioConfig> pckg;
725 pckg().iRecordTimeAvailable = time;
726 aMessage.WriteDataToClientL(pckg);
730 TBool CMMFAudioRecordControllerCustomCommandParser::DoSetMaxDurationL(TMMFMessage& aMessage)
732 TPckgBuf<TMMFAudioConfig> pckg;
733 aMessage.ReadData1FromClientL(pckg);
734 iImplementor.MarcSetMaxDurationL(pckg().iMaxDuration);
738 TBool CMMFAudioRecordControllerCustomCommandParser::DoSetMaxFileSizeL(TMMFMessage& aMessage)
740 TPckgBuf<TMMFAudioConfig> pckg;
741 aMessage.ReadData1FromClientL(pckg);
742 iImplementor.MarcSetMaxFileSizeL(pckg().iMaxFileSize);
746 TBool CMMFAudioRecordControllerCustomCommandParser::DoCropL(TMMFMessage& aMessage)
748 TPckgBuf<TMMFAudioConfig> pckg;
749 aMessage.ReadData1FromClientL(pckg);
750 iImplementor.MarcCropL(pckg().iCropToEnd);
754 TBool CMMFAudioRecordControllerCustomCommandParser::DoAddMetaDataEntryL(TMMFMessage& aMessage)
756 TInt bufSize = aMessage.SizeOfData1FromClient();
757 // Leaving here in order to prevent a panic in the NewLC if the value is negative
758 User::LeaveIfError(bufSize);
759 HBufC8* buf = HBufC8::NewLC(bufSize);
760 TPtr8 ptr = buf->Des();
761 aMessage.ReadData1FromClientL(ptr);
762 RDesReadStream stream;
764 CleanupClosePushL(stream);
765 CMMFMetaDataEntry* metaData = CMMFMetaDataEntry::NewL();
766 CleanupStack::PushL(metaData);
767 metaData->InternalizeL(stream);
768 iImplementor.MarcAddMetaDataEntryL(*metaData);
769 CleanupStack::PopAndDestroy(3);//metaData, stream, buf
773 TBool CMMFAudioRecordControllerCustomCommandParser::DoRemoveMetaDataEntryL(TMMFMessage& aMessage)
776 aMessage.ReadData1FromClientL(pckg);
777 iImplementor.MarcRemoveMetaDataEntryL(pckg());
781 TBool CMMFAudioRecordControllerCustomCommandParser::DoReplaceMetaDataEntryL(TMMFMessage& aMessage)
784 TInt bufSize = aMessage.SizeOfData1FromClient();
785 // Leaving here in order to prevent a panic in the NewLC if the value is negative
786 User::LeaveIfError(bufSize);
787 HBufC8* buf = HBufC8::NewLC(bufSize);
788 TPtr8 ptr = buf->Des();
789 aMessage.ReadData1FromClientL(ptr);
790 RDesReadStream stream;
792 CleanupClosePushL(stream);
793 CMMFMetaDataEntry* metaData = CMMFMetaDataEntry::NewL();
794 CleanupStack::PushL(metaData);
795 metaData->InternalizeL(stream);
798 // Get index to replace
799 TPckgBuf<TInt> indexPckg;
800 aMessage.ReadData2FromClientL(indexPckg);
802 iImplementor.MarcReplaceMetaDataEntryL(indexPckg(), *metaData);
804 CleanupStack::PopAndDestroy(3);//metaData, stream, buf
824 EXPORT_C RMMFAudioControllerCustomCommands::RMMFAudioControllerCustomCommands(RMMFController& aController) :
825 RMMFCustomCommandsBase(aController, KUidInterfaceMMFAudioController)
829 EXPORT_C TInt RMMFAudioControllerCustomCommands::SetSourceSampleRate(TUint aSampleRate) const
831 TPckgBuf<TMMFAudioConfig> configPackage;
832 configPackage().iSampleRate = aSampleRate;
833 return iController.CustomCommandSync(iDestinationPckg,
834 EMMFAudioControllerSetSourceSampleRate,
839 EXPORT_C TInt RMMFAudioControllerCustomCommands::SetSourceNumChannels(TUint aNumChannels) const
841 TPckgBuf<TMMFAudioConfig> configPackage;
842 configPackage().iChannels = aNumChannels;
843 return iController.CustomCommandSync(iDestinationPckg,
844 EMMFAudioControllerSetSourceNumChannels,
849 EXPORT_C TInt RMMFAudioControllerCustomCommands::SetSourceFormat(TUid aFormatUid) const
851 TPckgBuf<TMMFAudioConfig> configPackage;
852 configPackage().iFormatUid = aFormatUid;
853 return iController.CustomCommandSync(iDestinationPckg,
854 EMMFAudioControllerSetSourceFormat,
859 EXPORT_C TInt RMMFAudioControllerCustomCommands::SetSinkSampleRate(TUint aSampleRate) const
861 TPckgBuf<TMMFAudioConfig> configPackage;
862 configPackage().iSampleRate = aSampleRate;
863 return iController.CustomCommandSync(iDestinationPckg,
864 EMMFAudioControllerSetSinkSampleRate,
869 EXPORT_C TInt RMMFAudioControllerCustomCommands::SetSinkNumChannels(TUint aNumChannels) const
871 TPckgBuf<TMMFAudioConfig> configPackage;
872 configPackage().iChannels = aNumChannels;
873 return iController.CustomCommandSync(iDestinationPckg,
874 EMMFAudioControllerSetSinkNumChannels,
879 EXPORT_C TInt RMMFAudioControllerCustomCommands::SetSinkFormat(TUid aFormatUid) const
881 TPckgBuf<TMMFAudioConfig> configPackage;
882 configPackage().iFormatUid = aFormatUid;
883 return iController.CustomCommandSync(iDestinationPckg,
884 EMMFAudioControllerSetSinkFormat,
889 EXPORT_C TInt RMMFAudioControllerCustomCommands::SetCodec(TFourCC aSourceDataType, TFourCC aSinkDataType) const
891 TPckgBuf<TMMFAudioConfig> configPackage;
892 configPackage().iSourceDataTypeCode = aSourceDataType;
893 configPackage().iSinkDataTypeCode = aSinkDataType;
894 return iController.CustomCommandSync(iDestinationPckg,
895 EMMFAudioControllerSetCodec,
902 EXPORT_C TInt RMMFAudioControllerCustomCommands::SetSourceBitRate(TUint aRate) const
904 TPckgBuf<TMMFAudioConfig> configPackage;
905 configPackage().iSampleRate = aRate;
906 return iController.CustomCommandSync(iDestinationPckg,
907 EMMFAudioControllerSetSourceBitRate,
912 EXPORT_C TInt RMMFAudioControllerCustomCommands::SetSourceDataType(TFourCC aDataType) const
914 TPckgBuf<TMMFAudioConfig> configPackage;
915 configPackage().iSourceDataTypeCode = aDataType;
916 return iController.CustomCommandSync(iDestinationPckg,
917 EMMFAudioControllerSetSourceDataType,
922 EXPORT_C TInt RMMFAudioControllerCustomCommands::SetSinkBitRate(TUint aRate) const
924 TPckgBuf<TMMFAudioConfig> configPackage;
925 configPackage().iSampleRate = aRate;
926 return iController.CustomCommandSync(iDestinationPckg,
927 EMMFAudioControllerSetSinkBitRate,
932 EXPORT_C TInt RMMFAudioControllerCustomCommands::SetSinkDataType(TFourCC aDataType) const
934 TPckgBuf<TMMFAudioConfig> configPackage;
935 configPackage().iSinkDataTypeCode = aDataType;
936 return iController.CustomCommandSync(iDestinationPckg,
937 EMMFAudioControllerSetSinkDataType,
942 EXPORT_C TInt RMMFAudioControllerCustomCommands::GetSourceSampleRate(TUint& aRate) const
944 TPckgBuf<TMMFAudioConfig> configPackage;
945 TInt error = iController.CustomCommandSync(iDestinationPckg,
946 EMMFAudioControllerGetSourceSampleRate,
951 aRate = configPackage().iSampleRate;
955 EXPORT_C TInt RMMFAudioControllerCustomCommands::GetSourceBitRate(TUint& aRate) const
957 TPckgBuf<TMMFAudioConfig> configPackage;
958 TInt error = iController.CustomCommandSync(iDestinationPckg,
959 EMMFAudioControllerGetSourceBitRate,
964 aRate = configPackage().iSampleRate;
968 EXPORT_C TInt RMMFAudioControllerCustomCommands::GetSourceNumChannels(TUint& aNumChannels) const
970 TPckgBuf<TMMFAudioConfig> configPackage;
971 TInt error = iController.CustomCommandSync(iDestinationPckg,
972 EMMFAudioControllerGetSourceNumChannels,
977 aNumChannels = configPackage().iChannels;
981 EXPORT_C TInt RMMFAudioControllerCustomCommands::GetSourceFormat(TUid& aFormat) const
983 TPckgBuf<TMMFAudioConfig> configPackage;
984 TInt error = iController.CustomCommandSync(iDestinationPckg,
985 EMMFAudioControllerGetSourceFormat,
990 aFormat = configPackage().iFormatUid;
994 EXPORT_C TInt RMMFAudioControllerCustomCommands::GetSourceDataType(TFourCC& aDataType) const
996 TPckgBuf<TMMFAudioConfig> configPackage;
997 TInt error = iController.CustomCommandSync(iDestinationPckg,
998 EMMFAudioControllerGetSourceDataType,
1003 aDataType = configPackage().iSourceDataTypeCode;
1007 EXPORT_C TInt RMMFAudioControllerCustomCommands::GetSinkSampleRate(TUint& aRate) const
1009 TPckgBuf<TMMFAudioConfig> configPackage;
1010 TInt error = iController.CustomCommandSync(iDestinationPckg,
1011 EMMFAudioControllerGetSinkSampleRate,
1016 aRate = configPackage().iSampleRate;
1020 EXPORT_C TInt RMMFAudioControllerCustomCommands::GetSinkBitRate(TUint& aRate) const
1022 TPckgBuf<TMMFAudioConfig> configPackage;
1023 TInt error = iController.CustomCommandSync(iDestinationPckg,
1024 EMMFAudioControllerGetSinkBitRate,
1029 aRate = configPackage().iSampleRate;
1033 EXPORT_C TInt RMMFAudioControllerCustomCommands::GetSinkNumChannels(TUint& aNumChannels) const
1035 TPckgBuf<TMMFAudioConfig> configPackage;
1036 TInt error = iController.CustomCommandSync(iDestinationPckg,
1037 EMMFAudioControllerGetSinkNumChannels,
1042 aNumChannels = configPackage().iChannels;
1046 EXPORT_C TInt RMMFAudioControllerCustomCommands::GetSinkFormat(TUid& aFormat) const
1048 TPckgBuf<TMMFAudioConfig> configPackage;
1049 TInt error = iController.CustomCommandSync(iDestinationPckg,
1050 EMMFAudioControllerGetSinkFormat,
1055 aFormat = configPackage().iFormatUid;
1059 EXPORT_C TInt RMMFAudioControllerCustomCommands::GetSinkDataType(TFourCC& aDataType) const
1061 TPckgBuf<TMMFAudioConfig> configPackage;
1062 TInt error = iController.CustomCommandSync(iDestinationPckg,
1063 EMMFAudioControllerGetSinkDataType,
1068 aDataType = configPackage().iSinkDataTypeCode;
1072 EXPORT_C void RMMFAudioControllerCustomCommands::GetSupportedSourceSampleRatesL(RArray<TUint>& aSupportedRates) const
1074 DoGetUintArrayL(aSupportedRates, EMMFAudioControllerGetSupportedSourceSampleRates);
1077 EXPORT_C void RMMFAudioControllerCustomCommands::GetSupportedSourceBitRatesL(RArray<TUint>& aSupportedRates) const
1079 DoGetUintArrayL(aSupportedRates, EMMFAudioControllerGetSupportedSourceBitRates);
1082 EXPORT_C void RMMFAudioControllerCustomCommands::GetSupportedSourceNumChannelsL(RArray<TUint>& aSupportedChannels) const
1084 DoGetUintArrayL(aSupportedChannels, EMMFAudioControllerGetSupportedSourceNumChannels);
1087 EXPORT_C void RMMFAudioControllerCustomCommands::GetSupportedSourceDataTypesL(RArray<TFourCC>& aSupportedDataTypes) const
1089 DoGetFourCCArrayL(aSupportedDataTypes, EMMFAudioControllerGetSupportedSourceDataTypes);
1092 EXPORT_C void RMMFAudioControllerCustomCommands::GetSupportedSinkSampleRatesL(RArray<TUint>& aSupportedRates) const
1094 DoGetUintArrayL(aSupportedRates, EMMFAudioControllerGetSupportedSinkSampleRates);
1097 EXPORT_C void RMMFAudioControllerCustomCommands::GetSupportedSinkBitRatesL(RArray<TUint>& aSupportedRates) const
1099 DoGetUintArrayL(aSupportedRates, EMMFAudioControllerGetSupportedSinkBitRates);
1102 EXPORT_C void RMMFAudioControllerCustomCommands::GetSupportedSinkNumChannelsL(RArray<TUint>& aSupportedChannels) const
1104 DoGetUintArrayL(aSupportedChannels, EMMFAudioControllerGetSupportedSinkNumChannels);
1107 EXPORT_C void RMMFAudioControllerCustomCommands::GetSupportedSinkDataTypesL(RArray<TFourCC>& aSupportedDataTypes) const
1109 DoGetFourCCArrayL(aSupportedDataTypes, EMMFAudioControllerGetSupportedSinkDataTypes);
1114 void RMMFAudioControllerCustomCommands::DoGetUintArrayL(RArray<TUint>& aArray, TMMFAudioControllerMessages aIpc) const
1118 TPckgBuf<TInt> numberOfElementsPckg;
1119 User::LeaveIfError(iController.CustomCommandSync(iDestinationPckg,
1123 numberOfElementsPckg));
1125 HBufC8* buf = HBufC8::NewLC(numberOfElementsPckg()*sizeof(TUint));
1126 TPtr8 ptr = buf->Des();
1128 User::LeaveIfError(iController.CustomCommandSync(iDestinationPckg,
1129 EMMFAudioControllerCopyArrayData,
1133 RDesReadStream stream(ptr);
1134 CleanupClosePushL(stream);
1136 for (TInt i=0; i<numberOfElementsPckg(); i++)
1138 User::LeaveIfError(aArray.Append(stream.ReadUint32L()));
1141 CleanupStack::PopAndDestroy(2);//stream, buf
1144 void RMMFAudioControllerCustomCommands::DoGetFourCCArrayL(RArray<TFourCC>& aArray, TMMFAudioControllerMessages aIpc) const
1148 TPckgBuf<TInt> numberOfElementsPckg;
1149 User::LeaveIfError(iController.CustomCommandSync(iDestinationPckg,
1153 numberOfElementsPckg));
1155 HBufC8* buf = HBufC8::NewLC(numberOfElementsPckg()*sizeof(TFourCC));
1156 TPtr8 ptr = buf->Des();
1158 User::LeaveIfError(iController.CustomCommandSync(iDestinationPckg,
1159 EMMFAudioControllerCopyArrayData,
1163 RDesReadStream stream(ptr);
1164 CleanupClosePushL(stream);
1166 for (TInt i=0; i<numberOfElementsPckg(); i++)
1168 User::LeaveIfError(aArray.Append(stream.ReadInt32L()));
1171 CleanupStack::PopAndDestroy(2);//stream, buf
1187 EXPORT_C CMMFAudioControllerCustomCommandParser* CMMFAudioControllerCustomCommandParser::NewL(MMMFAudioControllerCustomCommandImplementor& aImplementor)
1189 return new(ELeave) CMMFAudioControllerCustomCommandParser(aImplementor);
1192 CMMFAudioControllerCustomCommandParser::CMMFAudioControllerCustomCommandParser(MMMFAudioControllerCustomCommandImplementor& aImplementor) :
1193 CMMFCustomCommandParserBase(KUidInterfaceMMFAudioController),
1194 iImplementor(aImplementor)
1198 EXPORT_C CMMFAudioControllerCustomCommandParser::~CMMFAudioControllerCustomCommandParser()
1200 delete iDataCopyBuffer;
1203 void CMMFAudioControllerCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
1205 if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFAudioController)
1207 TRAPD(error, DoHandleRequestL(aMessage));
1209 aMessage.Complete(error);
1213 aMessage.Complete(KErrNotSupported);
1218 void CMMFAudioControllerCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
1220 TBool complete = ETrue;
1221 switch (aMessage.Function())
1223 case EMMFAudioControllerSetSourceSampleRate:
1224 complete = DoSetSourceSampleRateL(aMessage);
1226 case EMMFAudioControllerSetSourceBitRate:
1227 complete = DoSetSourceBitRateL(aMessage);
1229 case EMMFAudioControllerSetSourceNumChannels:
1230 complete = DoSetSourceNumChannelsL(aMessage);
1232 case EMMFAudioControllerSetSourceFormat:
1233 complete = DoSetSourceFormatL(aMessage);
1235 case EMMFAudioControllerSetSourceDataType:
1236 complete = DoSetSourceDataTypeL(aMessage);
1238 case EMMFAudioControllerSetSinkSampleRate:
1239 complete = DoSetSinkSampleRateL(aMessage);
1241 case EMMFAudioControllerSetSinkBitRate:
1242 complete = DoSetSinkBitRateL(aMessage);
1244 case EMMFAudioControllerSetSinkNumChannels:
1245 complete = DoSetSinkNumChannelsL(aMessage);
1247 case EMMFAudioControllerSetSinkFormat:
1248 complete = DoSetSinkFormatL(aMessage);
1250 case EMMFAudioControllerSetSinkDataType:
1251 complete = DoSetSinkDataTypeL(aMessage);
1253 case EMMFAudioControllerSetCodec:
1254 complete = DoSetCodecL(aMessage);
1256 case EMMFAudioControllerGetSourceSampleRate:
1257 complete = DoGetSourceSampleRateL(aMessage);
1259 case EMMFAudioControllerGetSourceBitRate:
1260 complete = DoGetSourceBitRateL(aMessage);
1262 case EMMFAudioControllerGetSourceNumChannels:
1263 complete = DoGetSourceNumChannelsL(aMessage);
1265 case EMMFAudioControllerGetSourceFormat:
1266 complete = DoGetSourceFormatL(aMessage);
1268 case EMMFAudioControllerGetSourceDataType:
1269 complete = DoGetSourceDataTypeL(aMessage);
1271 case EMMFAudioControllerGetSinkSampleRate:
1272 complete = DoGetSinkSampleRateL(aMessage);
1274 case EMMFAudioControllerGetSinkBitRate:
1275 complete = DoGetSinkBitRateL(aMessage);
1277 case EMMFAudioControllerGetSinkNumChannels:
1278 complete = DoGetSinkNumChannelsL(aMessage);
1280 case EMMFAudioControllerGetSinkFormat:
1281 complete = DoGetSinkFormatL(aMessage);
1283 case EMMFAudioControllerGetSinkDataType:
1284 complete = DoGetSinkDataTypeL(aMessage);
1286 case EMMFAudioControllerGetSupportedSourceSampleRates:
1287 complete = DoGetSupportedSourceSampleRatesL(aMessage);
1289 case EMMFAudioControllerGetSupportedSourceBitRates:
1290 complete = DoGetSupportedSourceBitRatesL(aMessage);
1292 case EMMFAudioControllerGetSupportedSourceNumChannels:
1293 complete = DoGetSupportedSourceNumChannelsL(aMessage);
1295 case EMMFAudioControllerGetSupportedSourceDataTypes:
1296 complete = DoGetSupportedSourceDataTypesL(aMessage);
1298 case EMMFAudioControllerGetSupportedSinkSampleRates:
1299 complete = DoGetSupportedSinkSampleRatesL(aMessage);
1301 case EMMFAudioControllerGetSupportedSinkBitRates:
1302 complete = DoGetSupportedSinkBitRatesL(aMessage);
1304 case EMMFAudioControllerGetSupportedSinkNumChannels:
1305 complete = DoGetSupportedSinkNumChannelsL(aMessage);
1307 case EMMFAudioControllerGetSupportedSinkDataTypes:
1308 complete = DoGetSupportedSinkDataTypesL(aMessage);
1310 case EMMFAudioControllerCopyArrayData:
1311 complete = DoCopyArrayDataL(aMessage);
1314 User::Leave(KErrNotSupported);
1318 aMessage.Complete(KErrNone);
1321 TBool CMMFAudioControllerCustomCommandParser::DoSetSourceSampleRateL(TMMFMessage& aMessage)
1323 TPckgBuf<TMMFAudioConfig> pckg;
1324 aMessage.ReadData1FromClientL(pckg);
1325 iImplementor.MacSetSourceSampleRateL(pckg().iSampleRate);
1329 TBool CMMFAudioControllerCustomCommandParser::DoSetSourceNumChannelsL(TMMFMessage& aMessage)
1331 TPckgBuf<TMMFAudioConfig> pckg;
1332 aMessage.ReadData1FromClientL(pckg);
1333 iImplementor.MacSetSourceNumChannelsL(pckg().iChannels);
1337 TBool CMMFAudioControllerCustomCommandParser::DoSetSourceFormatL(TMMFMessage& aMessage)
1339 TPckgBuf<TMMFAudioConfig> pckg;
1340 aMessage.ReadData1FromClientL(pckg);
1341 iImplementor.MacSetSourceFormatL(pckg().iFormatUid);
1345 TBool CMMFAudioControllerCustomCommandParser::DoSetSinkSampleRateL(TMMFMessage& aMessage)
1347 TPckgBuf<TMMFAudioConfig> pckg;
1348 aMessage.ReadData1FromClientL(pckg);
1349 iImplementor.MacSetSinkSampleRateL(pckg().iSampleRate);
1353 TBool CMMFAudioControllerCustomCommandParser::DoSetSinkNumChannelsL(TMMFMessage& aMessage)
1355 TPckgBuf<TMMFAudioConfig> pckg;
1356 aMessage.ReadData1FromClientL(pckg);
1357 iImplementor.MacSetSinkNumChannelsL(pckg().iChannels);
1361 TBool CMMFAudioControllerCustomCommandParser::DoSetSinkFormatL(TMMFMessage& aMessage)
1363 TPckgBuf<TMMFAudioConfig> pckg;
1364 aMessage.ReadData1FromClientL(pckg);
1365 iImplementor.MacSetSinkFormatL(pckg().iFormatUid);
1369 TBool CMMFAudioControllerCustomCommandParser::DoSetCodecL(TMMFMessage& aMessage)
1371 TPckgBuf<TMMFAudioConfig> pckg;
1372 aMessage.ReadData1FromClientL(pckg);
1373 iImplementor.MacSetCodecL(pckg().iSourceDataTypeCode, pckg().iSinkDataTypeCode);
1378 TBool CMMFAudioControllerCustomCommandParser::DoSetSourceBitRateL(TMMFMessage& aMessage)
1380 TPckgBuf<TMMFAudioConfig> pckg;
1381 aMessage.ReadData1FromClientL(pckg);
1382 iImplementor.MacSetSourceBitRateL(pckg().iSampleRate);
1386 TBool CMMFAudioControllerCustomCommandParser::DoSetSourceDataTypeL(TMMFMessage& aMessage)
1388 TPckgBuf<TMMFAudioConfig> pckg;
1389 aMessage.ReadData1FromClientL(pckg);
1390 iImplementor.MacSetSourceDataTypeL(pckg().iSourceDataTypeCode);
1394 TBool CMMFAudioControllerCustomCommandParser::DoSetSinkBitRateL(TMMFMessage& aMessage)
1396 TPckgBuf<TMMFAudioConfig> pckg;
1397 aMessage.ReadData1FromClientL(pckg);
1398 iImplementor.MacSetSinkBitRateL(pckg().iSampleRate);
1402 TBool CMMFAudioControllerCustomCommandParser::DoSetSinkDataTypeL(TMMFMessage& aMessage)
1404 TPckgBuf<TMMFAudioConfig> pckg;
1405 aMessage.ReadData1FromClientL(pckg);
1406 iImplementor.MacSetSinkDataTypeL(pckg().iSinkDataTypeCode);
1410 TBool CMMFAudioControllerCustomCommandParser::DoGetSourceSampleRateL(TMMFMessage& aMessage)
1413 iImplementor.MacGetSourceSampleRateL(rate);
1414 TPckgBuf<TMMFAudioConfig> pckg;
1415 pckg().iSampleRate = rate;
1416 aMessage.WriteDataToClientL(pckg);
1420 TBool CMMFAudioControllerCustomCommandParser::DoGetSourceBitRateL(TMMFMessage& aMessage)
1423 iImplementor.MacGetSourceBitRateL(rate);
1424 TPckgBuf<TMMFAudioConfig> pckg;
1425 pckg().iSampleRate = rate;
1426 aMessage.WriteDataToClientL(pckg);
1430 TBool CMMFAudioControllerCustomCommandParser::DoGetSourceNumChannelsL(TMMFMessage& aMessage)
1433 iImplementor.MacGetSourceNumChannelsL(channels);
1434 TPckgBuf<TMMFAudioConfig> pckg;
1435 pckg().iChannels = channels;
1436 aMessage.WriteDataToClientL(pckg);
1440 TBool CMMFAudioControllerCustomCommandParser::DoGetSourceFormatL(TMMFMessage& aMessage)
1443 iImplementor.MacGetSourceFormatL(format);
1444 TPckgBuf<TMMFAudioConfig> pckg;
1445 pckg().iFormatUid = format;
1446 aMessage.WriteDataToClientL(pckg);
1450 TBool CMMFAudioControllerCustomCommandParser::DoGetSourceDataTypeL(TMMFMessage& aMessage)
1453 iImplementor.MacGetSourceDataTypeL(fourCC);
1454 TPckgBuf<TMMFAudioConfig> pckg;
1455 pckg().iSourceDataTypeCode = fourCC;
1456 aMessage.WriteDataToClientL(pckg);
1460 TBool CMMFAudioControllerCustomCommandParser::DoGetSinkSampleRateL(TMMFMessage& aMessage)
1463 iImplementor.MacGetSinkSampleRateL(rate);
1464 TPckgBuf<TMMFAudioConfig> pckg;
1465 pckg().iSampleRate = rate;
1466 aMessage.WriteDataToClientL(pckg);
1470 TBool CMMFAudioControllerCustomCommandParser::DoGetSinkBitRateL(TMMFMessage& aMessage)
1473 iImplementor.MacGetSinkBitRateL(rate);
1474 TPckgBuf<TMMFAudioConfig> pckg;
1475 pckg().iSampleRate = rate;
1476 aMessage.WriteDataToClientL(pckg);
1480 TBool CMMFAudioControllerCustomCommandParser::DoGetSinkNumChannelsL(TMMFMessage& aMessage)
1483 iImplementor.MacGetSinkNumChannelsL(channels);
1484 TPckgBuf<TMMFAudioConfig> pckg;
1485 pckg().iChannels = channels;
1486 aMessage.WriteDataToClientL(pckg);
1490 TBool CMMFAudioControllerCustomCommandParser::DoGetSinkFormatL(TMMFMessage& aMessage)
1493 iImplementor.MacGetSinkFormatL(format);
1494 TPckgBuf<TMMFAudioConfig> pckg;
1495 pckg().iFormatUid = format;
1496 aMessage.WriteDataToClientL(pckg);
1500 TBool CMMFAudioControllerCustomCommandParser::DoGetSinkDataTypeL(TMMFMessage& aMessage)
1503 iImplementor.MacGetSinkDataTypeL(fourCC);
1504 TPckgBuf<TMMFAudioConfig> pckg;
1505 pckg().iSinkDataTypeCode = fourCC;
1506 aMessage.WriteDataToClientL(pckg);
1510 TBool CMMFAudioControllerCustomCommandParser::DoGetSupportedSourceSampleRatesL(TMMFMessage& aMessage)
1512 RArray<TUint> rates;
1513 CleanupClosePushL(rates);
1514 iImplementor.MacGetSupportedSourceSampleRatesL(rates);
1516 DoCreateBufFromUintArrayL(rates);
1518 TPckgBuf<TInt> pckg;
1519 pckg() = rates.Count();
1520 aMessage.WriteDataToClientL(pckg);
1522 CleanupStack::PopAndDestroy();//rates
1526 void CMMFAudioControllerCustomCommandParser::DoCreateBufFromUintArrayL(RArray<TUint>& aArray)
1528 delete iDataCopyBuffer;
1529 iDataCopyBuffer = NULL;
1531 iDataCopyBuffer = CBufFlat::NewL(KBufExpandSize8);
1532 RBufWriteStream stream;
1533 stream.Open(*iDataCopyBuffer);
1534 CleanupClosePushL(stream);
1535 for (TInt i=0;i<aArray.Count();i++)
1536 stream.WriteUint32L(aArray[i]);
1537 CleanupStack::PopAndDestroy();//stream
1540 void CMMFAudioControllerCustomCommandParser::DoCreateBufFromFourCCArrayL(RArray<TFourCC>& aArray)
1542 delete iDataCopyBuffer;
1543 iDataCopyBuffer = NULL;
1545 iDataCopyBuffer = CBufFlat::NewL(KBufExpandSize8);
1546 RBufWriteStream stream;
1547 stream.Open(*iDataCopyBuffer);
1548 CleanupClosePushL(stream);
1549 for (TInt i=0;i<aArray.Count();i++)
1551 stream.WriteInt32L(aArray[i].FourCC());
1553 CleanupStack::PopAndDestroy();//stream
1556 TBool CMMFAudioControllerCustomCommandParser::DoGetSupportedSourceBitRatesL(TMMFMessage& aMessage)
1558 RArray<TUint> rates;
1559 CleanupClosePushL(rates);
1560 iImplementor.MacGetSupportedSourceBitRatesL(rates);
1562 DoCreateBufFromUintArrayL(rates);
1564 TPckgBuf<TInt> pckg;
1565 pckg() = rates.Count();
1566 aMessage.WriteDataToClientL(pckg);
1568 CleanupStack::PopAndDestroy();//rates
1572 TBool CMMFAudioControllerCustomCommandParser::DoGetSupportedSourceNumChannelsL(TMMFMessage& aMessage)
1574 RArray<TUint> array;
1575 CleanupClosePushL(array);
1576 iImplementor.MacGetSupportedSourceNumChannelsL(array);
1578 DoCreateBufFromUintArrayL(array);
1580 TPckgBuf<TInt> pckg;
1581 pckg() = array.Count();
1582 aMessage.WriteDataToClientL(pckg);
1584 CleanupStack::PopAndDestroy();//array
1588 TBool CMMFAudioControllerCustomCommandParser::DoGetSupportedSourceDataTypesL(TMMFMessage& aMessage)
1590 RArray<TFourCC> array;
1591 CleanupClosePushL(array);
1592 iImplementor.MacGetSupportedSourceDataTypesL(array);
1594 DoCreateBufFromFourCCArrayL(array);
1596 TPckgBuf<TInt> pckg;
1597 pckg() = array.Count();
1598 aMessage.WriteDataToClientL(pckg);
1600 CleanupStack::PopAndDestroy();//array
1604 TBool CMMFAudioControllerCustomCommandParser::DoGetSupportedSinkSampleRatesL(TMMFMessage& aMessage)
1606 RArray<TUint> array;
1607 CleanupClosePushL(array);
1608 iImplementor.MacGetSupportedSinkSampleRatesL(array);
1610 DoCreateBufFromUintArrayL(array);
1612 TPckgBuf<TInt> pckg;
1613 pckg() = array.Count();
1614 aMessage.WriteDataToClientL(pckg);
1616 CleanupStack::PopAndDestroy();//array
1620 TBool CMMFAudioControllerCustomCommandParser::DoGetSupportedSinkBitRatesL(TMMFMessage& aMessage)
1622 RArray<TUint> array;
1623 CleanupClosePushL(array);
1624 iImplementor.MacGetSupportedSinkBitRatesL(array);
1626 DoCreateBufFromUintArrayL(array);
1628 TPckgBuf<TInt> pckg;
1629 pckg() = array.Count();
1630 aMessage.WriteDataToClientL(pckg);
1632 CleanupStack::PopAndDestroy();//array
1636 TBool CMMFAudioControllerCustomCommandParser::DoGetSupportedSinkNumChannelsL(TMMFMessage& aMessage)
1638 RArray<TUint> array;
1639 CleanupClosePushL(array);
1640 iImplementor.MacGetSupportedSinkNumChannelsL(array);
1642 DoCreateBufFromUintArrayL(array);
1644 TPckgBuf<TInt> pckg;
1645 pckg() = array.Count();
1646 aMessage.WriteDataToClientL(pckg);
1648 CleanupStack::PopAndDestroy();//array
1652 TBool CMMFAudioControllerCustomCommandParser::DoGetSupportedSinkDataTypesL(TMMFMessage& aMessage)
1654 RArray<TFourCC> array;
1655 CleanupClosePushL(array);
1656 iImplementor.MacGetSupportedSinkDataTypesL(array);
1658 DoCreateBufFromFourCCArrayL(array);
1660 TPckgBuf<TInt> pckg;
1661 pckg() = array.Count();
1662 aMessage.WriteDataToClientL(pckg);
1664 CleanupStack::PopAndDestroy();//array
1668 TBool CMMFAudioControllerCustomCommandParser::DoCopyArrayDataL(TMMFMessage& aMessage)
1670 if (!iDataCopyBuffer)
1671 User::Leave(KErrNotReady);
1672 aMessage.WriteDataToClientL(iDataCopyBuffer->Ptr(0));
1679 TBool CMMFVideoRecordControllerCustomCommandParser::DoCopyCDesC8ArrayDataL(TMMFMessage& aMessage)
1681 if (!iDataCopyBuffer)
1682 User::Leave(KErrNotReady);
1683 aMessage.WriteDataToClientL(iDataCopyBuffer->Ptr(0));
1710 EXPORT_C RMMFVideoControllerCustomCommands::RMMFVideoControllerCustomCommands(RMMFController& aController) :
1711 RMMFCustomCommandsBase(aController, KUidInterfaceMMFVideoController)
1715 EXPORT_C TInt RMMFVideoControllerCustomCommands::GetFrameRate(TReal32& aFramesPerSecond) const
1717 TPckgBuf<TMMFVideoConfig> configPackage;
1718 TInt error = iController.CustomCommandSync(iDestinationPckg,
1719 EMMFVideoControllerGetFrameRate,
1724 aFramesPerSecond = configPackage().iFramesPerSecond;
1728 EXPORT_C TInt RMMFVideoControllerCustomCommands::SetFrameRate(TReal32 aFramesPerSecond) const
1730 TPckgBuf<TMMFVideoConfig> configPackage;
1731 configPackage().iFramesPerSecond = aFramesPerSecond;
1732 return iController.CustomCommandSync(iDestinationPckg,
1733 EMMFVideoControllerSetFrameRate,
1739 EXPORT_C void RMMFVideoPlayControllerCustomCommands::GetFrame(CFbsBitmap& aBitmap,TRequestStatus& aStatus)
1741 TInt handle = aBitmap.Handle();
1743 iConfigPackage().iFrameBitmapServerHandle = handle;
1744 iController.CustomCommandAsync(iDestinationPckg,
1745 EMMFVideoPlayControllerGetFrame,
1751 EXPORT_C TInt RMMFVideoPlayControllerCustomCommands::UpdateDisplayRegion(const TRegion& aRegion) const
1753 TPckgBuf<TInt> numberOfRectsPckg;
1754 numberOfRectsPckg() = aRegion.Count();
1755 const TRect* rects = aRegion.RectangleList();
1756 TPtrC8 rectMemory(REINTERPRET_CAST(TUint8*,(void*) rects), numberOfRectsPckg() * sizeof(TRect));
1758 return iController.CustomCommandSync(iDestinationPckg,
1759 EMMFVideoPlayControllerUpdateDisplayRegion,
1765 EXPORT_C TInt RMMFVideoPlayControllerCustomCommands::DirectScreenAccessEvent(const TMMFDSAEvent aDSAEvent) const
1767 TPckgBuf<TMMFVideoConfig> configPackage;
1768 configPackage().iDSAEvent = (TInt)aDSAEvent;
1769 return iController.CustomCommandSync(iDestinationPckg,
1770 EMMFVideoPlayControllerDSAEvent,
1776 EXPORT_C TInt RMMFVideoPlayControllerCustomCommands::Play(const TTimeIntervalMicroSeconds& aStart, const TTimeIntervalMicroSeconds& aEnd) const
1778 TPckgBuf<TMMFVideoConfig> configPackage;
1779 configPackage().iStartPosition = aStart;
1780 configPackage().iEndPosition = aEnd;
1781 return iController.CustomCommandSync(iDestinationPckg,
1782 EMMFVideoPlayControllerPlay,
1787 EXPORT_C TInt RMMFVideoPlayControllerCustomCommands::RefreshFrame() const
1789 return iController.CustomCommandSync(iDestinationPckg,
1790 EMMFVideoPlayControllerRefreshFrame,
1795 EXPORT_C TInt RMMFVideoPlayControllerCustomCommands::GetLoadingProgress(TInt& aPercentageComplete) const
1797 TPckgBuf<TMMFVideoConfig> configPackage;
1798 TInt error = iController.CustomCommandSync(iDestinationPckg,
1799 EMMFVideoPlayControllerGetLoadingProgress,
1804 aPercentageComplete = configPackage().iLoadingCompletePercentage;
1811 EXPORT_C TInt RMMFVideoControllerCustomCommands::GetVideoFrameSize(TSize& aVideoFrameSize) const
1813 TPckgBuf<TMMFVideoConfig> configPackage;
1814 TInt error = iController.CustomCommandSync(iDestinationPckg,
1815 EMMFVideoControllerGetVideoFrameSize,
1820 aVideoFrameSize = configPackage().iVideoFrameSize;
1824 EXPORT_C TInt RMMFVideoControllerCustomCommands::GetAudioBitRate(TInt& aBitRate) const
1826 TPckgBuf<TMMFVideoConfig> configPackage;
1827 TInt error = iController.CustomCommandSync(iDestinationPckg,
1828 EMMFVideoControllerGetAudioBitRate,
1833 aBitRate = configPackage().iAudioBitRate;
1837 EXPORT_C TInt RMMFVideoControllerCustomCommands::GetVideoBitRate(TInt& aBitRate) const
1839 TPckgBuf<TMMFVideoConfig> configPackage;
1840 TInt error = iController.CustomCommandSync(iDestinationPckg,
1841 EMMFVideoControllerGetVideoBitRate,
1846 aBitRate = configPackage().iVideoBitRate;
1849 EXPORT_C TInt RMMFVideoControllerCustomCommands::GetAudioCodec(TFourCC& aCodec) const
1851 TPckgBuf<TMMFVideoConfig> configPackage;
1852 TInt error = iController.CustomCommandSync(iDestinationPckg,
1853 EMMFVideoControllerGetAudioCodec,
1858 aCodec = configPackage().iAudioCodec;
1863 EXPORT_C void Reserved1( void )
1865 // dummy reserved function to replace GetVideoCodec() which was removed.
1866 // this should never be called so generate a panic
1867 Panic( ENoGetVideoCodec );
1870 EXPORT_C void Reserved2( void )
1872 // dummy reserved function to replace GetSupportedSourceVideoTypes() which was removed.
1873 // this should never be called so generate a panic
1874 Panic( ENoGetSourceVideoTypes );
1877 EXPORT_C void Reserved3( void )
1879 // dummy reserved function to replace GetSupportedSourceAudioTypes() which was removed.
1880 // this should never be called so generate a panic
1881 Panic( ENoGetSourceAudioTypes );
1885 EXPORT_C TInt RMMFVideoControllerCustomCommands::GetVideoMimeType(TDes8& aMimeType) const
1887 TInt err = iController.CustomCommandSync(iDestinationPckg,
1888 EMMFVideoControllerGetVideoMimeType,
1896 void RMMFVideoRecordControllerCustomCommands::DoGetFourCCArrayL(RArray<TFourCC>& aArray) const
1900 TPckgBuf<TInt> numberOfElementsPckg;
1901 User::LeaveIfError(iController.CustomCommandSync(iDestinationPckg,
1902 EMMFVideoRecordControllerGetSupportedSinkAudioTypes,
1905 numberOfElementsPckg));
1907 HBufC8* buf = HBufC8::NewLC(numberOfElementsPckg()*sizeof(TFourCC));
1908 TPtr8 ptr = buf->Des();
1910 User::LeaveIfError(iController.CustomCommandSync(iDestinationPckg,
1911 EMMFVideoRecordControllerCopyFourCCArrayData,
1915 RDesReadStream stream(ptr);
1916 CleanupClosePushL(stream);
1918 for (TInt i=0; i<numberOfElementsPckg(); i++)
1920 User::LeaveIfError(aArray.Append(stream.ReadInt32L()));
1923 CleanupStack::PopAndDestroy(2);//stream, buf
1927 void RMMFVideoRecordControllerCustomCommands::DoGetCDesC8ArrayL(CDesC8Array& aArray, TMMFVideoRecordControllerMessages aIpc) const
1931 TPckgBuf<TMimeTypeBufferInfo> bufferInfoPckg;
1932 User::LeaveIfError(iController.CustomCommandSync(iDestinationPckg,
1938 // allocate a buffer of size dictated by server side
1939 HBufC8* buf = HBufC8::NewLC(bufferInfoPckg().bufferLen);
1940 TPtr8 ptr = buf->Des();
1942 User::LeaveIfError(iController.CustomCommandSync(iDestinationPckg,
1943 EMMFVideoRecordControllerCopyDescriptorArrayData,
1947 RDesReadStream stream(ptr);
1948 CleanupClosePushL(stream);
1952 for (TInt i=0; i < bufferInfoPckg().count; i++)
1954 User::LeaveIfError(len = stream.ReadInt32L());
1956 HBufC8* tempDesc = HBufC8::NewLC(len);
1957 TPtr8 tempPtr = tempDesc->Des();
1959 stream.ReadL(tempPtr, len);
1960 aArray.AppendL(tempPtr);
1962 CleanupStack::PopAndDestroy(tempDesc);
1965 CleanupStack::PopAndDestroy(2);//stream, buf
1970 EXPORT_C TInt RMMFVideoPlayControllerCustomCommands::SetDisplayWindow(const TRect& aWindowRect,
1971 const TRect& aClipRect) const
1973 TPckgBuf<TMMFVideoConfig> configPackage;
1974 configPackage().iWindowRect = aWindowRect;
1975 configPackage().iClipRect = aClipRect;
1977 return iController.CustomCommandSync(iDestinationPckg,
1978 EMMFVideoPlayControllerSetDisplayWindow,
1983 EXPORT_C TInt RMMFVideoPlayControllerCustomCommands::GetAudioEnabled(TBool& aEnabled) const
1985 TPckgBuf<TMMFVideoConfig> configPackage;
1987 TInt err = iController.CustomCommandSync(iDestinationPckg,
1988 EMMFVideoPlayControllerGetAudioEnabled,
1994 aEnabled = configPackage().iAudioEnabled;
1998 EXPORT_C TInt RMMFVideoPlayControllerCustomCommands::Prepare()
2000 return iController.CustomCommandSync(iDestinationPckg,
2001 EMMFVideoPlayControllerPrepare,
2006 EXPORT_C TInt RMMFVideoPlayControllerCustomCommands::SetRotation(TVideoRotation aRotation) const
2008 TPckgBuf<TMMFVideoConfig> configPackage;
2009 configPackage().iVideoRotation = aRotation;
2011 return iController.CustomCommandSync(iDestinationPckg,
2012 EMMFVideoPlayControllerSetRotation,
2017 EXPORT_C TInt RMMFVideoPlayControllerCustomCommands::GetRotation(TVideoRotation& aRotation) const
2019 TPckgBuf<TMMFVideoConfig> configPackage;
2021 TInt err = iController.CustomCommandSync(iDestinationPckg,
2022 EMMFVideoPlayControllerGetRotation,
2028 aRotation = configPackage().iVideoRotation;
2032 EXPORT_C TInt RMMFVideoPlayControllerCustomCommands::SetScaleFactor(TReal32 aWidthPercentage, TReal32 aHeightPercentage, TBool aAntiAliasFiltering) const
2034 TPckgBuf<TMMFVideoConfig> configPackage;
2035 configPackage().iWidthScalePercentage = aWidthPercentage;
2036 configPackage().iHeightScalePercentage = aHeightPercentage;
2037 configPackage().iAntiAliasFiltering = aAntiAliasFiltering;
2039 return iController.CustomCommandSync(iDestinationPckg,
2040 EMMFVideoPlayControllerSetScaleFactor,
2045 EXPORT_C TInt RMMFVideoPlayControllerCustomCommands::GetScaleFactor(TReal32& aWidthPercentage, TReal32& aHeightPercentage, TBool& aAntiAliasFiltering) const
2047 TPckgBuf<TMMFVideoConfig> configPackage;
2049 TInt err = iController.CustomCommandSync(iDestinationPckg,
2050 EMMFVideoPlayControllerGetScaleFactor,
2057 aWidthPercentage = configPackage().iWidthScalePercentage;
2058 aHeightPercentage = configPackage().iHeightScalePercentage;
2059 aAntiAliasFiltering = configPackage().iAntiAliasFiltering;
2064 EXPORT_C TInt RMMFVideoPlayControllerCustomCommands::SetCropRegion(const TRect& aCropRegion) const
2066 TPckgBuf<TMMFVideoConfig> configPackage;
2067 configPackage().iCropRectangle = aCropRegion;
2069 return iController.CustomCommandSync(iDestinationPckg,
2070 EMMFVideoPlayControllerSetCropRegion,
2075 EXPORT_C TInt RMMFVideoPlayControllerCustomCommands::GetCropRegion(TRect& aCropRegion) const
2077 TPckgBuf<TMMFVideoConfig> configPackage;
2079 TInt err = iController.CustomCommandSync(iDestinationPckg,
2080 EMMFVideoPlayControllerGetCropRegion,
2087 aCropRegion = configPackage().iCropRectangle;
2092 EXPORT_C RMMFVideoRecordControllerCustomCommands::RMMFVideoRecordControllerCustomCommands(RMMFController& aController) :
2093 RMMFCustomCommandsBase(aController, KUidInterfaceMMFVideoRecordController)
2098 EXPORT_C TInt RMMFVideoRecordControllerCustomCommands::SetVideoFormat(TUid aFormatUid) const
2100 TPckgBuf<TMMFVideoConfig> configPackage;
2101 configPackage().iFormatUid = aFormatUid;
2102 return iController.CustomCommandSync(iDestinationPckg,
2103 EMMFVideoRecordControllerSetVideoFormat,
2108 EXPORT_C TInt RMMFVideoRecordControllerCustomCommands::SetVideoCodec(const TDesC8& aVideoCodec) const
2110 return iController.CustomCommandSync(iDestinationPckg,
2111 EMMFVideoRecordControllerSetVideoCodec,
2117 EXPORT_C TInt RMMFVideoRecordControllerCustomCommands::SetAudioCodec(TFourCC aAudioCodec) const
2119 TPckgBuf<TMMFVideoConfig> configPackage;
2120 configPackage().iAudioCodec = aAudioCodec;
2121 return iController.CustomCommandSync(iDestinationPckg,
2122 EMMFVideoRecordControllerSetAudioCodec,
2128 EXPORT_C void RMMFVideoRecordControllerCustomCommands::AddMetaDataEntryL(const CMMFMetaDataEntry& aNewEntry) const
2130 CBufFlat* buf = CBufFlat::NewL(KBufExpandSize32);
2131 CleanupStack::PushL(buf);
2134 CleanupClosePushL(s);
2135 aNewEntry.ExternalizeL(s);
2136 TPtr8 bufData = buf->Ptr(0);
2137 User::LeaveIfError(iController.CustomCommandSync(iDestinationPckg,
2138 EMMFVideoRecordControllerAddMetaDataEntry,
2141 CleanupStack::PopAndDestroy(2);//s, buf
2144 EXPORT_C TInt RMMFVideoRecordControllerCustomCommands::RemoveMetaDataEntry(TInt aIndex) const
2146 TPckgBuf<TInt> pckg(aIndex);
2147 return iController.CustomCommandSync(iDestinationPckg,
2148 EMMFVideoRecordControllerRemoveMetaDataEntry,
2153 EXPORT_C void RMMFVideoRecordControllerCustomCommands::ReplaceMetaDataEntryL(TInt aIndex, const CMMFMetaDataEntry& aNewEntry) const
2155 TPckgBuf<TInt> indexPckg(aIndex);
2156 CBufFlat* buf = CBufFlat::NewL(KBufExpandSize32);
2157 CleanupStack::PushL(buf);
2160 CleanupClosePushL(s);
2161 aNewEntry.ExternalizeL(s);
2162 TPtr8 bufData = buf->Ptr(0);
2163 User::LeaveIfError(iController.CustomCommandSync(iDestinationPckg,
2164 EMMFVideoRecordControllerReplaceMetaDataEntry,
2167 CleanupStack::PopAndDestroy(2);//s, buf
2171 EXPORT_C TInt RMMFVideoRecordControllerCustomCommands::SetMaxFileSize(TInt aMaxSize) const
2173 TPckgBuf<TMMFVideoConfig> configPackage;
2174 configPackage().iMaxFileSize = aMaxSize;
2175 return iController.CustomCommandSync(iDestinationPckg,
2176 EMMFVideoRecordControllerSetMaxFileSize,
2181 EXPORT_C TInt RMMFVideoRecordControllerCustomCommands::SetVideoBitRate(TInt aRate) const
2183 TPckgBuf<TMMFVideoConfig> configPackage;
2184 configPackage().iVideoBitRate = aRate;
2186 return iController.CustomCommandSync(iDestinationPckg,
2187 EMMFVideoRecordControllerSetVideoBitRate,
2193 EXPORT_C TInt RMMFVideoRecordControllerCustomCommands::SetAudioBitRate(TInt aRate) const
2195 TPckgBuf<TMMFVideoConfig> configPackage;
2196 configPackage().iAudioBitRate = aRate;
2198 return iController.CustomCommandSync(iDestinationPckg,
2199 EMMFVideoRecordControllerSetAudioBitRate,
2204 EXPORT_C TInt RMMFVideoRecordControllerCustomCommands::SetVideoFrameSize(TSize aSize) const
2206 TPckgBuf<TMMFVideoConfig> configPackage;
2207 configPackage().iVideoFrameSize = aSize;
2209 return iController.CustomCommandSync(iDestinationPckg,
2210 EMMFVideoRecordControllerSetVideoFrameSize,
2215 EXPORT_C TInt RMMFVideoRecordControllerCustomCommands::SetAudioEnabled(TBool aEnabled) const
2217 TPckgBuf<TMMFVideoConfig> configPackage;
2218 configPackage().iAudioEnabled = aEnabled;
2220 return iController.CustomCommandSync(iDestinationPckg,
2221 EMMFVideoRecordControllerSetAudioEnabled,
2226 EXPORT_C TInt RMMFVideoRecordControllerCustomCommands::Prepare() const
2229 return iController.CustomCommandSync(iDestinationPckg,
2230 EMMFVideoRecordControllerPrepare,
2235 EXPORT_C TInt RMMFVideoRecordControllerCustomCommands::SetCameraHandle(TInt aCameraHandle) const
2237 TPckgBuf<TMMFVideoConfig> configPackage;
2238 configPackage().iCameraHandle = aCameraHandle;
2240 return iController.CustomCommandSync(iDestinationPckg,
2241 EMMFVideoRecordControllerSetCameraHandle,
2246 EXPORT_C TInt RMMFVideoRecordControllerCustomCommands::GetRecordTimeAvailable(TTimeIntervalMicroSeconds& aTime) const
2248 TPckgBuf<TMMFVideoConfig> configPackage;
2249 TInt error = iController.CustomCommandSync(iDestinationPckg,
2250 EMMFVideoRecordControllerGetRecordTimeAvailable,
2255 aTime = configPackage().iRecordTimeAvailable;
2259 EXPORT_C TInt RMMFVideoRecordControllerCustomCommands::GetSupportedSinkVideoTypes(CDesC8Array& aSupportedDataTypes) const
2262 TRAP(err, DoGetCDesC8ArrayL(aSupportedDataTypes, EMMFVideoRecordControllerGetSupportedSinkVideoTypes));
2266 EXPORT_C TInt RMMFVideoRecordControllerCustomCommands::GetSupportedSinkAudioTypes(RArray<TFourCC>& aSupportedDataTypes) const
2269 TRAP(err, DoGetFourCCArrayL(aSupportedDataTypes));
2274 // New method as part of INC23777.
2275 EXPORT_C TInt RMMFVideoRecordControllerCustomCommands::GetAudioEnabled(TBool& aEnabled) const
2277 TPckgBuf<TMMFVideoConfig> configPackage;
2279 TInt err = iController.CustomCommandSync(iDestinationPckg,
2280 EMMFVideoRecordControllerGetAudioEnabled,
2286 aEnabled = configPackage().iAudioEnabled;
2290 EXPORT_C CMMFVideoControllerCustomCommandParser* CMMFVideoControllerCustomCommandParser::NewL(MMMFVideoControllerCustomCommandImplementor& aImplementor)
2292 return new(ELeave) CMMFVideoControllerCustomCommandParser(aImplementor);
2295 EXPORT_C CMMFVideoControllerCustomCommandParser::~CMMFVideoControllerCustomCommandParser()
2299 CMMFVideoControllerCustomCommandParser::CMMFVideoControllerCustomCommandParser(MMMFVideoControllerCustomCommandImplementor& aImplementor) :
2300 CMMFCustomCommandParserBase(KUidInterfaceMMFVideoController),
2301 iImplementor(aImplementor)
2305 void CMMFVideoControllerCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
2307 if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFVideoController)
2309 TRAPD(error, DoHandleRequestL(aMessage));
2311 aMessage.Complete(error);
2315 aMessage.Complete(KErrNotSupported);
2319 void CMMFVideoControllerCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
2321 TBool complete = ETrue;
2322 switch (aMessage.Function())
2324 case EMMFVideoControllerGetAudioBitRate:
2325 complete = DoGetAudioBitRateL(aMessage);
2327 case EMMFVideoControllerGetVideoBitRate:
2328 complete = DoGetVideoBitRateL(aMessage);
2330 case EMMFVideoControllerGetAudioCodec:
2331 complete = DoGetAudioCodecL(aMessage);
2333 case EMMFVideoControllerGetVideoFrameSize:
2334 complete = DoGetVideoFrameSizeL(aMessage);
2336 case EMMFVideoControllerSetFrameRate:
2337 complete = DoSetFrameRateL(aMessage);
2339 case EMMFVideoControllerGetFrameRate:
2340 complete = DoGetFrameRateL(aMessage);
2342 case EMMFVideoControllerGetVideoMimeType:
2343 complete = DoGetVideoMimeTypeL(aMessage);
2346 User::Leave(KErrNotSupported);
2350 aMessage.Complete(KErrNone);
2353 TBool CMMFVideoControllerCustomCommandParser::DoGetVideoFrameSizeL(TMMFMessage& aMessage)
2356 iImplementor.MvcGetVideoFrameSizeL(size);
2357 TPckgBuf<TMMFVideoConfig> pckg;
2358 pckg().iVideoFrameSize = size;
2359 aMessage.WriteDataToClientL(pckg);
2363 TBool CMMFVideoControllerCustomCommandParser::DoGetAudioCodecL(TMMFMessage& aMessage)
2366 iImplementor.MvcGetAudioCodecL(audioCodec);
2367 TPckgBuf<TMMFVideoConfig> pckg;
2368 pckg().iAudioCodec = audioCodec;
2369 aMessage.WriteDataToClientL(pckg);
2373 TBool CMMFVideoControllerCustomCommandParser::DoGetVideoBitRateL(TMMFMessage& aMessage)
2376 iImplementor.MvcGetVideoBitRateL(videoBitRate);
2377 TPckgBuf<TMMFVideoConfig> pckg;
2378 pckg().iVideoBitRate = videoBitRate;
2379 aMessage.WriteDataToClientL(pckg);
2383 TBool CMMFVideoControllerCustomCommandParser::DoGetAudioBitRateL(TMMFMessage& aMessage)
2386 iImplementor.MvcGetAudioBitRateL(audioBitRate);
2387 TPckgBuf<TMMFVideoConfig> pckg;
2388 pckg().iAudioBitRate = audioBitRate;
2389 aMessage.WriteDataToClientL(pckg);
2393 TBool CMMFVideoControllerCustomCommandParser::DoSetFrameRateL(TMMFMessage& aMessage)
2395 TPckgBuf<TMMFVideoConfig> pckg;
2396 aMessage.ReadData1FromClientL(pckg);
2397 iImplementor.MvcSetFrameRateL(pckg().iFramesPerSecond);
2401 TBool CMMFVideoControllerCustomCommandParser::DoGetFrameRateL(TMMFMessage& aMessage)
2403 TReal32 frameRate = 0;
2404 iImplementor.MvcGetFrameRateL(frameRate);
2405 TPckgBuf<TMMFVideoConfig> pckg;
2406 pckg().iFramesPerSecond = frameRate;
2407 aMessage.WriteDataToClientL(pckg);
2411 TBool CMMFVideoControllerCustomCommandParser::DoGetVideoMimeTypeL(TMMFMessage& aMessage)
2413 TBuf8<KMaxMimeTypeLength> mimeType;
2414 iImplementor.MvcGetVideoMimeTypeL(mimeType);
2416 aMessage.WriteDataToClientL(mimeType);
2421 TBool CMMFVideoRecordControllerCustomCommandParser::DoGetSupportedSinkAudioTypesL(TMMFMessage& aMessage)
2423 RArray<TFourCC> array;
2424 CleanupClosePushL(array);
2425 iImplementor.MvrcGetSupportedSinkAudioTypesL(array);
2427 DoCreateBufFromFourCCArrayL(array);
2429 TPckgBuf<TInt> pckg;
2430 pckg() = array.Count();
2431 aMessage.WriteDataToClientL(pckg);
2433 CleanupStack::PopAndDestroy();//array
2438 TBool CMMFVideoRecordControllerCustomCommandParser::DoGetSupportedSinkVideoTypesL(TMMFMessage& aMessage)
2440 CDesC8ArrayFlat* array = new (ELeave) CDesC8ArrayFlat(KBufMimeTypeGranularity);
2441 CleanupStack::PushL(array);
2443 iImplementor.MvrcGetSupportedSinkVideoTypesL(*array);
2445 TInt32 len = DoCreateBufFromCDesC8ArrayL(*array);
2447 TPckgBuf<TMimeTypeBufferInfo> pckg;
2448 pckg().count = array->Count();
2449 pckg().bufferLen = len;
2451 aMessage.WriteDataToClientL(pckg);
2453 CleanupStack::PopAndDestroy();//array
2457 void CMMFVideoRecordControllerCustomCommandParser::DoCreateBufFromFourCCArrayL(RArray<TFourCC>& aArray)
2459 delete iDataCopyBuffer;
2460 iDataCopyBuffer = NULL;
2462 iDataCopyBuffer = CBufFlat::NewL(KBufExpandSize8);
2463 RBufWriteStream stream;
2464 stream.Open(*iDataCopyBuffer);
2465 CleanupClosePushL(stream);
2466 for (TInt i=0;i<aArray.Count();i++)
2468 stream.WriteInt32L(aArray[i].FourCC());
2470 CleanupStack::PopAndDestroy();//stream
2473 TInt32 CMMFVideoRecordControllerCustomCommandParser::DoCreateBufFromCDesC8ArrayL(CDesC8Array& aArray)
2475 TInt32 bufferLen = 0;
2478 delete iDataCopyBuffer;
2479 iDataCopyBuffer = NULL;
2481 iDataCopyBuffer = CBufFlat::NewL(KBufExpandSize8);
2482 RBufWriteStream stream;
2483 stream.Open(*iDataCopyBuffer);
2484 CleanupClosePushL(stream);
2485 for (TInt i = 0; i < aArray.Count(); i++)
2487 len = aArray[i].Length();
2488 stream.WriteInt32L(len);
2489 stream.WriteL(aArray[i]);
2491 bufferLen += (len + sizeof(TInt32));; // get a cumulative total buffer size
2493 CleanupStack::PopAndDestroy();//stream
2499 // --------------------------------------------------------------------------------
2500 EXPORT_C RMMFVideoPlayControllerCustomCommands::RMMFVideoPlayControllerCustomCommands(RMMFController& aController) :
2501 RMMFCustomCommandsBase(aController, KUidInterfaceMMFVideoPlayController)
2505 EXPORT_C CMMFVideoPlayControllerCustomCommandParser* CMMFVideoPlayControllerCustomCommandParser::NewL(MMMFVideoPlayControllerCustomCommandImplementor& aImplementor)
2507 return new(ELeave) CMMFVideoPlayControllerCustomCommandParser(aImplementor);
2510 EXPORT_C CMMFVideoPlayControllerCustomCommandParser::~CMMFVideoPlayControllerCustomCommandParser()
2512 delete iVideoFrameMessage;
2515 CMMFVideoPlayControllerCustomCommandParser::CMMFVideoPlayControllerCustomCommandParser(MMMFVideoPlayControllerCustomCommandImplementor& aImplementor) :
2516 CMMFCustomCommandParserBase(KUidInterfaceMMFVideoPlayController),
2517 iImplementor(aImplementor)
2521 void CMMFVideoPlayControllerCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
2523 if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFVideoPlayController)
2525 TRAPD(error, DoHandleRequestL(aMessage));
2527 aMessage.Complete(error);
2531 aMessage.Complete(KErrNotSupported);
2535 void CMMFVideoPlayControllerCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
2537 TBool complete = ETrue;
2538 switch (aMessage.Function())
2540 case EMMFVideoPlayControllerGetFrame:
2541 complete = DoGetFrameL(aMessage);
2543 case EMMFVideoPlayControllerSetDisplayWindow:
2544 complete = DoSetDisplayWindowL(aMessage);
2546 case EMMFVideoPlayControllerGetAudioEnabled:
2547 complete = DoGetAudioEnabledL(aMessage);
2549 case EMMFVideoPlayControllerUpdateDisplayRegion:
2550 complete = DoUpdateDisplayRegionL(aMessage);
2552 case EMMFVideoPlayControllerDSAEvent:
2553 complete = DoDirectScreenAccessEventL(aMessage);
2555 case EMMFVideoPlayControllerPlay:
2556 complete = DoPlayL(aMessage);
2558 case EMMFVideoPlayControllerRefreshFrame:
2559 complete = DoRefreshFrameL(aMessage);
2561 case EMMFVideoPlayControllerGetLoadingProgress:
2562 complete = DoGetLoadingProgressL(aMessage);
2564 case EMMFVideoPlayControllerPrepare:
2565 complete = DoPrepareL(aMessage);
2567 case EMMFVideoPlayControllerSetRotation:
2568 complete = DoSetRotationL(aMessage);
2570 case EMMFVideoPlayControllerGetRotation:
2571 complete = DoGetRotationL(aMessage);
2573 case EMMFVideoPlayControllerSetScaleFactor:
2574 complete = DoSetScaleFactorL(aMessage);
2576 case EMMFVideoPlayControllerGetScaleFactor:
2577 complete = DoGetScaleFactorL(aMessage);
2579 case EMMFVideoPlayControllerSetCropRegion:
2580 complete = DoSetCropRegionL(aMessage);
2582 case EMMFVideoPlayControllerGetCropRegion:
2583 complete = DoGetCropRegionL(aMessage);
2587 User::Leave(KErrNotSupported);
2591 aMessage.Complete(KErrNone);
2594 TBool CMMFVideoPlayControllerCustomCommandParser::DoUpdateDisplayRegionL(TMMFMessage& aMessage)
2596 TPckgBuf<TInt> numberOfRectsPckg;
2597 aMessage.ReadData1FromClientL(numberOfRectsPckg);
2598 TUint rectSize = numberOfRectsPckg() * sizeof(TRect);
2599 TUint8* rectMemory = STATIC_CAST(TUint8*, User::AllocLC(rectSize));
2600 TPtr8 rectMemoryPtr(rectMemory,rectSize);
2601 aMessage.ReadData2FromClientL(rectMemoryPtr);
2602 TRect* rects = REINTERPRET_CAST(TRect*, rectMemory);
2603 RRegion region(numberOfRectsPckg(), rects);
2604 CleanupStack::Pop(rectMemory); // rectMemory now owned by region
2605 CleanupClosePushL(region);
2606 iImplementor.MvpcUpdateDisplayRegionL(region);
2607 CleanupStack::PopAndDestroy();//region
2612 TBool CMMFVideoPlayControllerCustomCommandParser::DoGetFrameL(TMMFMessage& aMessage)
2614 delete iVideoFrameMessage;
2615 iVideoFrameMessage = NULL;
2617 iVideoFrameMessage = CMMFVideoFrameMessage::NewL(aMessage);
2618 iImplementor.MvpcGetFrameL(*iVideoFrameMessage);
2622 TBool CMMFVideoPlayControllerCustomCommandParser::DoSetDisplayWindowL(TMMFMessage& aMessage)
2624 TPckgBuf<TMMFVideoConfig> pckg;
2625 aMessage.ReadData1FromClientL(pckg);
2626 iImplementor.MvpcSetDisplayWindowL(pckg().iWindowRect, pckg().iClipRect);
2630 TBool CMMFVideoPlayControllerCustomCommandParser::DoGetAudioEnabledL(TMMFMessage& aMessage)
2633 iImplementor.MvpcGetAudioEnabledL(enabled);
2634 TPckgBuf<TMMFVideoConfig> pckg;
2635 pckg().iAudioEnabled = enabled;
2636 aMessage.WriteDataToClientL(pckg);
2640 TBool CMMFVideoPlayControllerCustomCommandParser::DoDirectScreenAccessEventL(TMMFMessage& aMessage)
2642 TPckgBuf<TMMFVideoConfig> pckg;
2643 aMessage.ReadData1FromClientL(pckg);
2644 iImplementor.MvpcDirectScreenAccessEventL((TMMFDSAEvent)pckg().iDSAEvent);
2648 TBool CMMFVideoPlayControllerCustomCommandParser::DoPlayL(TMMFMessage& aMessage)
2650 TPckgBuf<TMMFVideoConfig> pckg;
2651 aMessage.ReadData1FromClientL(pckg);
2652 iImplementor.MvpcPlayL(pckg().iStartPosition, pckg().iEndPosition);
2656 TBool CMMFVideoPlayControllerCustomCommandParser::DoRefreshFrameL(TMMFMessage& /*aMessage*/)
2658 iImplementor.MvpcRefreshFrameL();
2662 TBool CMMFVideoPlayControllerCustomCommandParser::DoGetLoadingProgressL(TMMFMessage& aMessage)
2665 iImplementor.MvpcGetLoadingProgressL(progress);
2666 TPckgBuf<TMMFVideoConfig> pckg;
2667 pckg().iLoadingCompletePercentage = progress;
2668 aMessage.WriteDataToClientL(pckg);
2672 TBool CMMFVideoPlayControllerCustomCommandParser::DoPrepareL(TMMFMessage& /*aMessage*/)
2674 iImplementor.MvpcPrepare();
2678 TBool CMMFVideoPlayControllerCustomCommandParser::DoSetRotationL(TMMFMessage& aMessage)
2680 TPckgBuf<TMMFVideoConfig> pckg;
2681 aMessage.ReadData1FromClientL(pckg);
2682 iImplementor.MvpcSetRotationL(pckg().iVideoRotation);
2686 TBool CMMFVideoPlayControllerCustomCommandParser::DoGetRotationL(TMMFMessage& aMessage)
2688 TPckgBuf<TMMFVideoConfig> pckg;
2689 iImplementor.MvpcGetRotationL(pckg().iVideoRotation);
2690 aMessage.WriteDataToClientL(pckg);
2694 TBool CMMFVideoPlayControllerCustomCommandParser::DoSetScaleFactorL(TMMFMessage& aMessage)
2696 TPckgBuf<TMMFVideoConfig> pckg;
2697 aMessage.ReadData1FromClientL(pckg);
2698 iImplementor.MvpcSetScaleFactorL(pckg().iWidthScalePercentage, pckg().iHeightScalePercentage, pckg().iAntiAliasFiltering);
2702 TBool CMMFVideoPlayControllerCustomCommandParser::DoGetScaleFactorL(TMMFMessage& aMessage)
2704 TPckgBuf<TMMFVideoConfig> pckg;
2705 iImplementor.MvpcGetScaleFactorL(pckg().iWidthScalePercentage, pckg().iHeightScalePercentage, pckg().iAntiAliasFiltering);
2706 aMessage.WriteDataToClientL(pckg);
2710 TBool CMMFVideoPlayControllerCustomCommandParser::DoSetCropRegionL(TMMFMessage& aMessage)
2712 TPckgBuf<TMMFVideoConfig> pckg;
2713 aMessage.ReadData1FromClientL(pckg);
2714 iImplementor.MvpcSetCropRegionL(pckg().iCropRectangle);
2718 TBool CMMFVideoPlayControllerCustomCommandParser::DoGetCropRegionL(TMMFMessage& aMessage)
2720 TPckgBuf<TMMFVideoConfig> pckg;
2721 iImplementor.MvpcGetCropRegionL(pckg().iCropRectangle);
2722 aMessage.WriteDataToClientL(pckg);
2726 // --------------------------------------------------------------------------------
2727 EXPORT_C CMMFVideoRecordControllerCustomCommandParser* CMMFVideoRecordControllerCustomCommandParser::NewL(MMMFVideoRecordControllerCustomCommandImplementor& aImplementor)
2729 return new(ELeave) CMMFVideoRecordControllerCustomCommandParser(aImplementor);
2732 EXPORT_C CMMFVideoRecordControllerCustomCommandParser::~CMMFVideoRecordControllerCustomCommandParser()
2734 delete iDataCopyBuffer;
2737 CMMFVideoRecordControllerCustomCommandParser::CMMFVideoRecordControllerCustomCommandParser(MMMFVideoRecordControllerCustomCommandImplementor& aImplementor) :
2738 CMMFCustomCommandParserBase(KUidInterfaceMMFVideoRecordController),
2739 iImplementor(aImplementor)
2743 void CMMFVideoRecordControllerCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
2745 if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFVideoRecordController)
2747 TRAPD(error, DoHandleRequestL(aMessage));
2749 aMessage.Complete(error);
2753 aMessage.Complete(KErrNotSupported);
2757 void CMMFVideoRecordControllerCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
2759 TBool complete = ETrue;
2760 switch (aMessage.Function())
2762 case EMMFVideoRecordControllerSetVideoFormat:
2763 complete = DoSetVideoFormatL(aMessage);
2765 case EMMFVideoRecordControllerSetAudioBitRate:
2766 complete = DoSetAudioBitRateL(aMessage);
2768 case EMMFVideoRecordControllerSetVideoBitRate:
2769 complete = DoSetVideoBitRateL(aMessage);
2771 case EMMFVideoRecordControllerSetAudioCodec:
2772 complete = DoSetAudioCodecL(aMessage);
2774 case EMMFVideoRecordControllerSetVideoCodec:
2775 complete = DoSetVideoCodecL(aMessage);
2777 case EMMFVideoRecordControllerAddMetaDataEntry:
2778 complete = DoAddMetaDataEntryL(aMessage);
2780 case EMMFVideoRecordControllerRemoveMetaDataEntry:
2781 complete = DoRemoveMetaDataEntryL(aMessage);
2783 case EMMFVideoRecordControllerReplaceMetaDataEntry:
2784 complete = DoReplaceMetaDataEntryL(aMessage);
2786 case EMMFVideoRecordControllerSetMaxFileSize:
2787 complete = DoSetMaxFileSizeL(aMessage);
2789 case EMMFVideoRecordControllerSetVideoFrameSize:
2790 complete = DoSetVideoFrameSizeL(aMessage);
2792 case EMMFVideoRecordControllerSetAudioEnabled:
2793 complete = DoSetAudioEnabledL(aMessage);
2795 case EMMFVideoRecordControllerPrepare:
2796 complete = DoPrepareL(aMessage);
2798 case EMMFVideoRecordControllerSetCameraHandle:
2799 complete = DoSetCameraHandleL(aMessage);
2801 case EMMFVideoRecordControllerGetRecordTimeAvailable:
2802 complete = DoGetRecordTimeAvailableL(aMessage);
2804 case EMMFVideoRecordControllerGetSupportedSinkAudioTypes:
2805 complete = DoGetSupportedSinkAudioTypesL(aMessage);
2807 case EMMFVideoRecordControllerGetSupportedSinkVideoTypes:
2808 complete = DoGetSupportedSinkVideoTypesL(aMessage);
2810 case EMMFVideoRecordControllerCopyDescriptorArrayData:
2811 complete = DoCopyCDesC8ArrayDataL(aMessage);
2813 case EMMFVideoRecordControllerCopyFourCCArrayData:
2814 complete = DoCopyFourCCArrayDataL(aMessage);
2816 case EMMFVideoRecordControllerGetAudioEnabled: //INC23777
2817 complete = DoGetAudioEnabledL(aMessage);
2820 User::Leave(KErrNotSupported);
2824 aMessage.Complete(KErrNone);
2831 TBool CMMFVideoRecordControllerCustomCommandParser::DoSetVideoBitRateL(TMMFMessage& aMessage)
2833 TPckgBuf<TMMFVideoConfig> pckg;
2834 aMessage.ReadData1FromClientL(pckg);
2835 iImplementor.MvrcSetVideoBitRateL(pckg().iVideoBitRate);
2839 TBool CMMFVideoRecordControllerCustomCommandParser::DoSetAudioBitRateL(TMMFMessage& aMessage)
2841 TPckgBuf<TMMFVideoConfig> pckg;
2842 aMessage.ReadData1FromClientL(pckg);
2843 iImplementor.MvrcSetAudioBitRateL(pckg().iAudioBitRate);
2848 TBool CMMFVideoRecordControllerCustomCommandParser::DoSetVideoCodecL(TMMFMessage& aMessage)
2850 TBuf8<KMaxMimeTypeLength> buf;
2851 aMessage.ReadData1FromClientL(buf);
2852 iImplementor.MvrcSetVideoCodecL(buf);
2856 TBool CMMFVideoRecordControllerCustomCommandParser::DoSetAudioCodecL(TMMFMessage& aMessage)
2858 TPckgBuf<TMMFVideoConfig> pckg;
2859 aMessage.ReadData1FromClientL(pckg);
2860 iImplementor.MvrcSetAudioCodecL(pckg().iAudioCodec);
2865 TBool CMMFVideoRecordControllerCustomCommandParser::DoSetVideoFormatL(TMMFMessage& aMessage)
2867 TPckgBuf<TMMFVideoConfig> pckg;
2868 aMessage.ReadData1FromClientL(pckg);
2869 iImplementor.MvrcSetVideoFormatL(pckg().iFormatUid);
2876 TBool CMMFVideoRecordControllerCustomCommandParser::DoAddMetaDataEntryL(TMMFMessage& aMessage)
2878 TInt bufSize = aMessage.SizeOfData1FromClient();
2879 // Leaving here in order to prevent a panic in the NewLC if the value is negative
2880 User::LeaveIfError(bufSize);
2881 HBufC8* buf = HBufC8::NewLC(bufSize);
2882 TPtr8 ptr = buf->Des();
2883 aMessage.ReadData1FromClientL(ptr);
2884 RDesReadStream stream;
2886 CleanupClosePushL(stream);
2887 CMMFMetaDataEntry* metaData = CMMFMetaDataEntry::NewL();
2888 CleanupStack::PushL(metaData);
2889 metaData->InternalizeL(stream);
2890 iImplementor.MvrcAddMetaDataEntryL(*metaData);
2891 CleanupStack::PopAndDestroy(3);//metaData, stream, buf
2895 TBool CMMFVideoRecordControllerCustomCommandParser::DoRemoveMetaDataEntryL(TMMFMessage& aMessage)
2897 TPckgBuf<TInt> pckg;
2898 aMessage.ReadData1FromClientL(pckg);
2899 iImplementor.MvrcRemoveMetaDataEntryL(pckg());
2903 TBool CMMFVideoRecordControllerCustomCommandParser::DoReplaceMetaDataEntryL(TMMFMessage& aMessage)
2905 // Get new meta data
2906 TInt bufSize = aMessage.SizeOfData1FromClient();
2907 // Leaving here in order to prevent a panic in the NewLC if the value is negative
2908 User::LeaveIfError(bufSize);
2909 HBufC8* buf = HBufC8::NewLC(bufSize);
2910 TPtr8 ptr = buf->Des();
2911 aMessage.ReadData1FromClientL(ptr);
2912 RDesReadStream stream;
2914 CleanupClosePushL(stream);
2915 CMMFMetaDataEntry* metaData = CMMFMetaDataEntry::NewL();
2916 CleanupStack::PushL(metaData);
2917 metaData->InternalizeL(stream);
2919 // Get index to replace
2920 TPckgBuf<TInt> indexPckg;
2921 aMessage.ReadData2FromClientL(indexPckg);
2923 iImplementor.MvrcReplaceMetaDataEntryL(indexPckg(), *metaData);
2925 CleanupStack::PopAndDestroy(3);//metaData, stream, buf
2929 TBool CMMFVideoRecordControllerCustomCommandParser::DoSetMaxFileSizeL(TMMFMessage& aMessage)
2931 TPckgBuf<TMMFVideoConfig> pckg;
2932 aMessage.ReadData1FromClientL(pckg);
2933 iImplementor.MvrcSetMaxFileSizeL(pckg().iMaxFileSize);
2937 TBool CMMFVideoRecordControllerCustomCommandParser::DoSetVideoFrameSizeL(TMMFMessage& aMessage)
2939 TPckgBuf<TMMFVideoConfig> pckg;
2940 aMessage.ReadData1FromClientL(pckg);
2941 iImplementor.MvrcSetVideoFrameSizeL(pckg().iVideoFrameSize);
2945 TBool CMMFVideoRecordControllerCustomCommandParser::DoSetAudioEnabledL(TMMFMessage& aMessage)
2947 TPckgBuf<TMMFVideoConfig> pckg;
2948 aMessage.ReadData1FromClientL(pckg);
2949 iImplementor.MvrcSetAudioEnabledL(pckg().iAudioEnabled);
2953 TBool CMMFVideoRecordControllerCustomCommandParser::DoPrepareL(TMMFMessage& /*aMessage*/)
2955 iImplementor.MvrcPrepareL();
2959 TBool CMMFVideoRecordControllerCustomCommandParser::DoSetCameraHandleL(TMMFMessage& aMessage)
2961 TPckgBuf<TMMFVideoConfig> pckg;
2962 aMessage.ReadData1FromClientL(pckg);
2963 iImplementor.MvrcSetCameraHandleL(pckg().iCameraHandle);
2967 TBool CMMFVideoRecordControllerCustomCommandParser::DoGetRecordTimeAvailableL(TMMFMessage& aMessage)
2969 TTimeIntervalMicroSeconds time;
2970 iImplementor.MvrcGetRecordTimeAvailableL(time);
2971 TPckgBuf<TMMFVideoConfig> pckg;
2972 pckg().iRecordTimeAvailable = time;
2973 aMessage.WriteDataToClientL(pckg);
2977 TBool CMMFVideoRecordControllerCustomCommandParser::DoCopyFourCCArrayDataL(TMMFMessage& aMessage)
2979 if (!iDataCopyBuffer)
2980 User::Leave(KErrNotReady);
2981 aMessage.WriteDataToClientL(iDataCopyBuffer->Ptr(0));
2986 TBool CMMFVideoRecordControllerCustomCommandParser::DoGetAudioEnabledL(TMMFMessage& aMessage)
2989 iImplementor.MvrcGetAudioEnabledL(enabled);
2990 TPckgBuf<TMMFVideoConfig> pckg;
2991 pckg().iAudioEnabled = enabled;
2992 aMessage.WriteDataToClientL(pckg);
2996 //--------------------------------------------------------------------------------------
2997 EXPORT_C CMMFVideoDRMExtCustomCommandParser* CMMFVideoDRMExtCustomCommandParser::NewL(MMMFVideoDRMExtCustomCommandImplementor& aImplementor)
2999 return new(ELeave) CMMFVideoDRMExtCustomCommandParser(aImplementor);
3002 EXPORT_C CMMFVideoDRMExtCustomCommandParser::~CMMFVideoDRMExtCustomCommandParser()
3004 delete iVideoFrameMessage;
3007 CMMFVideoDRMExtCustomCommandParser::CMMFVideoDRMExtCustomCommandParser(MMMFVideoDRMExtCustomCommandImplementor& aImplementor) :
3008 CMMFCustomCommandParserBase(KUidInterfaceMMFVideoDRMExt),
3009 iImplementor(aImplementor)
3013 void CMMFVideoDRMExtCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
3015 if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFVideoDRMExt)
3017 switch (aMessage.Function())
3019 case EMMFVideoDRMExtGetFrame:
3020 TRAPD(err, DoGetFrameL(aMessage));
3021 if (err!=KErrNone) // asynchronous, so only complete message if error occurred
3022 aMessage.Complete(err);
3025 aMessage.Complete(KErrNotSupported);
3031 aMessage.Complete(KErrNotSupported);
3035 void CMMFVideoDRMExtCustomCommandParser::DoGetFrameL(TMMFMessage& aMessage)
3037 delete iVideoFrameMessage;
3038 iVideoFrameMessage = NULL;
3040 iVideoFrameMessage = CMMFVideoFrameMessage::NewL(aMessage);
3041 TPckgBuf<ContentAccess::TIntent> intentPckg;
3042 aMessage.ReadData2FromClientL(intentPckg);
3043 iImplementor.MvdeGetFrameL(*iVideoFrameMessage, intentPckg());
3046 EXPORT_C RMMFVideoDRMExtCustomCommands::RMMFVideoDRMExtCustomCommands(RMMFController& aController) :
3047 RMMFCustomCommandsBase(aController, KUidInterfaceMMFVideoDRMExt)
3051 EXPORT_C void RMMFVideoDRMExtCustomCommands::GetFrame(CFbsBitmap& aBitmap, ContentAccess::TIntent aIntent, TRequestStatus& aStatus)
3053 iConfigPackage().iFrameBitmapServerHandle = aBitmap.Handle();
3054 iIntentPackage() = aIntent;
3055 iController.CustomCommandAsync(iDestinationPckg,
3056 EMMFVideoDRMExtGetFrame,
3062 //------------------------------------------------------------------------------
3063 EXPORT_C RMMFResourceNotificationCustomCommands::RMMFResourceNotificationCustomCommands(RMMFController& aController) :
3064 RMMFCustomCommandsBase(aController,KMMFEventCategoryAudioResourceAvailable)
3068 EXPORT_C TInt RMMFResourceNotificationCustomCommands::RegisterAsClient(TUid aEventType,const TDesC8& aNotificationRegistrationData)
3070 TPckgBuf<TMMFAudioConfig> configPackage;
3071 configPackage().iEventType = aEventType;
3072 configPackage().iNotificationRegistrationData = aNotificationRegistrationData;
3073 return iController.CustomCommandSync(iDestinationPckg,
3074 EMMFAudioResourceRegisterNotification,
3079 EXPORT_C TInt RMMFResourceNotificationCustomCommands::CancelRegisterAsClient(TUid aEventType)
3081 TPckgBuf<TMMFAudioConfig> configPackage;
3082 configPackage().iEventType = aEventType;
3083 return iController.CustomCommandSync(iDestinationPckg,
3084 EMMFAudioResourceCancelRegisterNotification,
3090 EXPORT_C TInt RMMFResourceNotificationCustomCommands::GetResourceNotificationData(TUid aEventType,TDes8& aNotificationData)
3092 TPckgBuf<TMMFAudioConfig> configPackage;
3093 configPackage().iEventType = aEventType;
3094 return iController.CustomCommandSync(iDestinationPckg,
3095 EMMFAudioResourceGetNotificationData,
3101 EXPORT_C TInt RMMFResourceNotificationCustomCommands::WillResumePlay()
3103 return iController.CustomCommandSync(iDestinationPckg,
3104 EMMFAudioResourceWillResumePlay,
3109 EXPORT_C CMMFResourceNotificationCustomCommandParser* CMMFResourceNotificationCustomCommandParser::NewL(MMMFResourceNotificationCustomCommandImplementor& aImplementor)
3111 return new(ELeave) CMMFResourceNotificationCustomCommandParser(aImplementor);
3114 EXPORT_C CMMFResourceNotificationCustomCommandParser::~CMMFResourceNotificationCustomCommandParser()
3118 CMMFResourceNotificationCustomCommandParser::CMMFResourceNotificationCustomCommandParser( MMMFResourceNotificationCustomCommandImplementor& aImplementor) :
3119 CMMFCustomCommandParserBase(KMMFEventCategoryAudioResourceAvailable),
3120 iImplementor(aImplementor)
3124 void CMMFResourceNotificationCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
3126 if (aMessage.Destination().InterfaceId() == KMMFEventCategoryAudioResourceAvailable)
3128 TRAPD(error, DoHandleRequestL(aMessage));
3131 aMessage.Complete(error);
3136 aMessage.Complete(KErrNotSupported);
3140 void CMMFResourceNotificationCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
3142 TBool complete = ETrue;
3143 switch (aMessage.Function())
3145 case EMMFAudioResourceRegisterNotification:
3146 complete = DoRegisterAsClientL(aMessage);
3148 case EMMFAudioResourceCancelRegisterNotification:
3149 complete = DoCancelRegisterAsClientL(aMessage);
3151 case EMMFAudioResourceGetNotificationData:
3152 complete = DoGetResourceNotificationDataL(aMessage);
3154 case EMMFAudioResourceWillResumePlay:
3155 complete = DoWillResumePlayL(aMessage);
3158 User::Leave(KErrNotSupported);
3163 aMessage.Complete(KErrNone);
3167 EXPORT_C TBool CMMFResourceNotificationCustomCommandParser::DoRegisterAsClientL(TMMFMessage& aMessage)
3169 TPckgBuf<TMMFAudioConfig> pckg;
3170 aMessage.ReadData1FromClientL(pckg);
3171 iImplementor.MarnRegisterAsClientL(pckg().iEventType, pckg().iNotificationRegistrationData);
3175 EXPORT_C TBool CMMFResourceNotificationCustomCommandParser::DoCancelRegisterAsClientL(TMMFMessage& aMessage)
3177 TPckgBuf<TMMFAudioConfig> pckg;
3178 aMessage.ReadData1FromClientL(pckg);
3179 iImplementor.MarnCancelRegisterAsClientL(pckg().iEventType);
3183 EXPORT_C TBool CMMFResourceNotificationCustomCommandParser::DoGetResourceNotificationDataL(TMMFMessage& aMessage)
3185 TPckgBuf<TMMFAudioConfig> pckg;
3186 aMessage.ReadData1FromClientL(pckg);
3187 iImplementor.MarnGetResourceNotificationDataL(pckg().iEventType, pckg().iNotificationData);
3188 TPtrC8 tmp(pckg().iNotificationData);
3189 aMessage.WriteDataToClientL(pckg().iNotificationData);
3193 EXPORT_C TBool CMMFResourceNotificationCustomCommandParser::DoWillResumePlayL(TMMFMessage& aMessage)
3195 iImplementor.MarnWillResumePlayL();
3196 aMessage.Complete(KErrNone);
3200 EXPORT_C RMMFVideoSetInitScreenCustomCommands::RMMFVideoSetInitScreenCustomCommands(RMMFController& aController) :
3201 RMMFCustomCommandsBase(aController, KUidInterfaceMMFVideoSetInitScreen)
3205 EXPORT_C TInt RMMFVideoSetInitScreenCustomCommands::SetInitScreenNumber(TInt aScreenNumber)
3207 TPckgBuf<TInt> configPackage;
3208 configPackage() = aScreenNumber;
3209 return iController.CustomCommandSync(iDestinationPckg,
3210 EMMFVideoSetInitScreenNumber,
3215 EXPORT_C CMMFVideoSetInitScreenCustomCommandParser* CMMFVideoSetInitScreenCustomCommandParser::NewL(MMMFVideoSetInitScreenCustomCommandImplementor& aImplementor)
3217 return new(ELeave) CMMFVideoSetInitScreenCustomCommandParser(aImplementor);
3220 EXPORT_C CMMFVideoSetInitScreenCustomCommandParser::~CMMFVideoSetInitScreenCustomCommandParser()
3224 CMMFVideoSetInitScreenCustomCommandParser::CMMFVideoSetInitScreenCustomCommandParser(MMMFVideoSetInitScreenCustomCommandImplementor& aImplementor) :
3225 CMMFCustomCommandParserBase(KUidInterfaceMMFVideoSetInitScreen),
3226 iImplementor(aImplementor)
3230 void CMMFVideoSetInitScreenCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
3232 if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFVideoSetInitScreen)
3234 TRAPD(error, DoHandleRequestL(aMessage));
3237 aMessage.Complete(error);
3242 aMessage.Complete(KErrNotSupported);
3246 void CMMFVideoSetInitScreenCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
3248 TBool complete = ETrue;
3249 switch (aMessage.Function())
3251 case EMMFVideoSetInitScreenNumber:
3252 complete = DoSetInitScreenNumberL(aMessage);
3255 User::Leave(KErrNotSupported);
3260 aMessage.Complete(KErrNone);
3264 TBool CMMFVideoSetInitScreenCustomCommandParser::DoSetInitScreenNumberL(TMMFMessage& aMessage)
3266 TPckgBuf<TInt> pckg;
3267 aMessage.ReadData1FromClientL(pckg);
3268 iImplementor.MvsdSetInitScreenNumber(pckg());
3272 _LIT(KMMFStandardCustomCommandsPanicCategory, "MMFStandardCustomCommands");
3273 GLDEF_C void Panic(TMmfSCCPanic aError)
3275 User::Panic(KMMFStandardCustomCommandsPanicCategory, aError);
3279 EXPORT_C RMMFVideoPixelAspectRatioCustomCommands::RMMFVideoPixelAspectRatioCustomCommands(RMMFController& aController) :
3280 RMMFCustomCommandsBase(aController, KUidInterfaceMMFVideoPixelAspectRatio)
3284 EXPORT_C TInt RMMFVideoPixelAspectRatioCustomCommands::SetPixelAspectRatio(const TVideoAspectRatio& aAspectRatio)
3286 TPckgBuf<TVideoAspectRatio> configPackage;
3287 configPackage() = aAspectRatio;
3288 return iController.CustomCommandSync(iDestinationPckg,
3289 EMMFVideoSetPixelAspectRatio,
3294 EXPORT_C TInt RMMFVideoPixelAspectRatioCustomCommands::GetPixelAspectRatio(TVideoAspectRatio& aAspectRatio) const
3296 TPckgBuf<TVideoAspectRatio> configPackage;
3298 TInt err = iController.CustomCommandSync(iDestinationPckg,
3299 EMMFVideoGetPixelAspectRatio,
3306 aAspectRatio = configPackage();
3311 EXPORT_C void RMMFVideoPixelAspectRatioCustomCommands::GetSupportedPixelAspectRatiosL(RArray<TVideoAspectRatio>& aAspectRatios) const
3313 DoGetVideoPixelAspectRatioArrayL(aAspectRatios, EMMFVideoGetSupportedPixelAspectRatios);
3316 void RMMFVideoPixelAspectRatioCustomCommands::DoGetVideoPixelAspectRatioArrayL(RArray<TVideoAspectRatio>& aArray, TMMFVideoPixelAspectRatioMessages aIpc) const
3320 TPckgBuf<TInt> numberOfElementsPckg;
3321 User::LeaveIfError(iController.CustomCommandSync(iDestinationPckg,
3325 numberOfElementsPckg));
3327 HBufC8* buf = HBufC8::NewLC(numberOfElementsPckg()*sizeof(TVideoAspectRatio));
3328 TPtr8 ptr = buf->Des();
3330 User::LeaveIfError(iController.CustomCommandSync(iDestinationPckg,
3331 EMMFVideoPixelAspectRatioCopyArrayData,
3335 RDesReadStream stream(ptr);
3337 CleanupClosePushL(stream);
3339 for (TInt i=0; i<numberOfElementsPckg(); i++)
3341 User::LeaveIfError(aArray.Append(TVideoAspectRatio(stream.ReadInt32L(), stream.ReadInt32L())));
3344 CleanupStack::PopAndDestroy(2, buf);//stream, buf
3347 EXPORT_C CMMFVideoPixelAspectRatioCustomCommandParser* CMMFVideoPixelAspectRatioCustomCommandParser::NewL(MMMFVideoPixelAspectRatioCustomCommandImplementor& aImplementor)
3349 return new(ELeave) CMMFVideoPixelAspectRatioCustomCommandParser(aImplementor);
3352 EXPORT_C CMMFVideoPixelAspectRatioCustomCommandParser::~CMMFVideoPixelAspectRatioCustomCommandParser()
3356 delete iDataCopyBuffer;
3360 CMMFVideoPixelAspectRatioCustomCommandParser::CMMFVideoPixelAspectRatioCustomCommandParser(MMMFVideoPixelAspectRatioCustomCommandImplementor& aImplementor) :
3361 CMMFCustomCommandParserBase(KUidInterfaceMMFVideoPixelAspectRatio),
3362 iImplementor(aImplementor)
3366 void CMMFVideoPixelAspectRatioCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
3368 if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFVideoPixelAspectRatio)
3370 TRAPD(error, DoHandleRequestL(aMessage));
3373 aMessage.Complete(error);
3378 aMessage.Complete(KErrNotSupported);
3382 void CMMFVideoPixelAspectRatioCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
3384 TBool complete = ETrue;
3385 switch (aMessage.Function())
3387 case EMMFVideoSetPixelAspectRatio:
3388 complete = DoSetPixelAspectRatioL(aMessage);
3390 case EMMFVideoGetPixelAspectRatio:
3391 complete = DoGetPixelAspectRatioL(aMessage);
3393 case EMMFVideoGetSupportedPixelAspectRatios:
3394 complete = DoGetSupportedPixelAspectRatiosL(aMessage);
3396 case EMMFVideoPixelAspectRatioCopyArrayData:
3397 complete = DoCopyArrayDataL(aMessage);
3400 User::Leave(KErrNotSupported);
3405 aMessage.Complete(KErrNone);
3409 TBool CMMFVideoPixelAspectRatioCustomCommandParser::DoSetPixelAspectRatioL(TMMFMessage& aMessage)
3411 TPckgBuf<TVideoAspectRatio> pckg;
3412 aMessage.ReadData1FromClientL(pckg);
3413 iImplementor.MvparSetPixelAspectRatioL(pckg());
3417 TBool CMMFVideoPixelAspectRatioCustomCommandParser::DoGetPixelAspectRatioL(TMMFMessage& aMessage)
3419 TVideoAspectRatio aspectRatio;
3420 iImplementor.MvparGetPixelAspectRatioL(aspectRatio);
3421 TPckgBuf<TVideoAspectRatio> pckg;
3422 pckg() = aspectRatio;
3423 aMessage.WriteDataToClientL(pckg);
3427 TBool CMMFVideoPixelAspectRatioCustomCommandParser::DoGetSupportedPixelAspectRatiosL(TMMFMessage& aMessage)
3429 RArray<TVideoAspectRatio> array;
3430 CleanupClosePushL(array);
3431 iImplementor.MvparGetSupportedPixelAspectRatiosL(array);
3433 DoCreateBufFromVideoAspectRatioArrayL(array);
3435 TPckgBuf<TInt> pckg;
3436 pckg() = array.Count();
3437 aMessage.WriteDataToClientL(pckg);
3439 CleanupStack::PopAndDestroy(&array);
3443 void CMMFVideoPixelAspectRatioCustomCommandParser::DoCreateBufFromVideoAspectRatioArrayL(RArray<TVideoAspectRatio>& aArray)
3445 delete iDataCopyBuffer;
3446 iDataCopyBuffer = NULL;
3448 iDataCopyBuffer = CBufFlat::NewL(KBufExpandSize8);
3449 RBufWriteStream stream;
3450 stream.Open(*iDataCopyBuffer);
3451 CleanupClosePushL(stream);
3452 for (TInt i=0;i<aArray.Count();i++)
3454 stream.WriteInt32L(aArray[i].iNumerator);
3455 stream.WriteInt32L(aArray[i].iDenominator);
3457 CleanupStack::PopAndDestroy(&stream);
3460 TBool CMMFVideoPixelAspectRatioCustomCommandParser::DoCopyArrayDataL(TMMFMessage& aMessage)
3462 if (!iDataCopyBuffer)
3464 User::Leave(KErrNotReady);
3466 aMessage.WriteDataToClientL(iDataCopyBuffer->Ptr(0));
3470 EXPORT_C RMMFVideoAudioSamplingRateAndChannelConfigCustomCommands::RMMFVideoAudioSamplingRateAndChannelConfigCustomCommands(RMMFController& aController) :
3471 RMMFCustomCommandsBase(aController, KUidInterfaceMMFVideoAudioSamplingRateAndChannelConfig)
3475 EXPORT_C TInt RMMFVideoAudioSamplingRateAndChannelConfigCustomCommands::SetAudioChannels(const TUint aNumChannels)
3477 TPckgBuf<TUint> configPackage;
3478 configPackage() = aNumChannels;
3479 return iController.CustomCommandSync(iDestinationPckg,
3480 EMMFVideoSetAudioChannels,
3485 EXPORT_C TInt RMMFVideoAudioSamplingRateAndChannelConfigCustomCommands::GetAudioChannels(TUint& aAudioChannels) const
3487 TPckgBuf<TUint> configPackage;
3489 TInt err = iController.CustomCommandSync(iDestinationPckg,
3490 EMMFVideoGetAudioChannels,
3497 aAudioChannels = configPackage();
3502 EXPORT_C void RMMFVideoAudioSamplingRateAndChannelConfigCustomCommands::GetSupportedAudioChannelsL(RArray<TUint>& aChannels) const
3504 DoGetUintArrayL(aChannels, EMMFVideoGetSupportedAudioChannels);
3507 EXPORT_C TInt RMMFVideoAudioSamplingRateAndChannelConfigCustomCommands::SetAudioSampleRate(const TUint aSampleRate)
3509 TPckgBuf<TUint> configPackage;
3510 configPackage() = aSampleRate;
3511 return iController.CustomCommandSync(iDestinationPckg,
3512 EMMFVideoSetAudioSampleRate,
3517 EXPORT_C TInt RMMFVideoAudioSamplingRateAndChannelConfigCustomCommands::GetAudioSampleRate(TUint& aSampleRate) const
3519 TPckgBuf<TUint> configPackage;
3521 TInt err = iController.CustomCommandSync(iDestinationPckg,
3522 EMMFVideoGetAudioSampleRate,
3529 aSampleRate = configPackage();
3534 EXPORT_C void RMMFVideoAudioSamplingRateAndChannelConfigCustomCommands::GetSupportedAudioSampleRatesL(RArray<TUint>& aSampleRates) const
3536 DoGetUintArrayL(aSampleRates, EMMFVideoGetSupportedAudioSampleRates);
3539 void RMMFVideoAudioSamplingRateAndChannelConfigCustomCommands::DoGetUintArrayL(RArray<TUint>& aArray, TMMFVideoAudioSamplingRateAndChannelConfigMessages aIpc) const
3543 TPckgBuf<TInt> numberOfElementsPckg;
3544 User::LeaveIfError(iController.CustomCommandSync(iDestinationPckg,
3548 numberOfElementsPckg));
3550 HBufC8* buf = HBufC8::NewLC(numberOfElementsPckg()*sizeof(TUint));
3551 TPtr8 ptr = buf->Des();
3553 User::LeaveIfError(iController.CustomCommandSync(iDestinationPckg,
3554 EMMFVideoAudioSamplingRateAndChannelConfigCopyArrayData,
3558 RDesReadStream stream(ptr);
3560 CleanupClosePushL(stream);
3562 for (TInt i=0; i<numberOfElementsPckg(); i++)
3564 User::LeaveIfError(aArray.Append(stream.ReadUint32L()));
3567 CleanupStack::PopAndDestroy(2, buf);//stream, buf
3571 EXPORT_C CMMFVideoAudioSamplingRateAndChannelConfigCustomCommandParser* CMMFVideoAudioSamplingRateAndChannelConfigCustomCommandParser::NewL(MMMFVideoAudioSamplingRateAndChannelConfigCustomCommandImplementor& aImplementor)
3573 return new(ELeave) CMMFVideoAudioSamplingRateAndChannelConfigCustomCommandParser(aImplementor);
3576 EXPORT_C CMMFVideoAudioSamplingRateAndChannelConfigCustomCommandParser::~CMMFVideoAudioSamplingRateAndChannelConfigCustomCommandParser()
3580 delete iDataCopyBuffer;
3584 CMMFVideoAudioSamplingRateAndChannelConfigCustomCommandParser::CMMFVideoAudioSamplingRateAndChannelConfigCustomCommandParser(MMMFVideoAudioSamplingRateAndChannelConfigCustomCommandImplementor& aImplementor) :
3585 CMMFCustomCommandParserBase(KUidInterfaceMMFVideoAudioSamplingRateAndChannelConfig),
3586 iImplementor(aImplementor)
3590 void CMMFVideoAudioSamplingRateAndChannelConfigCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
3592 if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFVideoAudioSamplingRateAndChannelConfig)
3594 TRAPD(error, DoHandleRequestL(aMessage));
3597 aMessage.Complete(error);
3602 aMessage.Complete(KErrNotSupported);
3606 void CMMFVideoAudioSamplingRateAndChannelConfigCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
3608 TBool complete = ETrue;
3609 switch (aMessage.Function())
3611 case EMMFVideoSetAudioChannels:
3612 complete = DoSetAudioChannelsL(aMessage);
3614 case EMMFVideoGetAudioChannels:
3615 complete = DoGetAudioChannelsL(aMessage);
3617 case EMMFVideoGetSupportedAudioChannels:
3618 complete = DoGetSupportedAudioChannelsL(aMessage);
3620 case EMMFVideoSetAudioSampleRate:
3621 complete = DoSetAudioSampleRateL(aMessage);
3623 case EMMFVideoGetAudioSampleRate:
3624 complete = DoGetAudioSampleRateL(aMessage);
3626 case EMMFVideoGetSupportedAudioSampleRates:
3627 complete = DoGetSupportedAudioSampleRatesL(aMessage);
3629 case EMMFVideoAudioSamplingRateAndChannelConfigCopyArrayData:
3630 complete = DoCopyArrayDataL(aMessage);
3633 User::Leave(KErrNotSupported);
3638 aMessage.Complete(KErrNone);
3643 TBool CMMFVideoAudioSamplingRateAndChannelConfigCustomCommandParser::DoSetAudioChannelsL(TMMFMessage& aMessage)
3645 TPckgBuf<TUint> pckg;
3646 aMessage.ReadData1FromClientL(pckg);
3647 iImplementor.MvasrccSetAudioChannelsL(pckg());
3651 TBool CMMFVideoAudioSamplingRateAndChannelConfigCustomCommandParser::DoGetAudioChannelsL(TMMFMessage& aMessage)
3654 iImplementor.MvasrccGetAudioChannelsL(channels);
3655 TPckgBuf<TUint> pckg;
3657 aMessage.WriteDataToClientL(pckg);
3661 TBool CMMFVideoAudioSamplingRateAndChannelConfigCustomCommandParser::DoGetSupportedAudioChannelsL(TMMFMessage& aMessage)
3663 RArray<TUint> audioChannels;
3664 CleanupClosePushL(audioChannels);
3665 iImplementor.MvasrccGetSupportedAudioChannelsL(audioChannels);
3667 DoCreateBufFromUintArrayL(audioChannels);
3669 TPckgBuf<TInt> pckg;
3670 pckg() = audioChannels.Count();
3671 aMessage.WriteDataToClientL(pckg);
3673 CleanupStack::PopAndDestroy(&audioChannels);
3677 TBool CMMFVideoAudioSamplingRateAndChannelConfigCustomCommandParser::DoSetAudioSampleRateL(TMMFMessage& aMessage)
3679 TPckgBuf<TUint> pckg;
3680 aMessage.ReadData1FromClientL(pckg);
3681 iImplementor.MvasrccSetAudioSampleRateL(pckg());
3685 TBool CMMFVideoAudioSamplingRateAndChannelConfigCustomCommandParser::DoGetAudioSampleRateL(TMMFMessage& aMessage)
3687 TUint sampleRate = 0;
3688 iImplementor.MvasrccGetAudioSampleRateL(sampleRate);
3689 TPckgBuf<TUint> pckg;
3690 pckg() = sampleRate;
3691 aMessage.WriteDataToClientL(pckg);
3695 TBool CMMFVideoAudioSamplingRateAndChannelConfigCustomCommandParser::DoGetSupportedAudioSampleRatesL(TMMFMessage& aMessage)
3697 RArray<TUint> sampleRates;
3698 CleanupClosePushL(sampleRates);
3699 iImplementor.MvasrccGetSupportedAudioSampleRatesL(sampleRates);
3701 DoCreateBufFromUintArrayL(sampleRates);
3703 TPckgBuf<TInt> pckg;
3704 pckg() = sampleRates.Count();
3705 aMessage.WriteDataToClientL(pckg);
3707 CleanupStack::PopAndDestroy(&sampleRates);
3711 void CMMFVideoAudioSamplingRateAndChannelConfigCustomCommandParser::DoCreateBufFromUintArrayL(RArray<TUint>& aArray)
3713 delete iDataCopyBuffer;
3714 iDataCopyBuffer = NULL;
3716 iDataCopyBuffer = CBufFlat::NewL(KBufExpandSize8);
3717 RBufWriteStream stream;
3718 stream.Open(*iDataCopyBuffer);
3719 CleanupClosePushL(stream);
3720 for (TInt i=0;i<aArray.Count();i++)
3722 stream.WriteUint32L(aArray[i]);
3724 CleanupStack::PopAndDestroy(&stream);
3727 TBool CMMFVideoAudioSamplingRateAndChannelConfigCustomCommandParser::DoCopyArrayDataL(TMMFMessage& aMessage)
3729 if (!iDataCopyBuffer)
3731 User::Leave(KErrNotReady);
3733 aMessage.WriteDataToClientL(iDataCopyBuffer->Ptr(0));
3738 EXPORT_C CMMFVideoPlayControllerExtCustomCommandParser* CMMFVideoPlayControllerExtCustomCommandParser::NewL(MMMFVideoPlayControllerExtCustomCommandImplementor& aImplementor)
3740 return new(ELeave) CMMFVideoPlayControllerExtCustomCommandParser(aImplementor);
3743 EXPORT_C CMMFVideoPlayControllerExtCustomCommandParser::~CMMFVideoPlayControllerExtCustomCommandParser()
3747 CMMFVideoPlayControllerExtCustomCommandParser::CMMFVideoPlayControllerExtCustomCommandParser(MMMFVideoPlayControllerExtCustomCommandImplementor& aImplementor) :
3748 CMMFCustomCommandParserBase(KUidInterfaceMMFVideoPlayExt),
3749 iImplementor(aImplementor)
3753 void CMMFVideoPlayControllerExtCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
3755 if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFVideoPlayExt)
3757 TRAPD(error, DoHandleRequestL(aMessage));
3760 aMessage.Complete(error);
3765 aMessage.Complete(KErrNotSupported);
3769 void CMMFVideoPlayControllerExtCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
3771 TBool complete = ETrue;
3773 switch (aMessage.Function())
3775 case EMMFVideoPlayControllerSetPlayVelocity:
3776 complete = DoSetPlayVelocityL(aMessage);
3778 case EMMFVideoPlayControllerPlayVelocity:
3779 complete = DoPlayVelocityL(aMessage);
3781 case EMMFVideoPlayControllerStepFrame:
3782 complete = DoStepFrameL(aMessage);
3784 case EMMFVideoPlayControllerGetPlayRateCapabilities:
3785 complete = DoGetPlayRateCapabilitiesL(aMessage);
3787 case EMMFVideoPlayControllerSetVideoEnabled:
3788 complete = DoSetVideoEnabledL(aMessage);
3790 case EMMFVideoPlayControllerVideoEnabled:
3791 complete = DoVideoEnabledL(aMessage);
3793 case EMMFVideoPlayControllerSetAudioEnabled:
3794 complete = DoSetAudioEnabledL(aMessage);
3796 case EMMFVideoPlayControllerSetAutoScale:
3797 complete = DoSetAutoScaleL(aMessage);
3800 User::Leave(KErrNotSupported);
3806 aMessage.Complete(KErrNone);
3810 TBool CMMFVideoPlayControllerExtCustomCommandParser::DoSetPlayVelocityL(TMMFMessage& aMessage)
3812 TPckgBuf<TInt> pckg;
3813 aMessage.ReadData1FromClientL(pckg);
3814 iImplementor.MvpecSetPlayVelocityL(pckg());
3819 TBool CMMFVideoPlayControllerExtCustomCommandParser::DoPlayVelocityL(TMMFMessage& aMessage)
3821 TPckgBuf<TInt> pckg;
3823 pckg() = iImplementor.MvpecPlayVelocityL();
3825 aMessage.WriteDataToClientL(pckg);
3830 TBool CMMFVideoPlayControllerExtCustomCommandParser::DoStepFrameL(TMMFMessage& aMessage)
3832 TPckgBuf<TInt> pckg;
3833 aMessage.ReadData1FromClientL(pckg);
3834 iImplementor.MvpecStepFrameL(pckg());
3839 TBool CMMFVideoPlayControllerExtCustomCommandParser::DoGetPlayRateCapabilitiesL(TMMFMessage& aMessage)
3841 TPckgBuf<TVideoPlayRateCapabilities> pckg;
3843 iImplementor.MvpecGetPlayRateCapabilitiesL(pckg());
3845 aMessage.WriteDataToClientL(pckg);
3850 TBool CMMFVideoPlayControllerExtCustomCommandParser::DoSetVideoEnabledL(TMMFMessage& aMessage)
3852 TPckgBuf<TBool> pckg;
3853 aMessage.ReadData1FromClientL(pckg);
3854 iImplementor.MvpecSetVideoEnabledL(pckg());
3859 TBool CMMFVideoPlayControllerExtCustomCommandParser::DoVideoEnabledL(TMMFMessage& aMessage)
3861 TPckgBuf<TBool> pckg;
3863 pckg() = iImplementor.MvpecVideoEnabledL();
3865 aMessage.WriteDataToClientL(pckg);
3869 TBool CMMFVideoPlayControllerExtCustomCommandParser::DoSetAudioEnabledL(TMMFMessage& aMessage)
3871 TPckgBuf<TBool> pckg;
3872 aMessage.ReadData1FromClientL(pckg);
3873 iImplementor.MvpecSetAudioEnabledL(pckg());
3878 TBool CMMFVideoPlayControllerExtCustomCommandParser::DoSetAutoScaleL(TMMFMessage& aMessage)
3880 TPckgBuf<TMMFVideoPlayAutoScaleParams> pckg;
3881 aMessage.ReadData1FromClientL(pckg);
3882 iImplementor.MvpecSetAutoScaleL(pckg().iScaleType,pckg().iHorizPos , pckg().iVertPos );
3887 EXPORT_C RMMFVideoPlayControllerExtCustomCommands::RMMFVideoPlayControllerExtCustomCommands(RMMFController& aController) :
3888 RMMFCustomCommandsBase(aController, KUidInterfaceMMFVideoPlayExt)
3892 EXPORT_C TInt RMMFVideoPlayControllerExtCustomCommands::SetPlayVelocity(TInt aVelocity)
3894 TPckgBuf<TInt> pckg(aVelocity);
3895 return iController.CustomCommandSync(iDestinationPckg,
3896 EMMFVideoPlayControllerSetPlayVelocity,
3901 EXPORT_C TInt RMMFVideoPlayControllerExtCustomCommands::PlayVelocity(TInt &aVelocity) const
3903 TPckgBuf<TInt> pckg;
3904 TInt error = iController.CustomCommandSync(iDestinationPckg,
3905 EMMFVideoPlayControllerPlayVelocity,
3909 if (error == KErrNone)
3916 EXPORT_C TInt RMMFVideoPlayControllerExtCustomCommands::StepFrame(TInt aStep)
3918 TPckgBuf<TInt> pckg(aStep);
3919 return iController.CustomCommandSync(iDestinationPckg,
3920 EMMFVideoPlayControllerStepFrame,
3925 EXPORT_C TInt RMMFVideoPlayControllerExtCustomCommands::GetPlayRateCapabilities(TVideoPlayRateCapabilities& aCapabilities) const
3927 TPckgBuf<TVideoPlayRateCapabilities> pckg;
3928 TInt error = iController.CustomCommandSync(iDestinationPckg,
3929 EMMFVideoPlayControllerGetPlayRateCapabilities,
3935 aCapabilities = pckg();
3940 EXPORT_C TInt RMMFVideoPlayControllerExtCustomCommands::SetVideoEnabled(TBool aVideoEnabled)
3942 TPckgBuf<TBool> pckg(aVideoEnabled);
3943 return iController.CustomCommandSync(iDestinationPckg,
3944 EMMFVideoPlayControllerSetVideoEnabled,
3949 EXPORT_C TInt RMMFVideoPlayControllerExtCustomCommands::VideoEnabled(TBool &aVideoEnabled) const
3951 TPckgBuf<TBool> pckg;
3952 TInt error = iController.CustomCommandSync(iDestinationPckg,
3953 EMMFVideoPlayControllerVideoEnabled,
3957 if (error == KErrNone)
3959 aVideoEnabled = pckg();
3964 EXPORT_C TInt RMMFVideoPlayControllerExtCustomCommands::SetAudioEnabled(TBool aAudioEnabled)
3966 TPckgBuf<TBool> pckg(aAudioEnabled);
3967 return iController.CustomCommandSync(iDestinationPckg,
3968 EMMFVideoPlayControllerSetAudioEnabled,
3973 EXPORT_C TInt RMMFVideoPlayControllerExtCustomCommands::SetAutoScale(TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos)
3975 TPckgBuf<TMMFVideoPlayAutoScaleParams> pckg;
3977 pckg().iScaleType = aScaleType;
3978 pckg().iHorizPos = aHorizPos;
3979 pckg().iVertPos = aVertPos;
3981 return iController.CustomCommandSync(iDestinationPckg,
3982 EMMFVideoPlayControllerSetAutoScale,
3988 EXPORT_C CMMFVideoRecordControllerExtCustomCommandParser* CMMFVideoRecordControllerExtCustomCommandParser::NewL(MMMFVideoRecordControllerExtCustomCommandImplementor& aImplementor)
3990 return new(ELeave) CMMFVideoRecordControllerExtCustomCommandParser(aImplementor);
3993 EXPORT_C CMMFVideoRecordControllerExtCustomCommandParser::~CMMFVideoRecordControllerExtCustomCommandParser()
3997 CMMFVideoRecordControllerExtCustomCommandParser::CMMFVideoRecordControllerExtCustomCommandParser(MMMFVideoRecordControllerExtCustomCommandImplementor& aImplementor) :
3998 CMMFCustomCommandParserBase(KUidInterfaceMMFVideoRecorderExt),
3999 iImplementor(aImplementor)
4003 void CMMFVideoRecordControllerExtCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
4005 if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFVideoRecorderExt)
4007 TRAPD(error, DoHandleRequestL(aMessage));
4010 aMessage.Complete(error);
4015 aMessage.Complete(KErrNotSupported);
4019 void CMMFVideoRecordControllerExtCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
4021 TBool complete = ETrue;
4022 switch (aMessage.Function())
4024 case EMMFVideoRecordControllerSetVideoEnabled:
4025 complete = DoSetVideoEnabledL(aMessage);
4027 case EMMFVideoRecordControllerVideoEnabled:
4028 complete = DoVideoEnabledL(aMessage);
4030 case EMMFVideoRecordControllerSetVideoQuality:
4031 complete = DoSetVideoQualityL(aMessage);
4033 case EMMFVideoRecordControllerVideoQuality:
4034 complete = DoVideoQualityL(aMessage);
4036 case EMMFVideoRecordControllerSetVideoFrameRateFixed:
4037 complete = DoSetVideoFrameRateFixedL(aMessage);
4039 case EMMFVideoRecordControllerVideoFrameRateFixed:
4040 complete = DoVideoFrameRateFixedL(aMessage);
4043 User::Leave(KErrNotSupported);
4048 aMessage.Complete(KErrNone);
4052 TBool CMMFVideoRecordControllerExtCustomCommandParser::DoSetVideoEnabledL(TMMFMessage& aMessage)
4054 TPckgBuf<TBool> pckg;
4055 aMessage.ReadData1FromClientL(pckg);
4056 iImplementor.MvrecSetVideoEnabledL(pckg());
4061 TBool CMMFVideoRecordControllerExtCustomCommandParser::DoVideoEnabledL(TMMFMessage& aMessage)
4063 TPckgBuf<TInt> pckg;
4065 pckg() = iImplementor.MvrecVideoEnabledL();
4067 aMessage.WriteDataToClientL(pckg);
4072 TBool CMMFVideoRecordControllerExtCustomCommandParser::DoSetVideoQualityL(TMMFMessage& aMessage)
4074 TPckgBuf<TInt> pckg;
4075 aMessage.ReadData1FromClientL(pckg);
4076 iImplementor.MvrecSetVideoQualityL(pckg());
4081 TBool CMMFVideoRecordControllerExtCustomCommandParser::DoVideoQualityL(TMMFMessage& aMessage)
4083 TPckgBuf<TInt> pckg;
4085 pckg() = iImplementor.MvrecVideoQualityL();
4087 aMessage.WriteDataToClientL(pckg);
4092 TBool CMMFVideoRecordControllerExtCustomCommandParser::DoSetVideoFrameRateFixedL(TMMFMessage& aMessage)
4094 TPckgBuf<TBool> pckg;
4095 aMessage.ReadData1FromClientL(pckg);
4096 iImplementor.MvrecSetVideoFrameRateFixedL(pckg());
4101 TBool CMMFVideoRecordControllerExtCustomCommandParser::DoVideoFrameRateFixedL(TMMFMessage& aMessage)
4103 TPckgBuf<TBool> pckg;
4105 pckg() = iImplementor.MvrecVideoFrameRateFixedL();
4107 aMessage.WriteDataToClientL(pckg);
4112 EXPORT_C RMMFVideoRecordControllerExtCustomCommands::RMMFVideoRecordControllerExtCustomCommands(RMMFController& aController) :
4113 RMMFCustomCommandsBase(aController, KUidInterfaceMMFVideoRecorderExt)
4117 EXPORT_C TInt RMMFVideoRecordControllerExtCustomCommands::SetVideoEnabled(TBool aEnabled)
4119 TPckgBuf<TBool> pckg(aEnabled);
4120 return iController.CustomCommandSync(iDestinationPckg,
4121 EMMFVideoRecordControllerSetVideoEnabled,
4126 EXPORT_C TInt RMMFVideoRecordControllerExtCustomCommands::VideoEnabled(TBool &aEnabled) const
4128 TPckgBuf<TBool> pckg(EFalse);
4131 error = iController.CustomCommandSync(iDestinationPckg,
4132 EMMFVideoRecordControllerVideoEnabled,
4136 if (error == KErrNone)
4143 EXPORT_C TInt RMMFVideoRecordControllerExtCustomCommands::SetVideoQuality(TInt aQuality)
4145 TPckgBuf<TInt> pckg(aQuality);
4146 return iController.CustomCommandSync(iDestinationPckg,
4147 EMMFVideoRecordControllerSetVideoQuality,
4152 EXPORT_C TInt RMMFVideoRecordControllerExtCustomCommands::VideoQuality(TInt &aQuality) const
4154 TPckgBuf<TInt> pckg;
4157 error = iController.CustomCommandSync(iDestinationPckg,
4158 EMMFVideoRecordControllerVideoQuality,
4162 if (error == KErrNone)
4169 EXPORT_C TInt RMMFVideoRecordControllerExtCustomCommands::SetVideoFrameRateFixed(TBool aFixedFrameRate)
4171 TPckgBuf<TBool> pckg(aFixedFrameRate);
4172 return iController.CustomCommandSync(iDestinationPckg,
4173 EMMFVideoRecordControllerSetVideoFrameRateFixed,
4178 EXPORT_C TInt RMMFVideoRecordControllerExtCustomCommands::VideoFrameRateFixed(TBool &aFixedFrameRate) const
4180 TPckgBuf<TBool> pckg;
4183 error = iController.CustomCommandSync(iDestinationPckg,
4184 EMMFVideoRecordControllerVideoFrameRateFixed,
4188 if (error == KErrNone)
4190 aFixedFrameRate = pckg();
4195 EXPORT_C TMMFAudioSetRepeatsConfig::TMMFAudioSetRepeatsConfig()
4196 :iRepeatNumberOfTimes(0), iTrailingSilence(0), iReserved1(0)
4200 EXPORT_C RMMFAudioPlayControllerSetRepeatsCustomCommands::RMMFAudioPlayControllerSetRepeatsCustomCommands(RMMFController& aController) :
4201 RMMFCustomCommandsBase(aController, KUidInterfaceMMFAudioPlaySetRepeatsController)
4205 EXPORT_C TInt RMMFAudioPlayControllerSetRepeatsCustomCommands::SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence)
4207 TPckgBuf<TMMFAudioSetRepeatsConfig> configPackage;
4208 configPackage().iRepeatNumberOfTimes = aRepeatNumberOfTimes;
4209 configPackage().iTrailingSilence = aTrailingSilence;
4211 return iController.CustomCommandSync(iDestinationPckg,
4212 EMMFAudioPlayControllerSetRepeats,
4217 EXPORT_C CMMFAudioPlayControllerSetRepeatsCustomCommandParser* CMMFAudioPlayControllerSetRepeatsCustomCommandParser::NewL(MMMFAudioPlayControllerSetRepeatsCustomCommandImplementor& aImplementor)
4219 return new(ELeave) CMMFAudioPlayControllerSetRepeatsCustomCommandParser(aImplementor);
4222 CMMFAudioPlayControllerSetRepeatsCustomCommandParser::CMMFAudioPlayControllerSetRepeatsCustomCommandParser(MMMFAudioPlayControllerSetRepeatsCustomCommandImplementor& aImplementor) :
4223 CMMFCustomCommandParserBase(KUidInterfaceMMFAudioPlaySetRepeatsController), iImplementor(aImplementor)
4227 EXPORT_C CMMFAudioPlayControllerSetRepeatsCustomCommandParser::~CMMFAudioPlayControllerSetRepeatsCustomCommandParser()
4231 void CMMFAudioPlayControllerSetRepeatsCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
4233 if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFAudioPlaySetRepeatsController)
4235 TRAPD(error, DoHandleRequestL(aMessage));
4238 aMessage.Complete(error);
4243 aMessage.Complete(KErrNotSupported);
4247 void CMMFAudioPlayControllerSetRepeatsCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
4249 TBool complete = ETrue;
4250 switch (aMessage.Function())
4252 case EMMFAudioPlayControllerSetRepeats:
4253 complete = DoSetRepeatsL(aMessage);
4256 User::Leave(KErrNotSupported);
4261 aMessage.Complete(KErrNone);
4265 TBool CMMFAudioPlayControllerSetRepeatsCustomCommandParser::DoSetRepeatsL(TMMFMessage& aMessage)
4267 TPckgBuf<TMMFAudioSetRepeatsConfig> pckg;
4268 aMessage.ReadData1FromClientL(pckg);
4269 User::LeaveIfError(iImplementor.MapcSetRepeats(pckg().iRepeatNumberOfTimes, pckg().iTrailingSilence));