Add FlexFEC settings toggle in Android AppRTCMobile.
BUG=webrtc:5654 Review-Url: https://codereview.webrtc.org/2550393002 Cr-Commit-Position: refs/heads/master@{#15481}
This commit is contained in:
@ -75,6 +75,7 @@ public class CallActivity extends Activity implements AppRTCClient.SignalingEven
|
||||
public static final String EXTRA_VIDEOCODEC = "org.appspot.apprtc.VIDEOCODEC";
|
||||
public static final String EXTRA_HWCODEC_ENABLED = "org.appspot.apprtc.HWCODEC";
|
||||
public static final String EXTRA_CAPTURETOTEXTURE_ENABLED = "org.appspot.apprtc.CAPTURETOTEXTURE";
|
||||
public static final String EXTRA_FLEXFEC_ENABLED = "org.appspot.apprtc.FLEXFEC";
|
||||
public static final String EXTRA_AUDIO_BITRATE = "org.appspot.apprtc.AUDIO_BITRATE";
|
||||
public static final String EXTRA_AUDIOCODEC = "org.appspot.apprtc.AUDIOCODEC";
|
||||
public static final String EXTRA_NOAUDIOPROCESSING_ENABLED =
|
||||
@ -287,6 +288,7 @@ public class CallActivity extends Activity implements AppRTCClient.SignalingEven
|
||||
tracing, videoWidth, videoHeight, intent.getIntExtra(EXTRA_VIDEO_FPS, 0),
|
||||
intent.getIntExtra(EXTRA_VIDEO_BITRATE, 0), intent.getStringExtra(EXTRA_VIDEOCODEC),
|
||||
intent.getBooleanExtra(EXTRA_HWCODEC_ENABLED, true),
|
||||
intent.getBooleanExtra(EXTRA_FLEXFEC_ENABLED, false),
|
||||
intent.getIntExtra(EXTRA_AUDIO_BITRATE, 0), intent.getStringExtra(EXTRA_AUDIOCODEC),
|
||||
intent.getBooleanExtra(EXTRA_NOAUDIOPROCESSING_ENABLED, false),
|
||||
intent.getBooleanExtra(EXTRA_AECDUMP_ENABLED, false),
|
||||
|
||||
@ -66,6 +66,7 @@ public class ConnectActivity extends Activity {
|
||||
private String keyprefAudioCodec;
|
||||
private String keyprefHwCodecAcceleration;
|
||||
private String keyprefCaptureToTexture;
|
||||
private String keyprefFlexfec;
|
||||
private String keyprefNoAudioProcessingPipeline;
|
||||
private String keyprefAecDump;
|
||||
private String keyprefOpenSLES;
|
||||
@ -106,6 +107,7 @@ public class ConnectActivity extends Activity {
|
||||
keyprefVideoCodec = getString(R.string.pref_videocodec_key);
|
||||
keyprefHwCodecAcceleration = getString(R.string.pref_hwcodec_key);
|
||||
keyprefCaptureToTexture = getString(R.string.pref_capturetotexture_key);
|
||||
keyprefFlexfec = getString(R.string.pref_flexfec_key);
|
||||
keyprefAudioBitrateType = getString(R.string.pref_startaudiobitrate_key);
|
||||
keyprefAudioBitrateValue = getString(R.string.pref_startaudiobitratevalue_key);
|
||||
keyprefAudioCodec = getString(R.string.pref_audiocodec_key);
|
||||
@ -354,6 +356,10 @@ public class ConnectActivity extends Activity {
|
||||
CallActivity.EXTRA_CAPTURETOTEXTURE_ENABLED, R.string.pref_capturetotexture_default,
|
||||
useValuesFromIntent);
|
||||
|
||||
// Check FlexFEC.
|
||||
boolean flexfecEnabled = sharedPrefGetBoolean(R.string.pref_flexfec_key,
|
||||
CallActivity.EXTRA_FLEXFEC_ENABLED, R.string.pref_flexfec_default, useValuesFromIntent);
|
||||
|
||||
// Check Disable Audio Processing flag.
|
||||
boolean noAudioProcessing = sharedPrefGetBoolean(R.string.pref_noaudioprocessing_key,
|
||||
CallActivity.EXTRA_NOAUDIOPROCESSING_ENABLED, R.string.pref_noaudioprocessing_default,
|
||||
@ -507,6 +513,7 @@ public class ConnectActivity extends Activity {
|
||||
intent.putExtra(CallActivity.EXTRA_VIDEOCODEC, videoCodec);
|
||||
intent.putExtra(CallActivity.EXTRA_HWCODEC_ENABLED, hwCodec);
|
||||
intent.putExtra(CallActivity.EXTRA_CAPTURETOTEXTURE_ENABLED, captureToTexture);
|
||||
intent.putExtra(CallActivity.EXTRA_FLEXFEC_ENABLED, flexfecEnabled);
|
||||
intent.putExtra(CallActivity.EXTRA_NOAUDIOPROCESSING_ENABLED, noAudioProcessing);
|
||||
intent.putExtra(CallActivity.EXTRA_AECDUMP_ENABLED, aecDump);
|
||||
intent.putExtra(CallActivity.EXTRA_OPENSLES_ENABLED, useOpenSLES);
|
||||
|
||||
@ -71,6 +71,7 @@ public class PeerConnectionClient {
|
||||
private static final String AUDIO_CODEC_OPUS = "opus";
|
||||
private static final String AUDIO_CODEC_ISAC = "ISAC";
|
||||
private static final String VIDEO_CODEC_PARAM_START_BITRATE = "x-google-start-bitrate";
|
||||
private static final String VIDEO_FLEXFEC_FIELDTRIAL = "WebRTC-FlexFEC-03/Enabled/";
|
||||
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";
|
||||
@ -165,6 +166,7 @@ public class PeerConnectionClient {
|
||||
public final int videoMaxBitrate;
|
||||
public final String videoCodec;
|
||||
public final boolean videoCodecHwAcceleration;
|
||||
public final boolean videoFlexfecEnabled;
|
||||
public final int audioStartBitrate;
|
||||
public final String audioCodec;
|
||||
public final boolean noAudioProcessing;
|
||||
@ -178,21 +180,22 @@ public class PeerConnectionClient {
|
||||
|
||||
public PeerConnectionParameters(boolean videoCallEnabled, boolean loopback, boolean tracing,
|
||||
int videoWidth, int videoHeight, int videoFps, int videoMaxBitrate, String videoCodec,
|
||||
boolean videoCodecHwAcceleration, int audioStartBitrate, String audioCodec,
|
||||
boolean noAudioProcessing, boolean aecDump, boolean useOpenSLES, boolean disableBuiltInAEC,
|
||||
boolean disableBuiltInAGC, boolean disableBuiltInNS, boolean enableLevelControl) {
|
||||
boolean videoCodecHwAcceleration, boolean videoFlexfecEnabled, int audioStartBitrate,
|
||||
String audioCodec, boolean noAudioProcessing, boolean aecDump, boolean useOpenSLES,
|
||||
boolean disableBuiltInAEC, boolean disableBuiltInAGC, boolean disableBuiltInNS,
|
||||
boolean enableLevelControl) {
|
||||
this(videoCallEnabled, loopback, tracing, videoWidth, videoHeight, videoFps, videoMaxBitrate,
|
||||
videoCodec, videoCodecHwAcceleration, audioStartBitrate, audioCodec, noAudioProcessing,
|
||||
aecDump, useOpenSLES, disableBuiltInAEC, disableBuiltInAGC, disableBuiltInNS,
|
||||
enableLevelControl, null);
|
||||
videoCodec, videoCodecHwAcceleration, videoFlexfecEnabled, audioStartBitrate, audioCodec,
|
||||
noAudioProcessing, aecDump, useOpenSLES, disableBuiltInAEC, disableBuiltInAGC,
|
||||
disableBuiltInNS, enableLevelControl, null);
|
||||
}
|
||||
|
||||
public PeerConnectionParameters(boolean videoCallEnabled, boolean loopback, boolean tracing,
|
||||
int videoWidth, int videoHeight, int videoFps, int videoMaxBitrate, String videoCodec,
|
||||
boolean videoCodecHwAcceleration, int audioStartBitrate, String audioCodec,
|
||||
boolean noAudioProcessing, boolean aecDump, boolean useOpenSLES, boolean disableBuiltInAEC,
|
||||
boolean disableBuiltInAGC, boolean disableBuiltInNS, boolean enableLevelControl,
|
||||
DataChannelParameters dataChannelParameters) {
|
||||
boolean videoCodecHwAcceleration, boolean videoFlexfecEnabled, int audioStartBitrate,
|
||||
String audioCodec, boolean noAudioProcessing, boolean aecDump, boolean useOpenSLES,
|
||||
boolean disableBuiltInAEC, boolean disableBuiltInAGC, boolean disableBuiltInNS,
|
||||
boolean enableLevelControl, DataChannelParameters dataChannelParameters) {
|
||||
this.videoCallEnabled = videoCallEnabled;
|
||||
this.loopback = loopback;
|
||||
this.tracing = tracing;
|
||||
@ -201,6 +204,7 @@ public class PeerConnectionClient {
|
||||
this.videoFps = videoFps;
|
||||
this.videoMaxBitrate = videoMaxBitrate;
|
||||
this.videoCodec = videoCodec;
|
||||
this.videoFlexfecEnabled = videoFlexfecEnabled;
|
||||
this.videoCodecHwAcceleration = videoCodecHwAcceleration;
|
||||
this.audioStartBitrate = audioStartBitrate;
|
||||
this.audioCodec = audioCodec;
|
||||
@ -366,7 +370,12 @@ public class PeerConnectionClient {
|
||||
isError = false;
|
||||
|
||||
// Initialize field trials.
|
||||
PeerConnectionFactory.initializeFieldTrials("");
|
||||
if (peerConnectionParameters.videoFlexfecEnabled) {
|
||||
PeerConnectionFactory.initializeFieldTrials(VIDEO_FLEXFEC_FIELDTRIAL);
|
||||
Log.d(TAG, "Enable FlexFEC field trial.");
|
||||
} else {
|
||||
PeerConnectionFactory.initializeFieldTrials("");
|
||||
}
|
||||
|
||||
// Check preferred video codec.
|
||||
preferredVideoCodec = VIDEO_CODEC_VP8;
|
||||
@ -377,7 +386,7 @@ public class PeerConnectionClient {
|
||||
preferredVideoCodec = VIDEO_CODEC_H264;
|
||||
}
|
||||
}
|
||||
Log.d(TAG, "Pereferred video codec: " + preferredVideoCodec);
|
||||
Log.d(TAG, "Preferred video codec: " + preferredVideoCodec);
|
||||
|
||||
// Check if ISAC is used by default.
|
||||
preferIsac = peerConnectionParameters.audioCodec != null
|
||||
|
||||
@ -35,6 +35,7 @@ public class SettingsActivity extends Activity implements OnSharedPreferenceChan
|
||||
private String keyPrefVideoCodec;
|
||||
private String keyprefHwCodec;
|
||||
private String keyprefCaptureToTexture;
|
||||
private String keyprefFlexfec;
|
||||
|
||||
private String keyprefStartAudioBitrateType;
|
||||
private String keyprefStartAudioBitrateValue;
|
||||
@ -74,6 +75,7 @@ public class SettingsActivity extends Activity implements OnSharedPreferenceChan
|
||||
keyPrefVideoCodec = getString(R.string.pref_videocodec_key);
|
||||
keyprefHwCodec = getString(R.string.pref_hwcodec_key);
|
||||
keyprefCaptureToTexture = getString(R.string.pref_capturetotexture_key);
|
||||
keyprefFlexfec = getString(R.string.pref_flexfec_key);
|
||||
|
||||
keyprefStartAudioBitrateType = getString(R.string.pref_startaudiobitrate_key);
|
||||
keyprefStartAudioBitrateValue = getString(R.string.pref_startaudiobitratevalue_key);
|
||||
@ -126,6 +128,7 @@ public class SettingsActivity extends Activity implements OnSharedPreferenceChan
|
||||
updateSummary(sharedPreferences, keyPrefVideoCodec);
|
||||
updateSummaryB(sharedPreferences, keyprefHwCodec);
|
||||
updateSummaryB(sharedPreferences, keyprefCaptureToTexture);
|
||||
updateSummaryB(sharedPreferences, keyprefFlexfec);
|
||||
|
||||
updateSummary(sharedPreferences, keyprefStartAudioBitrateType);
|
||||
updateSummaryBitrate(sharedPreferences, keyprefStartAudioBitrateValue);
|
||||
@ -223,6 +226,7 @@ public class SettingsActivity extends Activity implements OnSharedPreferenceChan
|
||||
|| key.equals(keyprefCaptureQualitySlider)
|
||||
|| key.equals(keyprefHwCodec)
|
||||
|| key.equals(keyprefCaptureToTexture)
|
||||
|| key.equals(keyprefFlexfec)
|
||||
|| key.equals(keyprefNoAudioProcessing)
|
||||
|| key.equals(keyprefAecDump)
|
||||
|| key.equals(keyprefOpenSLES)
|
||||
|
||||
Reference in New Issue
Block a user