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
|
* Class: org_webrtc_videoengineapp_ViEAndroidJavaAPI
|
||||||
* Method: SetSendDestination
|
* Method: SetSendDestination
|
||||||
* Signature: (II[B)I
|
* Signature: (IILjava/lang/String)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_org_webrtc_videoengineapp_ViEAndroidJavaAPI_SetSendDestination
|
JNIEXPORT jint JNICALL Java_org_webrtc_videoengineapp_ViEAndroidJavaAPI_SetSendDestination
|
||||||
(JNIEnv *, jobject, jint, jint, jbyteArray);
|
(JNIEnv *, jobject, jint, jint, jstring);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: org_webrtc_videoengineapp_ViEAndroidJavaAPI
|
* Class: org_webrtc_videoengineapp_ViEAndroidJavaAPI
|
||||||
|
|||||||
@@ -598,25 +598,25 @@ JNIEXPORT jint JNICALL Java_org_webrtc_videoengineapp_ViEAndroidJavaAPI_SetLocal
|
|||||||
/*
|
/*
|
||||||
* Class: org_webrtc_videoengineapp_ViEAndroidJavaAPI
|
* Class: org_webrtc_videoengineapp_ViEAndroidJavaAPI
|
||||||
* Method: SetSendDestination
|
* Method: SetSendDestination
|
||||||
* Signature: (II[B)I
|
* Signature: (IILjava/lang/String)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jint JNICALL Java_org_webrtc_videoengineapp_ViEAndroidJavaAPI_SetSendDestination(
|
JNIEXPORT jint JNICALL Java_org_webrtc_videoengineapp_ViEAndroidJavaAPI_SetSendDestination(
|
||||||
JNIEnv * env,
|
JNIEnv * env,
|
||||||
jobject,
|
jobject,
|
||||||
jint channel,
|
jint channel,
|
||||||
jint port,
|
jint port,
|
||||||
jbyteArray ipadr)
|
jstring ipaddr)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (NULL == vieData.vie)
|
if (NULL == vieData.vie)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
char ip[64];
|
const char* ip = env->GetStringUTFChars(ipaddr, NULL);
|
||||||
jsize len = env->GetArrayLength(ipadr);
|
if (!ip) {
|
||||||
if ((len >= 64) || (len == 0))
|
__android_log_write(ANDROID_LOG_ERROR, WEBRTC_LOG_TAG,
|
||||||
|
"Could not get UTF string");
|
||||||
return -1;
|
return -1;
|
||||||
env->GetByteArrayRegion(ipadr, 0, len, (jbyte*) ip);
|
}
|
||||||
ip[len] = '\0';
|
|
||||||
|
|
||||||
__android_log_print(ANDROID_LOG_DEBUG, WEBRTC_LOG_TAG,
|
__android_log_print(ANDROID_LOG_DEBUG, WEBRTC_LOG_TAG,
|
||||||
"SetSendDestination: channel=%d, port=%d, ip=%s\n",
|
"SetSendDestination: channel=%d, port=%d, ip=%s\n",
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class ViEAndroidJavaAPI {
|
|||||||
public native int CreateChannel(int voiceChannel);
|
public native int CreateChannel(int voiceChannel);
|
||||||
// Receiver & Destination functions
|
// Receiver & Destination functions
|
||||||
public native int SetLocalReceiver(int channel, int port);
|
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
|
// Codec
|
||||||
public native String[] GetCodecs();
|
public native String[] GetCodecs();
|
||||||
public native int SetReceiveCodec(int channel, int codecNum,
|
public native int SetReceiveCodec(int channel, int codecNum,
|
||||||
@@ -97,7 +97,7 @@ public class ViEAndroidJavaAPI {
|
|||||||
// Receiver & Destination functions
|
// Receiver & Destination functions
|
||||||
public native int VoE_SetLocalReceiver(int channel, int port);
|
public native int VoE_SetLocalReceiver(int channel, int port);
|
||||||
public native int VoE_SetSendDestination(int channel, int port,
|
public native int VoE_SetSendDestination(int channel, int port,
|
||||||
String ipaddr);
|
String ipaddr);
|
||||||
|
|
||||||
// Media functions
|
// Media functions
|
||||||
public native int VoE_StartListen(int channel);
|
public native int VoE_StartListen(int channel);
|
||||||
|
|||||||
@@ -516,6 +516,10 @@ public class WebRTCDemo extends TabActivity implements IViEAndroidCallback,
|
|||||||
ReadSettings();
|
ReadSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String GetRemoteIPString() {
|
||||||
|
return etRemoteIp.getText().toString();
|
||||||
|
}
|
||||||
|
|
||||||
private void StartCall() {
|
private void StartCall() {
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
@@ -531,10 +535,10 @@ public class WebRTCDemo extends TabActivity implements IViEAndroidCallback,
|
|||||||
|
|
||||||
channel = ViEAndroidAPI.CreateChannel(voiceChannel);
|
channel = ViEAndroidAPI.CreateChannel(voiceChannel);
|
||||||
ret = ViEAndroidAPI.SetLocalReceiver(channel,
|
ret = ViEAndroidAPI.SetLocalReceiver(channel,
|
||||||
receivePortVideo);
|
receivePortVideo);
|
||||||
ret = ViEAndroidAPI.SetSendDestination(channel,
|
ret = ViEAndroidAPI.SetSendDestination(channel,
|
||||||
destinationPortVideo,
|
destinationPortVideo,
|
||||||
remoteIp.getBytes());
|
GetRemoteIPString());
|
||||||
|
|
||||||
if (enableVideoReceive) {
|
if (enableVideoReceive) {
|
||||||
if(useOpenGLRender) {
|
if(useOpenGLRender) {
|
||||||
@@ -676,8 +680,8 @@ public class WebRTCDemo extends TabActivity implements IViEAndroidCallback,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (0 != ViEAndroidAPI.VoE_SetSendDestination(voiceChannel,
|
if (0 != ViEAndroidAPI.VoE_SetSendDestination(voiceChannel,
|
||||||
destinationPortVoice,
|
destinationPortVoice,
|
||||||
remoteIp)) {
|
GetRemoteIPString())) {
|
||||||
Log.d(TAG, "VoE set send destination failed");
|
Log.d(TAG, "VoE set send destination failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user