diff --git a/webrtc/examples/android/media_demo/jni/video_engine_jni.cc b/webrtc/examples/android/media_demo/jni/video_engine_jni.cc index c6589ece6..c7af1c54f 100644 --- a/webrtc/examples/android/media_demo/jni/video_engine_jni.cc +++ b/webrtc/examples/android/media_demo/jni/video_engine_jni.cc @@ -710,3 +710,9 @@ JOWW(void, VideoCodecInst_setMaxFrameRate)(JNIEnv* jni, jobject j_codec, JOWW(void, CameraDesc_dispose)(JNIEnv* jni, jobject j_camera) { delete GetCameraDesc(jni, j_camera); } + +JOWW(jint, VideoEngine_setLocalSSRC)(JNIEnv* jni, jobject j_vie, jint channel, + jint ssrc) { + VideoEngineData* vie_data = GetVideoEngineData(jni, j_vie); + return vie_data->rtp->SetLocalSSRC(channel, ssrc); +} diff --git a/webrtc/examples/android/media_demo/src/org/webrtc/webrtcdemo/MediaEngine.java b/webrtc/examples/android/media_demo/src/org/webrtc/webrtcdemo/MediaEngine.java index f62843158..f55bcccfb 100644 --- a/webrtc/examples/android/media_demo/src/org/webrtc/webrtcdemo/MediaEngine.java +++ b/webrtc/examples/android/media_demo/src/org/webrtc/webrtcdemo/MediaEngine.java @@ -259,7 +259,7 @@ public class MediaEngine implements VideoDecodeEncodeObserver { public void setTrace(boolean enable) { if (enable) { vie.setTraceFile("/sdcard/trace.txt", false); - vie.setTraceFilter(VideoEngine.TraceLevel.TRACE_ERROR); + vie.setTraceFilter(VideoEngine.TraceLevel.TRACE_ALL); return; } vie.setTraceFilter(VideoEngine.TraceLevel.TRACE_NONE); @@ -561,6 +561,14 @@ public class MediaEngine implements VideoDecodeEncodeObserver { check(vie.setSendDestination(videoChannel, videoTxPort, remoteIp) == 0, "Failed setSendDestination"); } + + // Setting localSSRC manually (arbitrary value) for loopback test, + // As otherwise we will get a clash and a new SSRC will be set, + // Which will reset the receiver and other minor issues. + if (remoteIp.equals("127.0.0.1")) { + check(vie.setLocalSSRC(videoChannel, 0x01234567) == 0, + "Failed setLocalSSRC"); + } } public int videoTxPort() { diff --git a/webrtc/examples/android/media_demo/src/org/webrtc/webrtcdemo/VideoEngine.java b/webrtc/examples/android/media_demo/src/org/webrtc/webrtcdemo/VideoEngine.java index 7cfa5856d..677ff42fb 100644 --- a/webrtc/examples/android/media_demo/src/org/webrtc/webrtcdemo/VideoEngine.java +++ b/webrtc/examples/android/media_demo/src/org/webrtc/webrtcdemo/VideoEngine.java @@ -116,4 +116,5 @@ public class VideoEngine { return stopRtpDump(channel, direction.ordinal()); } private native int stopRtpDump(int channel, int direction); + public native int setLocalSSRC(int channel, int ssrc); } diff --git a/webrtc/webrtc_examples.gyp b/webrtc/webrtc_examples.gyp index 56a0e9efd..e8d1b9828 100644 --- a/webrtc/webrtc_examples.gyp +++ b/webrtc/webrtc_examples.gyp @@ -15,7 +15,6 @@ 'type': 'loadable_module', 'dependencies': [ '<(DEPTH)/third_party/icu/icu.gyp:icuuc', - '<(webrtc_root)/modules/modules.gyp:*', '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:field_trial_default', '<(webrtc_root)/test/test.gyp:channel_transport', '<(webrtc_root)/video_engine/video_engine.gyp:video_engine_core',