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:
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -534,7 +538,7 @@ public class WebRTCDemo extends TabActivity implements IViEAndroidCallback,
|
||||
receivePortVideo);
|
||||
ret = ViEAndroidAPI.SetSendDestination(channel,
|
||||
destinationPortVideo,
|
||||
remoteIp.getBytes());
|
||||
GetRemoteIPString());
|
||||
|
||||
if (enableVideoReceive) {
|
||||
if(useOpenGLRender) {
|
||||
@@ -677,7 +681,7 @@ public class WebRTCDemo extends TabActivity implements IViEAndroidCallback,
|
||||
|
||||
if (0 != ViEAndroidAPI.VoE_SetSendDestination(voiceChannel,
|
||||
destinationPortVoice,
|
||||
remoteIp)) {
|
||||
GetRemoteIPString())) {
|
||||
Log.d(TAG, "VoE set send destination failed");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user