Make loopback mode work properly
Some minor changes and improvements are added into this cl BUG= TEST=vie_test Review URL: https://webrtc-codereview.appspot.com/667005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2520 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
d41f59a23f
commit
8495915442
@ -90,13 +90,10 @@ public class WebRTCDemo extends TabActivity implements IViEAndroidCallback,
|
|||||||
|
|
||||||
// Constant
|
// Constant
|
||||||
private static final String TAG = "WEBRTC";
|
private static final String TAG = "WEBRTC";
|
||||||
private static final int RECEIVE_CODEC_FRAMERATE = 30;
|
private static final int RECEIVE_CODEC_FRAMERATE = 15;
|
||||||
private static final int SEND_CODEC_FRAMERATE = 30;
|
private static final int SEND_CODEC_FRAMERATE = 15;
|
||||||
private static final int INIT_BITRATE = 400;
|
private static final int INIT_BITRATE = 500;
|
||||||
|
private static final String LOOPBACK_IP = "127.0.0.1";
|
||||||
private static final int EXPIRARY_YEAR = 2010;
|
|
||||||
private static final int EXPIRARY_MONTH = 10;
|
|
||||||
private static final int EXPIRARY_DAY = 22;
|
|
||||||
|
|
||||||
private int volumeLevel = 204;
|
private int volumeLevel = 204;
|
||||||
|
|
||||||
@ -120,7 +117,7 @@ public class WebRTCDemo extends TabActivity implements IViEAndroidCallback,
|
|||||||
private CheckBox cbVoice;
|
private CheckBox cbVoice;
|
||||||
private boolean enableVoice = true;
|
private boolean enableVoice = true;
|
||||||
private EditText etRemoteIp;
|
private EditText etRemoteIp;
|
||||||
private String remoteIp = "10.1.100.68";
|
private String remoteIp = "";
|
||||||
private CheckBox cbLoopback;
|
private CheckBox cbLoopback;
|
||||||
private boolean loopbackMode = true;
|
private boolean loopbackMode = true;
|
||||||
private CheckBox cbStats;
|
private CheckBox cbStats;
|
||||||
@ -439,6 +436,13 @@ public class WebRTCDemo extends TabActivity implements IViEAndroidCallback,
|
|||||||
R.layout.row,
|
R.layout.row,
|
||||||
mVoiceCodecsStrings));
|
mVoiceCodecsStrings));
|
||||||
spVoiceCodecType.setSelection(0);
|
spVoiceCodecType.setSelection(0);
|
||||||
|
// Find PCMU and use it
|
||||||
|
for (int i=0; i<mVoiceCodecsStrings.length; ++i) {
|
||||||
|
if (mVoiceCodecsStrings[i].contains("PCMU")) {
|
||||||
|
spVoiceCodecType.setSelection(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RadioGroup radioGroup = (RadioGroup)findViewById(R.id.radio_group1);
|
RadioGroup radioGroup = (RadioGroup)findViewById(R.id.radio_group1);
|
||||||
radioGroup.clearCheck();
|
radioGroup.clearCheck();
|
||||||
@ -490,14 +494,24 @@ public class WebRTCDemo extends TabActivity implements IViEAndroidCallback,
|
|||||||
cbEnableNS = (CheckBox) findViewById(R.id.cbNoiseSuppression);
|
cbEnableNS = (CheckBox) findViewById(R.id.cbNoiseSuppression);
|
||||||
cbEnableNS.setChecked(enableNS);
|
cbEnableNS.setChecked(enableNS);
|
||||||
|
|
||||||
|
etRemoteIp.setOnClickListener(this);
|
||||||
|
cbLoopback.setOnClickListener(this);
|
||||||
cbStats.setOnClickListener(this);
|
cbStats.setOnClickListener(this);
|
||||||
cbEnableNack.setOnClickListener(this);
|
cbEnableNack.setOnClickListener(this);
|
||||||
cbEnableSpeaker.setOnClickListener(this);
|
cbEnableSpeaker.setOnClickListener(this);
|
||||||
cbEnableAECM.setOnClickListener(this);
|
cbEnableAECM.setOnClickListener(this);
|
||||||
|
|
||||||
cbEnableAGC.setOnClickListener(this);
|
cbEnableAGC.setOnClickListener(this);
|
||||||
cbEnableNS.setOnClickListener(this);
|
cbEnableNS.setOnClickListener(this);
|
||||||
|
|
||||||
|
if (loopbackMode) {
|
||||||
|
remoteIp = LOOPBACK_IP;
|
||||||
|
etRemoteIp.setText(remoteIp);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
GetLocalIpAddress();
|
||||||
|
etRemoteIp.setText(remoteIp);
|
||||||
|
}
|
||||||
|
|
||||||
// Read settings to refresh each configuration
|
// Read settings to refresh each configuration
|
||||||
ReadSettings();
|
ReadSettings();
|
||||||
}
|
}
|
||||||
@ -745,6 +759,20 @@ public class WebRTCDemo extends TabActivity implements IViEAndroidCallback,
|
|||||||
StopAll();
|
StopAll();
|
||||||
finish();
|
finish();
|
||||||
break;
|
break;
|
||||||
|
case R.id.cbLoopback:
|
||||||
|
loopbackMode = cbLoopback.isChecked();
|
||||||
|
if (loopbackMode) {
|
||||||
|
remoteIp = LOOPBACK_IP;
|
||||||
|
etRemoteIp.setText(LOOPBACK_IP);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
GetLocalIpAddress();
|
||||||
|
etRemoteIp.setText(remoteIp);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case R.id.etRemoteIp:
|
||||||
|
remoteIp = etRemoteIp.getText().toString();
|
||||||
|
break;
|
||||||
case R.id.cbStats:
|
case R.id.cbStats:
|
||||||
isStatsOn = cbStats.isChecked();
|
isStatsOn = cbStats.isChecked();
|
||||||
if (isStatsOn) {
|
if (isStatsOn) {
|
||||||
@ -822,11 +850,6 @@ public class WebRTCDemo extends TabActivity implements IViEAndroidCallback,
|
|||||||
enableAGC = cbEnableAGC.isChecked();
|
enableAGC = cbEnableAGC.isChecked();
|
||||||
enableAECM = cbEnableAECM.isChecked();
|
enableAECM = cbEnableAECM.isChecked();
|
||||||
enableNS = cbEnableNS.isChecked();
|
enableNS = cbEnableNS.isChecked();
|
||||||
|
|
||||||
if (loopbackMode)
|
|
||||||
remoteIp = "127.0.0.1";
|
|
||||||
else
|
|
||||||
remoteIp = etRemoteIp.getText().toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onItemSelected(AdapterView<?> adapterView, View view,
|
public void onItemSelected(AdapterView<?> adapterView, View view,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user