mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/DevSoundAudioOutput/Src/DevSoundAudioOutput.cpp
branchRCL_3
changeset 8 e35735ece90c
parent 0 71ca22bcf22a
child 41 a36789189b53
equal deleted inserted replaced
7:709f89d8c047 8:e35735ece90c
    21 #include "DevSoundAudioOutput.h"
    21 #include "DevSoundAudioOutput.h"
    22 #include "DebugMacros.h"
    22 #include "DebugMacros.h"
    23 #include <mmfpaniccodes.h>
    23 #include <mmfpaniccodes.h>
    24 #include <ConfigurationComponentsFactory.h>
    24 #include <ConfigurationComponentsFactory.h>
    25 #include <AudioOutputControlUtility.h>
    25 #include <AudioOutputControlUtility.h>
       
    26 #include <S60FourCC.h>
    26 
    27 
    27 // CONSTANTS
    28 // CONSTANTS
    28 const TUint KSampleRate8000Hz       = 8000;
    29 const TUint KSampleRate8000Hz       = 8000;
    29 const TUint KSampleRate11025Hz      = 11025;
    30 const TUint KSampleRate11025Hz      = 11025;
    30 const TUint KSampleRate12000Hz      = 12000;
    31 const TUint KSampleRate12000Hz      = 12000;
   327 				{
   328 				{
   328 				break;
   329 				break;
   329 				}
   330 				}
   330 			}
   331 			}
   331 
   332 
       
   333 		//aac HWcodec will downsample by 2, if it is greater than 48k 
       
   334 		//Hence devsound should be onfigured with that value
       
   335 		if(iSourceSampleRate > KSampleRate48000Hz && iSourceFourCC == KS60FourCCCodeEAAC && iAdvancedAudioDecoder->IsHwAccelerated())
       
   336 		    {
       
   337             TUint samplerate = iSourceSampleRate/2;
       
   338             for (; sampleRateIndex >= 0; sampleRateIndex--)
       
   339                 {
       
   340                 if(samplerate >= supportedSR[sampleRateIndex][0])
       
   341                     {
       
   342                     break;
       
   343                     }
       
   344                 }
       
   345 		    }
   332 		// find the highest sink sample rate below the source rate
   346 		// find the highest sink sample rate below the source rate
   333 		for (; sampleRateIndex >= 0; sampleRateIndex--)
   347 		for (; sampleRateIndex >= 0; sampleRateIndex--)
   334 			{
   348 			{
   335 			if(devSoundCaps.iRate & supportedSR[sampleRateIndex][1])
   349 			if(devSoundCaps.iRate & supportedSR[sampleRateIndex][1])
   336 				{
   350 				{