BUG= TBR=cpaulin@chromium.org Review URL: https://codereview.webrtc.org/1176023002. Cr-Commit-Position: refs/heads/master@{#9410}
This commit is contained in:
parent
1fe120a6b9
commit
8a19f3dc62
talk/examples
android
res
src/org/appspot/apprtc
androidtests/src/org/appspot/apprtc/test
@ -87,6 +87,11 @@
|
||||
<string name="pref_audiocodec_dlg">Select default audio codec.</string>
|
||||
<string name="pref_audiocodec_default">OPUS</string>
|
||||
|
||||
<string name="pref_noaudioprocessing_key">audioprocessing_preference</string>
|
||||
<string name="pref_noaudioprocessing_title">Disable audio processing.</string>
|
||||
<string name="pref_noaudioprocessing_dlg">Disable audio processing pipeline.</string>
|
||||
<string name="pref_noaudioprocessing_default">false</string>
|
||||
|
||||
<string name="pref_miscsettings_key">misc_settings_key</string>
|
||||
<string name="pref_miscsettings_title">Miscellaneous settings.</string>
|
||||
|
||||
|
@ -82,6 +82,12 @@
|
||||
android:dialogTitle="@string/pref_audiocodec_dlg"
|
||||
android:entries="@array/audioCodecs"
|
||||
android:entryValues="@array/audioCodecs" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="@string/pref_noaudioprocessing_key"
|
||||
android:title="@string/pref_noaudioprocessing_title"
|
||||
android:dialogTitle="@string/pref_noaudioprocessing_dlg"
|
||||
android:defaultValue="@string/pref_noaudioprocessing_default" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
|
@ -85,6 +85,8 @@ public class CallActivity extends Activity
|
||||
"org.appspot.apprtc.AUDIO_BITRATE";
|
||||
public static final String EXTRA_AUDIOCODEC =
|
||||
"org.appspot.apprtc.AUDIOCODEC";
|
||||
public static final String EXTRA_NOAUDIOPROCESSING_ENABLED =
|
||||
"org.appspot.apprtc.NOAUDIOPROCESSING";
|
||||
public static final String EXTRA_CPUOVERUSE_DETECTION =
|
||||
"org.appspot.apprtc.CPUOVERUSE_DETECTION";
|
||||
public static final String EXTRA_DISPLAY_HUD =
|
||||
@ -235,6 +237,7 @@ public class CallActivity extends Activity
|
||||
intent.getBooleanExtra(EXTRA_HWCODEC_ENABLED, true),
|
||||
intent.getIntExtra(EXTRA_AUDIO_BITRATE, 0),
|
||||
intent.getStringExtra(EXTRA_AUDIOCODEC),
|
||||
intent.getBooleanExtra(EXTRA_NOAUDIOPROCESSING_ENABLED, false),
|
||||
intent.getBooleanExtra(EXTRA_CPUOVERUSE_DETECTION, true));
|
||||
commandLineRun = intent.getBooleanExtra(EXTRA_CMDLINE, false);
|
||||
runTimeMs = intent.getIntExtra(EXTRA_RUNTIME, 0);
|
||||
|
@ -81,6 +81,7 @@ public class ConnectActivity extends Activity {
|
||||
private String keyprefAudioBitrateValue;
|
||||
private String keyprefAudioCodec;
|
||||
private String keyprefHwCodecAcceleration;
|
||||
private String keyprefNoAudioProcessingPipeline;
|
||||
private String keyprefCpuUsageDetection;
|
||||
private String keyprefDisplayHud;
|
||||
private String keyprefRoomServerUrl;
|
||||
@ -106,6 +107,7 @@ public class ConnectActivity extends Activity {
|
||||
keyprefAudioBitrateType = getString(R.string.pref_startaudiobitrate_key);
|
||||
keyprefAudioBitrateValue = getString(R.string.pref_startaudiobitratevalue_key);
|
||||
keyprefAudioCodec = getString(R.string.pref_audiocodec_key);
|
||||
keyprefNoAudioProcessingPipeline = getString(R.string.pref_noaudioprocessing_key);
|
||||
keyprefCpuUsageDetection = getString(R.string.pref_cpu_usage_detection_key);
|
||||
keyprefDisplayHud = getString(R.string.pref_displayhud_key);
|
||||
keyprefRoomServerUrl = getString(R.string.pref_room_server_url_key);
|
||||
@ -266,6 +268,11 @@ public class ConnectActivity extends Activity {
|
||||
boolean hwCodec = sharedPref.getBoolean(keyprefHwCodecAcceleration,
|
||||
Boolean.valueOf(getString(R.string.pref_hwcodec_default)));
|
||||
|
||||
// Check Disable Audio Processing flag.
|
||||
boolean noAudioProcessing = sharedPref.getBoolean(
|
||||
keyprefNoAudioProcessingPipeline,
|
||||
Boolean.valueOf(getString(R.string.pref_noaudioprocessing_default)));
|
||||
|
||||
// Get video resolution from settings.
|
||||
int videoWidth = 0;
|
||||
int videoHeight = 0;
|
||||
@ -342,6 +349,8 @@ public class ConnectActivity extends Activity {
|
||||
intent.putExtra(CallActivity.EXTRA_VIDEO_BITRATE, videoStartBitrate);
|
||||
intent.putExtra(CallActivity.EXTRA_VIDEOCODEC, videoCodec);
|
||||
intent.putExtra(CallActivity.EXTRA_HWCODEC_ENABLED, hwCodec);
|
||||
intent.putExtra(CallActivity.EXTRA_NOAUDIOPROCESSING_ENABLED,
|
||||
noAudioProcessing);
|
||||
intent.putExtra(CallActivity.EXTRA_AUDIO_BITRATE, audioStartBitrate);
|
||||
intent.putExtra(CallActivity.EXTRA_AUDIOCODEC, audioCodec);
|
||||
intent.putExtra(CallActivity.EXTRA_CPUOVERUSE_DETECTION,
|
||||
|
@ -79,6 +79,10 @@ public class PeerConnectionClient {
|
||||
private static final String VIDEO_CODEC_PARAM_START_BITRATE =
|
||||
"x-google-start-bitrate";
|
||||
private static final String AUDIO_CODEC_PARAM_BITRATE = "maxaveragebitrate";
|
||||
private static final String AUDIO_ECHO_CANCELLATION_CONSTRAINT = "googEchoCancellation";
|
||||
private static final String AUDIO_AUTO_GAIN_CONTROL_CONSTRAINT= "googAutoGainControl";
|
||||
private static final String AUDIO_HIGH_PASS_FILTER_CONSTRAINT = "googHighpassFilter";
|
||||
private static final String AUDIO_NOISE_SUPPRESSION_CONSTRAINT = "googNoiseSuppression";
|
||||
private static final String MAX_VIDEO_WIDTH_CONSTRAINT = "maxWidth";
|
||||
private static final String MIN_VIDEO_WIDTH_CONSTRAINT = "minWidth";
|
||||
private static final String MAX_VIDEO_HEIGHT_CONSTRAINT = "maxHeight";
|
||||
@ -144,6 +148,7 @@ public class PeerConnectionClient {
|
||||
public final boolean videoCodecHwAcceleration;
|
||||
public final int audioStartBitrate;
|
||||
public final String audioCodec;
|
||||
public final boolean noAudioProcessing;
|
||||
public final boolean cpuOveruseDetection;
|
||||
|
||||
public PeerConnectionParameters(
|
||||
@ -151,7 +156,7 @@ public class PeerConnectionClient {
|
||||
int videoWidth, int videoHeight, int videoFps, int videoStartBitrate,
|
||||
String videoCodec, boolean videoCodecHwAcceleration,
|
||||
int audioStartBitrate, String audioCodec,
|
||||
boolean cpuOveruseDetection) {
|
||||
boolean noAudioProcessing, boolean cpuOveruseDetection) {
|
||||
this.videoCallEnabled = videoCallEnabled;
|
||||
this.loopback = loopback;
|
||||
this.videoWidth = videoWidth;
|
||||
@ -162,6 +167,7 @@ public class PeerConnectionClient {
|
||||
this.videoCodecHwAcceleration = videoCodecHwAcceleration;
|
||||
this.audioStartBitrate = audioStartBitrate;
|
||||
this.audioCodec = audioCodec;
|
||||
this.noAudioProcessing = noAudioProcessing;
|
||||
this.cpuOveruseDetection = cpuOveruseDetection;
|
||||
}
|
||||
}
|
||||
@ -387,7 +393,18 @@ public class PeerConnectionClient {
|
||||
|
||||
// Create audio constraints.
|
||||
audioConstraints = new MediaConstraints();
|
||||
|
||||
// added for audio performance measurements
|
||||
if (peerConnectionParameters.noAudioProcessing) {
|
||||
Log.d(TAG, "Disabling audio processing");
|
||||
audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair(
|
||||
AUDIO_ECHO_CANCELLATION_CONSTRAINT, "false"));
|
||||
audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair(
|
||||
AUDIO_AUTO_GAIN_CONTROL_CONSTRAINT, "false"));
|
||||
audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair(
|
||||
AUDIO_HIGH_PASS_FILTER_CONSTRAINT, "false"));
|
||||
audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair(
|
||||
AUDIO_NOISE_SUPPRESSION_CONSTRAINT , "false"));
|
||||
}
|
||||
// Create SDP constraints.
|
||||
sdpMediaConstraints = new MediaConstraints();
|
||||
sdpMediaConstraints.mandatory.add(new MediaConstraints.KeyValuePair(
|
||||
|
@ -50,6 +50,7 @@ public class SettingsActivity extends Activity
|
||||
private String keyprefStartAudioBitrateType;
|
||||
private String keyprefStartAudioBitrateValue;
|
||||
private String keyPrefAudioCodec;
|
||||
private String keyprefNoAudioProcessing;
|
||||
|
||||
private String keyprefCpuUsageDetection;
|
||||
private String keyPrefRoomServerUrl;
|
||||
@ -69,6 +70,7 @@ public class SettingsActivity extends Activity
|
||||
keyprefStartAudioBitrateType = getString(R.string.pref_startaudiobitrate_key);
|
||||
keyprefStartAudioBitrateValue = getString(R.string.pref_startaudiobitratevalue_key);
|
||||
keyPrefAudioCodec = getString(R.string.pref_audiocodec_key);
|
||||
keyprefNoAudioProcessing = getString(R.string.pref_noaudioprocessing_key);
|
||||
|
||||
keyprefCpuUsageDetection = getString(R.string.pref_cpu_usage_detection_key);
|
||||
keyPrefRoomServerUrl = getString(R.string.pref_room_server_url_key);
|
||||
@ -101,6 +103,7 @@ public class SettingsActivity extends Activity
|
||||
updateSummaryBitrate(sharedPreferences, keyprefStartAudioBitrateValue);
|
||||
setAudioBitrateEnable(sharedPreferences);
|
||||
updateSummary(sharedPreferences, keyPrefAudioCodec);
|
||||
updateSummaryB(sharedPreferences, keyprefNoAudioProcessing);
|
||||
|
||||
updateSummaryB(sharedPreferences, keyprefCpuUsageDetection);
|
||||
updateSummary(sharedPreferences, keyPrefRoomServerUrl);
|
||||
@ -131,6 +134,7 @@ public class SettingsActivity extends Activity
|
||||
updateSummaryBitrate(sharedPreferences, key);
|
||||
} else if (key.equals(keyprefVideoCall)
|
||||
|| key.equals(keyprefHwCodec)
|
||||
|| key.equals(keyprefNoAudioProcessing)
|
||||
|| key.equals(keyprefCpuUsageDetection)
|
||||
|| key.equals(keyPrefDisplayHud)) {
|
||||
updateSummaryB(sharedPreferences, key);
|
||||
|
@ -252,7 +252,7 @@ public class PeerConnectionClientTest extends InstrumentationTestCase
|
||||
new PeerConnectionParameters(
|
||||
enableVideo, true, // videoCallEnabled, loopback.
|
||||
0, 0, 0, 0, videoCodec, true, // video codec parameters.
|
||||
0, "OPUS", true); // audio codec parameters.
|
||||
0, "OPUS", false, true); // audio codec parameters.
|
||||
|
||||
PeerConnectionClient client = PeerConnectionClient.getInstance();
|
||||
PeerConnectionFactory.Options options = new PeerConnectionFactory.Options();
|
||||
|
Loading…
x
Reference in New Issue
Block a user