Bug 1007552 - To support publicnotification audio channel type for camera shutter. r=kinetik

This commit is contained in:
Star Cheng 2014-05-22 15:08:05 +08:00
Родитель de76e3fa62
Коммит e24a0dc452
4 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -133,8 +133,8 @@ static cubeb_stream_type ConvertChannelToCubebType(dom::AudioChannel aChannel)
return CUBEB_STREAM_TYPE_VOICE_CALL;
case dom::AudioChannel::Ringer:
return CUBEB_STREAM_TYPE_RING;
// Currently Android openSLES library doesn't support FORCE_AUDIBLE yet.
case dom::AudioChannel::Publicnotification:
return CUBEB_STREAM_TYPE_SYSTEM_ENFORCED;
default:
NS_ERROR("The value of AudioChannel is invalid");
return CUBEB_STREAM_TYPE_MAX;

Просмотреть файл

@ -109,7 +109,7 @@ typedef enum {
CUBEB_STREAM_TYPE_ALARM = 4,
CUBEB_STREAM_TYPE_NOTIFICATION = 5,
CUBEB_STREAM_TYPE_BLUETOOTH_SCO = 6,
CUBEB_STREAM_TYPE_ENFORCED_AUDIBLE = 7,
CUBEB_STREAM_TYPE_SYSTEM_ENFORCED = 7,
CUBEB_STREAM_TYPE_DTMF = 8,
CUBEB_STREAM_TYPE_TTS = 9,
CUBEB_STREAM_TYPE_FM = 10,

Просмотреть файл

@ -63,5 +63,9 @@
#define SL_ANDROID_STREAM_ALARM ((SLint32) 0x00000004)
/* same as android.media.AudioManager.STREAM_NOTIFICATION */
#define SL_ANDROID_STREAM_NOTIFICATION ((SLint32) 0x00000005)
/* same as android.media.AudioManager.STREAM_BLUETOOTH_SCO */
#define SL_ANDROID_STREAM_BLUETOOTH_SCO ((SLint32) 0x00000006)
/* same as android.media.AudioManager.STREAM_SYSTEM_ENFORCED */
#define SL_ANDROID_STREAM_SYSTEM_ENFORCED ((SLint32) 0x00000007)
#endif /* OPENSL_ES_ANDROIDCONFIGURATION_H_ */

Просмотреть файл

@ -117,7 +117,8 @@ convert_stream_type_to_sl_stream(cubeb_stream_type stream_type)
return SL_ANDROID_STREAM_VOICE;
case CUBEB_STREAM_TYPE_RING:
return SL_ANDROID_STREAM_RING;
case CUBEB_STREAM_TYPE_ENFORCED_AUDIBLE:
case CUBEB_STREAM_TYPE_SYSTEM_ENFORCED:
return SL_ANDROID_STREAM_SYSTEM_ENFORCED;
default:
return 0xFFFFFFFF;
}