Retrieve data from input

Espeically on tablet, we have to read data dirtectly from input text edit rather than
track key input to let text edit get updated automatically

BUT=None
TEST=local test
Review URL: https://webrtc-codereview.appspot.com/705010

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2599 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
leozwang@webrtc.org
2012-08-11 04:33:02 +00:00
parent 030d752dce
commit a11299648c
4 changed files with 20 additions and 16 deletions

View File

@@ -109,10 +109,10 @@ JNIEXPORT jint JNICALL Java_org_webrtc_videoengineapp_ViEAndroidJavaAPI_SetLocal
/*
* Class: org_webrtc_videoengineapp_ViEAndroidJavaAPI
* Method: SetSendDestination
* Signature: (II[B)I
* Signature: (IILjava/lang/String)I
*/
JNIEXPORT jint JNICALL Java_org_webrtc_videoengineapp_ViEAndroidJavaAPI_SetSendDestination
(JNIEnv *, jobject, jint, jint, jbyteArray);
(JNIEnv *, jobject, jint, jint, jstring);
/*
* Class: org_webrtc_videoengineapp_ViEAndroidJavaAPI

View File

@@ -598,25 +598,25 @@ JNIEXPORT jint JNICALL Java_org_webrtc_videoengineapp_ViEAndroidJavaAPI_SetLocal
/*
* Class: org_webrtc_videoengineapp_ViEAndroidJavaAPI
* Method: SetSendDestination
* Signature: (II[B)I
* Signature: (IILjava/lang/String)I
*/
JNIEXPORT jint JNICALL Java_org_webrtc_videoengineapp_ViEAndroidJavaAPI_SetSendDestination(
JNIEnv * env,
jobject,
jint channel,
jint port,
jbyteArray ipadr)
jstring ipaddr)
{
if (NULL == vieData.vie)
return -1;
char ip[64];
jsize len = env->GetArrayLength(ipadr);
if ((len >= 64) || (len == 0))
const char* ip = env->GetStringUTFChars(ipaddr, NULL);
if (!ip) {
__android_log_write(ANDROID_LOG_ERROR, WEBRTC_LOG_TAG,
"Could not get UTF string");
return -1;
env->GetByteArrayRegion(ipadr, 0, len, (jbyte*) ip);
ip[len] = '\0';
}
__android_log_print(ANDROID_LOG_DEBUG, WEBRTC_LOG_TAG,
"SetSendDestination: channel=%d, port=%d, ip=%s\n",

View File

@@ -52,7 +52,7 @@ public class ViEAndroidJavaAPI {
public native int CreateChannel(int voiceChannel);
// Receiver & Destination functions
public native int SetLocalReceiver(int channel, int port);
public native int SetSendDestination(int channel, int port, byte ipadr[]);
public native int SetSendDestination(int channel, int port, String ipaddr);
// Codec
public native String[] GetCodecs();
public native int SetReceiveCodec(int channel, int codecNum,
@@ -97,7 +97,7 @@ public class ViEAndroidJavaAPI {
// Receiver & Destination functions
public native int VoE_SetLocalReceiver(int channel, int port);
public native int VoE_SetSendDestination(int channel, int port,
String ipaddr);
String ipaddr);
// Media functions
public native int VoE_StartListen(int channel);

View File

@@ -516,6 +516,10 @@ public class WebRTCDemo extends TabActivity implements IViEAndroidCallback,
ReadSettings();
}
private String GetRemoteIPString() {
return etRemoteIp.getText().toString();
}
private void StartCall() {
int ret = 0;
@@ -531,10 +535,10 @@ public class WebRTCDemo extends TabActivity implements IViEAndroidCallback,
channel = ViEAndroidAPI.CreateChannel(voiceChannel);
ret = ViEAndroidAPI.SetLocalReceiver(channel,
receivePortVideo);
receivePortVideo);
ret = ViEAndroidAPI.SetSendDestination(channel,
destinationPortVideo,
remoteIp.getBytes());
destinationPortVideo,
GetRemoteIPString());
if (enableVideoReceive) {
if(useOpenGLRender) {
@@ -676,8 +680,8 @@ public class WebRTCDemo extends TabActivity implements IViEAndroidCallback,
}
if (0 != ViEAndroidAPI.VoE_SetSendDestination(voiceChannel,
destinationPortVoice,
remoteIp)) {
destinationPortVoice,
GetRemoteIPString())) {
Log.d(TAG, "VoE set send destination failed");
}