qtmobility/plugins/multimedia/symbian/mmf/audiosource/s60audiocapturesession.cpp
changeset 14 6fbed849b4f4
parent 11 06b8e2af4411
child 15 1f895d8a5b2b
equal deleted inserted replaced
11:06b8e2af4411 14:6fbed849b4f4
   134     m_format = format;
   134     m_format = format;
   135     return true;
   135     return true;
   136 }
   136 }
   137 
   137 
   138 QStringList S60AudioCaptureSession::supportedAudioCodecs() const
   138 QStringList S60AudioCaptureSession::supportedAudioCodecs() const
   139 {   
   139 {
   140     return m_audioCodeclist.keys();    
   140     return m_audioCodeclist.keys();
   141 }
   141 }
   142 
   142 
   143 QStringList S60AudioCaptureSession::supportedAudioContainers() const
   143 QStringList S60AudioCaptureSession::supportedAudioContainers() const
   144 {
   144 {
   145     return m_controllerIdMap.keys();
   145     return m_controllerIdMap.keys();
   304     m_captureDevice = deviceName;
   304     m_captureDevice = deviceName;
   305 }
   305 }
   306 
   306 
   307 void S60AudioCaptureSession::MoscoStateChangeEvent(CBase* aObject,
   307 void S60AudioCaptureSession::MoscoStateChangeEvent(CBase* aObject,
   308         TInt aPreviousState, TInt aCurrentState, TInt aErrorCode)
   308         TInt aPreviousState, TInt aCurrentState, TInt aErrorCode)
   309 { 	    
   309 {
   310     if (aErrorCode==KErrNone) {
   310     if (aErrorCode==KErrNone) {
   311 	    TRAPD(err, MoscoStateChangeEventL(aObject, aPreviousState, aCurrentState, NULL));
   311 	    TRAPD(err, MoscoStateChangeEventL(aObject, aPreviousState, aCurrentState, NULL));
   312 	    setError(err);
   312 	    setError(err);
   313 	}
   313 	}
   314 	setError(aErrorCode);
   314 	setError(aErrorCode);
   478     }      
   478     }      
   479 }
   479 }
   480 
   480 
   481 void S60AudioCaptureSession::applyAudioSettingsL()
   481 void S60AudioCaptureSession::applyAudioSettingsL()
   482 {      
   482 {      
   483     if (!m_recorderUtility)
   483     if (!m_recorderUtility || m_format.codec() == "AMR")
   484         return;
   484         return;   
   485     
   485     
   486     TFourCC fourCC = m_audioCodeclist.value(m_format.codec()).fourCC;    
   486     TFourCC fourCC = m_audioCodeclist.value(m_format.codec()).fourCC;    
   487     
   487     
   488     //set destination datatype
   488     if (m_format.codec() == "PCM")         
       
   489         fourCC = determinePCMFormat();    
       
   490     
   489     RArray<TFourCC> supportedDataTypes;
   491     RArray<TFourCC> supportedDataTypes;
   490     CleanupClosePushL(supportedDataTypes);
   492     CleanupClosePushL(supportedDataTypes);
   491     m_recorderUtility->GetSupportedDestinationDataTypesL(supportedDataTypes);    
   493     m_recorderUtility->GetSupportedDestinationDataTypesL(supportedDataTypes);    
   492 
   494 
   493     for (TInt k = 0; k < supportedDataTypes.Count(); k++ ) {        
   495     for (TInt k = 0; k < supportedDataTypes.Count(); k++ ) {        
   512     
   514     
   513     RArray<TUint> supportedChannels;
   515     RArray<TUint> supportedChannels;
   514     CleanupClosePushL(supportedChannels);
   516     CleanupClosePushL(supportedChannels);
   515     m_recorderUtility->GetSupportedNumberOfChannelsL(supportedChannels);    
   517     m_recorderUtility->GetSupportedNumberOfChannelsL(supportedChannels);    
   516     for (TInt l = 0; l < supportedChannels.Count(); l++ ) {        
   518     for (TInt l = 0; l < supportedChannels.Count(); l++ ) {        
   517         if (supportedChannels[l] == m_format.channels()) {
   519         if (supportedChannels[l] == m_format.channels()) {            
   518             m_recorderUtility->SetDestinationNumberOfChannelsL(m_format.channels());
   520             m_recorderUtility->SetDestinationNumberOfChannelsL(m_format.channels());
   519             break;
   521             break;
   520         }
   522         }
   521     }
   523     }
   522     CleanupStack::PopAndDestroy(&supportedChannels);        
   524     CleanupStack::PopAndDestroy(&supportedChannels);