summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy/engineconfigurable/wrapper
diff options
context:
space:
mode:
authorFrançois Gaffie <francois.gaffie@intel.com>2015-05-13 18:13:00 +0200
committerEric Laurent <elaurent@google.com>2015-06-18 10:55:05 -0700
commit0f17ab7f9fac4327a8772e9199f411af7df912a4 (patch)
tree05d9dcb97a6f76ce0c0a43520d81705eb3241c27 /services/audiopolicy/engineconfigurable/wrapper
parent20f06f996337c9bf79d0b112083f6427a122ebab (diff)
downloadframeworks_av-0f17ab7f9fac4327a8772e9199f411af7df912a4.zip
frameworks_av-0f17ab7f9fac4327a8772e9199f411af7df912a4.tar.gz
frameworks_av-0f17ab7f9fac4327a8772e9199f411af7df912a4.tar.bz2
Bug fix on Engine Configurable
This patch fixes a couple of issue within audio policy engine configurable -valgrind error detected within the parsing of the configuration file -configuration file typos -start of the PFW delayed to the init in order to wait the full construction of the engine object -wrong specialization of template functions. -broadcast volume min / max init to stream collection of manager & PFW Change-Id: I08823ab4040c92b719747c60cc3fa5c8b5f172ac Signed-off-by: François Gaffie <francois.gaffie@intel.com>
Diffstat (limited to 'services/audiopolicy/engineconfigurable/wrapper')
-rwxr-xr-xservices/audiopolicy/engineconfigurable/wrapper/ParameterManagerWrapper.cpp3
-rwxr-xr-xservices/audiopolicy/engineconfigurable/wrapper/config/audio_policy_criteria.conf69
2 files changed, 9 insertions, 63 deletions
diff --git a/services/audiopolicy/engineconfigurable/wrapper/ParameterManagerWrapper.cpp b/services/audiopolicy/engineconfigurable/wrapper/ParameterManagerWrapper.cpp
index 5b935e8..cfe49d4 100755
--- a/services/audiopolicy/engineconfigurable/wrapper/ParameterManagerWrapper.cpp
+++ b/services/audiopolicy/engineconfigurable/wrapper/ParameterManagerWrapper.cpp
@@ -145,7 +145,7 @@ void ParameterManagerWrapper::loadCriterionType(cnode *root, bool isInclusive)
ALOG_ASSERT(node != NULL, "error in parsing file");
const char *typeName = node->name;
- char *valueNames = (char *)node->value;
+ char *valueNames = strndup(node->value, strlen(node->value));
addCriterionType(typeName, isInclusive);
@@ -178,6 +178,7 @@ void ParameterManagerWrapper::loadCriterionType(cnode *root, bool isInclusive)
}
valueName = strtok_r(NULL, ",", &ctx);
}
+ free(valueNames);
}
}
diff --git a/services/audiopolicy/engineconfigurable/wrapper/config/audio_policy_criteria.conf b/services/audiopolicy/engineconfigurable/wrapper/config/audio_policy_criteria.conf
index a4ffdd5..5b046a8 100755
--- a/services/audiopolicy/engineconfigurable/wrapper/config/audio_policy_criteria.conf
+++ b/services/audiopolicy/engineconfigurable/wrapper/config/audio_policy_criteria.conf
@@ -24,7 +24,7 @@
# * 1 << N -> (N+1)th literal value,
#
#########################################################
-# Route|Audio {
+# Policy {
# InclusiveCriterionType|ExclusiveCriterionType {
# <Criterion Name> [numerical value 1:]<literal value 1>,[numerical value 2:]<literal value 2>,<literal value 3>,...
# }
@@ -33,7 +33,7 @@
#########################################################
# Criterion:
#########################################################
-# Route|Audio {
+# Policy {
# Criterion {
# <Criterion Name> {
# Type <Criterion type name>
@@ -43,21 +43,12 @@
# }
Policy {
- ExclusiveCriterionType {
- #
- # The values of the mode MUST be aligned with the definition of the audio_mode_t
- # from system/audio.h
- #
- AndroidModeType 0:Normal,1:RingTone,2:InCall,3:InCommunication
- }
InclusiveCriterionType {
#
# DO NOT CHANGE ORDER. This definition must be aligned with the definition of
# AUDIO_DEVICE_OUT_* within <system/audio.h> file of android.
#
OutputDevicesMaskType Earpiece,Speaker,WiredHeadset,WiredHeadphone,BluetoothSco,BluetoothScoHeadset,BluetoothScoCarkit,BluetoothA2dp,BluetoothA2dpHeadphones,BluetoothA2dpSpeaker,Hdmi,AnlgDockHeadset,DgtlDockHeadset,UsbAccessory,UsbDevice,RemoteSubmix,TelephonyTx,Line,HdmiArc,Spdif,Fm,AuxLine,SpeakerSafe
- }
- InclusiveCriterionType {
#
# DO NOT CHANGE ORDER. This definition must be aligned with the definition of
# AUDIO_DEVICE_IN_* within <system/audio.h> file of android.
@@ -68,121 +59,75 @@ Policy {
}
ExclusiveCriterionType {
#
+ # The values of the mode MUST be aligned with the definition of the audio_mode_t
+ # from system/audio.h
+ #
+ AndroidModeType 0:Normal,1:RingTone,2:InCall,3:InCommunication
+ #
# The values of the mode MUST be aligned with the definition of the
# audio_policy_forced_config_t from system/audio.h
#
ForceUseForCommunicationType 0:ForceNone,1:ForceSpeaker,3:ForceBtSco
- }
- ExclusiveCriterionType {
#
# The values of the mode MUST be aligned with the definition of the
# audio_policy_forced_config_t from system/audio.h
#
ForceUseForMediaType 0:ForceNone,1:ForceSpeaker,2:ForceHeadphones,4:ForceBtA2dp,5:ForceWiredAccessory,8:ForceAnalogDock,9:ForceDigitalDock,10:ForceNoBtA2dp
- }
- ExclusiveCriterionType {
#
# The values of the mode MUST be aligned with the definition of the
# audio_policy_forced_config_t from system/audio.h
#
ForceUseForRecordType 0:ForceNone,3:ForceBtSco,5:ForceWiredAccessory
- }
- ExclusiveCriterionType {
#
# The values of the mode MUST be aligned with the definition of the
# audio_policy_forced_config_t from system/audio.h
#
ForceUseForDockType 0:ForceNone,5:ForceWiredAccessory,6:ForceBtCarDock,7:ForceBtDeskDock,8:ForceAnalogDock,9:ForceDigitalDock
- }
- ExclusiveCriterionType {
#
# The values of the mode MUST be aligned with the definition of the
# audio_policy_forced_config_t from system/audio.h
#
ForceUseForSystemType 0:ForceNone,11:ForceSystemEnforced
- }
- ExclusiveCriterionType {
#
# The values of the mode MUST be aligned with the definition of the
# audio_policy_forced_config_t from system/audio.h
#
ForceUseForHdmiSystemAudioType 0:ForceNone,12:ForceHdmiSystemEnforced
}
- ExclusiveCriterionType {
- Rate 8000,11025,12000,16000,22050,24000,32000,44100,48000,96000,176400,192000
- }
- ExclusiveCriterionType {
- Format Mp3,AmrNb,AmrWb,Aac,HeAacV1,HeAacV2,Vorbis,Pcm16Bit,Pcm8Bit,Pcm32Bit,Pcm8_24Bit
- }
- InclusiveCriterionType {
- OutputChannelMask FrontLeft,FrontRight,FrontCenter,LowFrequence,BackLeft,BackRight,FromLeftOfCenter,FromRightOfCenter,BackCenter,SideLeft,SideRight,TopCenter,TopFrontLeft,TopFrontCenter,TopFrontRight,TopBackLeft,TopBackCenter,TopBackRight
- }
- ExclusiveCriterionType {
- OutputChannelMasks Mono,Stereo,Quad,QuadBack,QuadSide,5Point1,5Point1Back,5Point1Side,7Point1,All
- }
- InclusiveCriterionType {
- InputChannelMask Left,Right,Front,Back,LeftProcessed,RightProcessed,FrontProcessed,BackProcessed,Pressure,XAxis,YAxis,ZAxis,VoiceUplink,VoiceDnlink
- }
- ExclusiveCriterionType {
- InputChannelMasks Mono,Stereo,FrontBack,VoiceUplinkDnlink,All
- }
- InclusiveCriterionType {
- OutputFlags Direct,Primary,Fast,DeepBuffer,CompressOffload,NonBlocking,HwAvSync
- }
- ExclusiveCriterionType {
- InputSource Default,Mic,VoiceUplink,VoiceDownlink,VoiceCall,Camcorder,VoiceRecognition,VoiceCommunication,RemoteSubmix,Hotword
- }
-
Criterion {
AvailableInputDevices {
Type InputDevicesMaskType
Default none
}
- }
- Criterion {
AvailableOutputDevices {
Type OutputDevicesMaskType
Default none
}
- }
- Criterion {
TelephonyMode {
Type AndroidModeType
Default Normal
}
- }
- Criterion {
ForceUseForCommunication {
Type ForceUseForCommunicationType
Default ForceNone
}
- }
- Criterion {
ForceUseForMedia {
Type ForceUseForMediaType
Default ForceNone
}
- }
- Criterion {
ForceUseForRecord {
Type ForceUseForRecordType
Default ForceNone
}
- }
- Criterion {
ForceUseForDock {
Type ForceUseForDockType
Default ForceNone
}
- }
- Criterion {
ForceUseForSystem {
Type ForceUseForSystemType
Default ForceNone
}
- }
- Criterion {
ForceUseForHdmiSystemAudio {
Type ForceUseForHdmiSystemAudioType
Default ForceNone