From 458194ba65ab178d886fc6ca59fc50f39250215e Mon Sep 17 00:00:00 2001 From: "leozwang@webrtc.org" Date: Wed, 27 Mar 2013 20:55:54 +0000 Subject: [PATCH] Fix broken audio. The problem was introduced in 3712, no need to external transport in real test app, revert the change. TBR=pwestin@webrtc.org BUG=1539 Review URL: https://webrtc-codereview.appspot.com/1266005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3735 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../test/android/jni/vie_android_java_api.cc | 37 ++++++------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/webrtc/video_engine/test/android/jni/vie_android_java_api.cc b/webrtc/video_engine/test/android/jni/vie_android_java_api.cc index ce07dd6e17..7228ca42d0 100644 --- a/webrtc/video_engine/test/android/jni/vie_android_java_api.cc +++ b/webrtc/video_engine/test/android/jni/vie_android_java_api.cc @@ -34,9 +34,6 @@ #include "common_types.h" #include "android_media_codec_decoder.h" -#include "webrtc/system_wrappers/interface/scoped_ptr.h" -#include "webrtc/test/channel_transport/include/channel_transport.h" - #define WEBRTC_LOG_TAG "*WEBRTCN*" #define VALIDATE_BASE_POINTER \ if (!voeData.base) \ @@ -91,7 +88,6 @@ } using namespace webrtc; -using namespace test; //Forward declaration. class VideoCallbackAndroid; @@ -111,7 +107,6 @@ typedef struct VoEHardware* hardware; VoERTP_RTCP* rtp; JavaVM* jvm; - scoped_ptr transport; } VoiceEngineData; class AndroidVideoRenderCallback; @@ -127,7 +122,6 @@ typedef struct ViECapture* capture; ViEExternalCodec* externalCodec; VideoCallbackAndroid* callback; - scoped_ptr transport; } VideoEngineData; // Global variables @@ -594,7 +588,6 @@ JNIEXPORT jint JNICALL Java_org_webrtc_videoengineapp_ViEAndroidJavaAPI_CreateCh if (voiceChannel >= 0) { vieData.base->ConnectAudioChannel(channel, voiceChannel); } - vieData.transport.reset(new VideoChannelTransport(vieData.netw, channel)); return channel; } else { @@ -615,9 +608,14 @@ JNIEXPORT jint JNICALL Java_org_webrtc_videoengineapp_ViEAndroidJavaAPI_SetLocal { __android_log_write(ANDROID_LOG_DEBUG, WEBRTC_LOG_TAG, "SetLocalReceiver"); - if (vieData.transport.get()) { - return vieData.transport->SetLocalReceiver(port); + if (vieData.vie) { + int ret = vieData.netw->SetLocalReceiver(channel, port); + return ret; } + else { + return -1; + } + return -1; } @@ -648,10 +646,7 @@ JNIEXPORT jint JNICALL Java_org_webrtc_videoengineapp_ViEAndroidJavaAPI_SetSendD "SetSendDestination: channel=%d, port=%d, ip=%s\n", channel, port, ip); - if (vieData.transport.get()) { - return vieData.transport->SetSendDestination(ip, port); - } - return -1; + return vieData.netw->SetSendDestination(channel, ip, port); } @@ -1269,7 +1264,6 @@ JNIEXPORT jint JNICALL Java_org_webrtc_videoengineapp_ViEAndroidJavaAPI_VoE_1Cre } jint channel = voeData.base->CreateChannel(); - voeData.transport.reset(new VoiceChannelTransport(voeData.netw, channel)); return channel; } @@ -1300,10 +1294,7 @@ JNIEXPORT jint JNICALL Java_org_webrtc_videoengineapp_ViEAndroidJavaAPI_VoE_1Set { __android_log_write(ANDROID_LOG_DEBUG, WEBRTC_LOG_TAG, "SetLocalReceiver"); VALIDATE_BASE_POINTER; - if (voeData.transport.get()) { - return voeData.transport->SetLocalReceiver(port); - } - return -1; + return voeData.base->SetLocalReceiver(channel, port); } /* @@ -1327,13 +1318,9 @@ JNIEXPORT jint JNICALL Java_org_webrtc_videoengineapp_ViEAndroidJavaAPI_VoE_1Set "Could not get UTF string"); return -1; } - if (voeData.transport.get()) { - jint retVal = voeData.transport->SetSendDestination(ipaddrNative, port); - env->ReleaseStringUTFChars(ipaddr, ipaddrNative); - return retVal; - } - env->ReleaseStringUTFChars(ipaddr, ipaddrNative); - return -1; + + jint retVal = voeData.base->SetSendDestination(channel, port, ipaddrNative); + return retVal; } /*