Home | History | Annotate | Download | only in audio

Lines Matching refs:AudioSystem

49                                                   AudioSystem::device_connection_state state,
86 case AudioSystem::DEVICE_STATE_AVAILABLE:
128 case AudioSystem::DEVICE_STATE_UNAVAILABLE: {
166 if ((state == AudioSystem::DEVICE_STATE_UNAVAILABLE) ||
200 case AudioSystem::DEVICE_STATE_AVAILABLE: {
210 case AudioSystem::DEVICE_STATE_UNAVAILABLE: {
244 AudioSystem::device_connection_state AudioPolicyManagerBase::getDeviceConnectionState(audio_devices_t device,
247 AudioSystem::device_connection_state state = AudioSystem::DEVICE_STATE_UNAVAILABLE;
267 state = AudioSystem::DEVICE_STATE_AVAILABLE;
271 state = AudioSystem::DEVICE_STATE_AVAILABLE;
282 if (state < 0 || state >= AudioSystem::NUM_MODES) {
296 for (int stream = 0; stream < AudioSystem::NUM_STREAM_TYPES; stream++) {
371 for (int stream = 0; stream < AudioSystem::NUM_STREAM_TYPES; stream++) {
377 AudioSystem::MODE_RINGTONE &&
378 isStreamActive(AudioSystem::MUSIC, SONIFICATION_HEADSET_MUSIC_DELAY)) {
385 void AudioPolicyManagerBase::setForceUse(AudioSystem::force_use usage, AudioSystem::forced_config config)
391 case AudioSystem::FOR_COMMUNICATION:
392 if (config != AudioSystem::FORCE_SPEAKER && config != AudioSystem::FORCE_BT_SCO &&
393 config != AudioSystem::FORCE_NONE) {
400 case AudioSystem::FOR_MEDIA:
401 if (config != AudioSystem::FORCE_HEADPHONES && config != AudioSystem::FORCE_BT_A2DP &&
402 config != AudioSystem::FORCE_WIRED_ACCESSORY &&
403 config != AudioSystem::FORCE_ANALOG_DOCK &&
404 config != AudioSystem::FORCE_DIGITAL_DOCK && config != AudioSystem::FORCE_NONE &&
405 config != AudioSystem::FORCE_NO_BT_A2DP) {
411 case AudioSystem::FOR_RECORD:
412 if (config != AudioSystem::FORCE_BT_SCO && config != AudioSystem::FORCE_WIRED_ACCESSORY &&
413 config != AudioSystem::FORCE_NONE) {
419 case AudioSystem::FOR_DOCK:
420 if (config != AudioSystem::FORCE_NONE && config != AudioSystem::FORCE_BT_CAR_DOCK &&
421 config != AudioSystem::FORCE_BT_DESK_DOCK &&
422 config != AudioSystem::FORCE_WIRED_ACCESSORY &&
423 config != AudioSystem::FORCE_ANALOG_DOCK &&
424 config != AudioSystem::FORCE_DIGITAL_DOCK) {
430 case AudioSystem::FOR_SYSTEM:
431 if (config != AudioSystem::FORCE_NONE &&
432 config != AudioSystem::FORCE_SYSTEM_ENFORCED) {
472 AudioSystem::forced_config AudioPolicyManagerBase::getForceUse(AudioSystem::force_use usage)
507 audio_io_handle_t AudioPolicyManagerBase::getOutput(AudioSystem::stream_type stream,
511 AudioSystem::output_flags flags)
515 routing_strategy strategy = getStrategy((AudioSystem::stream_type)stream);
533 outputDesc->mFlags = (audio_output_flags_t)(mDirectOutput ? AudioSystem::OUTPUT_FLAG_DIRECT : 0);
637 AudioSystem::output_flags flags)
660 int commonFlags = (int)AudioSystem::popCount(outputDesc->mProfile->mFlags & flags);
683 AudioSystem::stream_type stream,
751 AudioSystem::stream_type stream,
831 if (desc->mFlags & AudioSystem::OUTPUT_FLAG_DIRECT) {
848 AudioSystem::audio_in_acoustics acoustics)
864 channelMask = AudioSystem::CHANNEL_IN_VOICE_UPLINK;
867 channelMask = AudioSystem::CHANNEL_IN_VOICE_DNLINK;
870 channelMask = (AudioSystem::CHANNEL_IN_VOICE_UPLINK | AudioSystem::CHANNEL_IN_VOICE_DNLINK);
996 void AudioPolicyManagerBase::initStreamVolume(AudioSystem::stream_type stream,
1009 status_t AudioPolicyManagerBase::setStreamVolumeIndex(AudioSystem::stream_type stream,
1049 status_t AudioPolicyManagerBase::getStreamVolumeIndex(AudioSystem::stream_type stream,
1076 routing_strategy strategy = getStrategy(AudioSystem::MUSIC);
1198 if (outputDesc->isStreamActive((AudioSystem::stream_type)stream, inPastMs, sysTime)) {
1211 outputDesc->isStreamActive((AudioSystem::stream_type)stream, inPastMs, sysTime)) {
1255 snprintf(buffer, SIZE, " Force use for communications %d\n", mForceUse[AudioSystem::FOR_COMMUNICATION]);
1257 snprintf(buffer, SIZE, " Force use for media %d\n", mForceUse[AudioSystem::FOR_MEDIA]);
1259 snprintf(buffer, SIZE, " Force use for record %d\n", mForceUse[AudioSystem::FOR_RECORD]);
1261 snprintf(buffer, SIZE, " Force use for dock %d\n", mForceUse[AudioSystem::FOR_DOCK]);
1263 snprintf(buffer, SIZE, " Force use for system %d\n", mForceUse[AudioSystem::FOR_SYSTEM]);
1297 for (size_t i = 0; i < AudioSystem::NUM_STREAM_TYPES; i++) {
1330 mPhoneState(AudioSystem::MODE_NORMAL),
1337 for (int i = 0; i < AudioSystem::NUM_FORCE_USE; i++) {
1338 mForceUse[i] = AudioSystem::FORCE_NONE;
1413 mTestFormat = AudioSystem::PCM_16_BIT;
1414 mTestChannels = AudioSystem::CHANNEL_OUT_STEREO;
1495 int format = AudioSystem::INVALID_FORMAT;
1497 format = AudioSystem::PCM_16_BIT;
1499 format = AudioSystem::PCM_8_BIT;
1501 format = AudioSystem::MP3;
1503 if (format != AudioSystem::INVALID_FORMAT) {
1518 channels = AudioSystem::CHANNEL_OUT_STEREO;
1520 channels = AudioSystem::CHANNEL_OUT_MONO;
1613 AudioSystem::device_connection_state state,
1618 if (state == AudioSystem::DEVICE_STATE_AVAILABLE) {
1835 for (int j = 0; j < (int)AudioSystem::NUM_STREAM_TYPES; j++) {
1837 outputDesc2->changeRefCount((AudioSystem::stream_type)j,-refCount);
1934 AudioSystem::NUM_STREAM_TYPES; i++) {
1935 if (getStrategy((AudioSystem::stream_type)i) == strategy) {
1937 mpClientInterface->setStreamOutput((AudioSystem::stream_type)i,
1994 ((mForceUse[AudioSystem::FOR_COMMUNICATION] != AudioSystem::FORCE_BT_SCO) &&
1995 (mForceUse[AudioSystem::FOR_RECORD] != AudioSystem::FORCE_BT_SCO))) &&
1996 ((mPhoneState != AudioSystem::MODE_IN_CALL) &&
1997 (mPhoneState != AudioSystem::MODE_RINGTONE))) {
2004 ((mForceUse[AudioSystem::FOR_COMMUNICATION] == AudioSystem::FORCE_BT_SCO) ||
2005 (mForceUse[AudioSystem::FOR_RECORD] == AudioSystem::FORCE_BT_SCO))) ||
2006 ((mPhoneState == AudioSystem::MODE_IN_CALL) ||
2007 (mPhoneState == AudioSystem::MODE_RINGTONE))) {
2052 uint32_t AudioPolicyManagerBase::getStrategyForStream(AudioSystem::stream_type stream) {
2056 audio_devices_t AudioPolicyManagerBase::getDevicesForStream(AudioSystem::stream_type stream) {
2061 if (stream < (AudioSystem::stream_type) 0 || stream >= AudioSystem::NUM_STREAM_TYPES) {
2071 AudioSystem::stream_type stream) {
2074 case AudioSystem::VOICE_CALL:
2075 case AudioSystem::BLUETOOTH_SCO:
2077 case AudioSystem::RING:
2078 case AudioSystem::ALARM:
2080 case AudioSystem::NOTIFICATION:
2082 case AudioSystem::DTMF:
2086 case AudioSystem::SYSTEM:
2089 case AudioSystem::TTS:
2090 case AudioSystem::MUSIC:
2092 case AudioSystem::ENFORCED_AUDIBLE:
2097 void AudioPolicyManagerBase::handleNotificationRoutingForStream(AudioSystem::stream_type stream) {
2099 case AudioSystem::MUSIC:
2124 } else if (isStreamActiveRemotely(AudioSystem::MUSIC,
2131 } else if (isStreamActive(AudioSystem::MUSIC, SONIFICATION_RESPECTFUL_AFTER_MUSIC_DELAY)) {
2153 switch (mForceUse[AudioSystem::FOR_COMMUNICATION]) {
2154 case AudioSystem::FORCE_BT_SCO:
2169 (mForceUse[AudioSystem::FOR_MEDIA] != AudioSystem::FORCE_NO_BT_A2DP) &&
2180 if (mPhoneState != AudioSystem::MODE_IN_CALL) {
2200 case AudioSystem::FORCE_SPEAKER:
2204 (mForceUse[AudioSystem::FOR_MEDIA] != AudioSystem::FORCE_NO_BT_A2DP) &&
2209 if (mPhoneState != AudioSystem::MODE_IN_CALL) {
2248 (mForceUse[AudioSystem::FOR_SYSTEM] == AudioSystem::FORCE_SYSTEM_ENFORCED)) {
2264 mHasA2dp && (mForceUse[AudioSystem::FOR_MEDIA] != AudioSystem::FORCE_NO_BT_A2DP) &&
2294 (mForceUse[AudioSystem::FOR_DOCK] == AudioSystem::FORCE_ANALOG_DOCK)) {
2341 bool shouldMute = outputDesc->isActive() && (AudioSystem::popCount(device) >= 2);
2496 if (mForceUse[AudioSystem::FOR_RECORD] == AudioSystem::FORCE_BT_SCO &&
2560 } else if (AudioSystem::popCount(device) > 1) {
2573 ALOGW_IF(AudioSystem::popCount(device) != 1,
2773 if (stream == AudioSystem::MUSIC &&
2789 const routing_strategy stream_strategy = getStrategy((AudioSystem::stream_type)stream);
2796 || (stream == AudioSystem::SYSTEM)
2798 (mForceUse[AudioSystem::FOR_SYSTEM] == AudioSystem::FORCE_NONE))) &&
2804 if (isStreamActive(AudioSystem::MUSIC, SONIFICATION_HEADSET_MUSIC_DELAY) ||
2807 float musicVol = computeVolume(AudioSystem::MUSIC,
2808 mStreams[AudioSystem::MUSIC].getVolumeIndex(musicDevice),
2839 if ((stream == AudioSystem::VOICE_CALL && mForceUse[AudioSystem::FOR_COMMUNICATION] == AudioSystem::FORCE_BT_SCO) ||
2840 (stream == AudioSystem::BLUETOOTH_SCO && mForceUse[AudioSystem::FOR_COMMUNICATION] != AudioSystem::FORCE_BT_SCO)) {
2842 stream, mForceUse[AudioSystem::FOR_COMMUNICATION]);
2856 if (stream == AudioSystem::BLUETOOTH_SCO) {
2857 mpClientInterface->setStreamVolume(AudioSystem::VOICE_CALL, volume, output, delayMs);
2859 mpClientInterface->setStreamVolume((AudioSystem::stream_type)stream, volume, output, delayMs);
2862 if (stream == AudioSystem::VOICE_CALL ||
2863 stream == AudioSystem::BLUETOOTH_SCO) {
2866 if (stream == AudioSystem::VOICE_CALL) {
2888 for (int stream = 0; stream < AudioSystem::NUM_STREAM_TYPES; stream++) {
2905 for (int stream = 0; stream < AudioSystem::NUM_STREAM_TYPES; stream++) {
2906 if (getStrategy((AudioSystem::stream_type)stream) == strategy) {
2930 ((stream != AudioSystem::ENFORCED_AUDIBLE) ||
2931 (mForceUse[AudioSystem::FOR_SYSTEM] == AudioSystem::FORCE_NONE))) {
2960 const routing_strategy stream_strategy = getStrategy((AudioSystem::stream_type)stream);
2971 if (AudioSystem::isLowVisibility((AudioSystem::stream_type)stream)) {
2986 mpClientInterface->startTone(ToneGenerator::TONE_SUP_CALL_WAITING, AudioSystem::VOICE_CALL);
3001 return ((state == AudioSystem::MODE_IN_CALL) ||
3002 (state == AudioSystem::MODE_IN_COMMUNICATION));
3012 return ((flags & AudioSystem::OUTPUT_FLAG_DIRECT) ||
3013 (format != 0 && !AudioSystem::isLinearPCM(format)));
3036 for (int i = 0; i < AudioSystem::NUM_STREAM_TYPES; i++) {
3083 void AudioPolicyManagerBase::AudioOutputDescriptor::changeRefCount(AudioSystem::stream_type stream, int delta)
3120 for (int i = 0; i < AudioSystem::NUM_STREAM_TYPES; i++) {
3121 if (((getStrategy((AudioSystem::stream_type)i) == strategy) ||
3123 isStreamActive((AudioSystem::stream_type)i, inPastMs, sysTime)) {
3130 bool AudioPolicyManagerBase::AudioOutputDescriptor::isStreamActive(AudioSystem::stream_type stream,
3170 for (int i = 0; i < AudioSystem::NUM_STREAM_TYPES; i++) {