WebRTCDemo: Fixes warning for devices with pre-17 API level. Also fixes broken build build.xml and project.properties.

BUG=2083
R=fischman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2375004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4951 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrike@webrtc.org 2013-10-11 21:28:26 +00:00
parent 4c61792600
commit f53622d42e
5 changed files with 93 additions and 1674 deletions

View File

@ -37,6 +37,7 @@ class AudioManagerAndroid {
context.getSystemService(Context.AUDIO_SERVICE); context.getSystemService(Context.AUDIO_SERVICE);
mNativeOutputSampleRate = DEFAULT_SAMPLING_RATE; mNativeOutputSampleRate = DEFAULT_SAMPLING_RATE;
mAudioLowLatencyOutputFrameSize = DEFAULT_FRAMES_PER_BUFFER;
if (android.os.Build.VERSION.SDK_INT >= if (android.os.Build.VERSION.SDK_INT >=
android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) { android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
String sampleRateString = audioManager.getProperty( String sampleRateString = audioManager.getProperty(
@ -44,15 +45,14 @@ class AudioManagerAndroid {
if (sampleRateString != null) { if (sampleRateString != null) {
mNativeOutputSampleRate = Integer.parseInt(sampleRateString); mNativeOutputSampleRate = Integer.parseInt(sampleRateString);
} }
String framesPerBuffer = audioManager.getProperty(
AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER);
if (framesPerBuffer != null) {
mAudioLowLatencyOutputFrameSize = Integer.parseInt(framesPerBuffer);
}
} }
mAudioLowLatencySupported = context.getPackageManager().hasSystemFeature( mAudioLowLatencySupported = context.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_AUDIO_LOW_LATENCY); PackageManager.FEATURE_AUDIO_LOW_LATENCY);
mAudioLowLatencyOutputFrameSize = DEFAULT_FRAMES_PER_BUFFER;
String framesPerBuffer = audioManager.getProperty(
AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER);
if (framesPerBuffer != null) {
mAudioLowLatencyOutputFrameSize = Integer.parseInt(framesPerBuffer);
}
} }
@SuppressWarnings("unused") @SuppressWarnings("unused")

View File

@ -12,3 +12,5 @@
# Project target. # Project target.
target=android-17 target=android-17
java.compilerargs=-Xlint:all -Werror

View File

@ -1,2 +1,2 @@
leozwang@webrtc.org
fischman@webrtc.org fischman@webrtc.org
henrike@webrtc.org

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,8 @@
# "ant.properties", and override values to adapt the script to your # "ant.properties", and override values to adapt the script to your
# project structure. # project structure.
# Indicates whether an apk should be generated for each density. # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
split.density=false #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target. # Project target.
target=android-10 target=android-17