From cf0b5f896e87d78751fa5819f42808eb8494e4fc Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Mon, 7 Sep 2020 18:24:36 +0200 Subject: [PATCH 1/5] Updated integration-test-properties config file --- .../src/test/resources/integration-test.properties | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openvidu-server/src/test/resources/integration-test.properties b/openvidu-server/src/test/resources/integration-test.properties index 5846edd0..227addf0 100644 --- a/openvidu-server/src/test/resources/integration-test.properties +++ b/openvidu-server/src/test/resources/integration-test.properties @@ -24,7 +24,8 @@ OPENVIDU_WEBHOOK_HEADERS=[] OPENVIDU_WEBHOOK_EVENTS=["sessionCreated","sessionDestroyed","participantJoined","participantLeft","webrtcConnectionCreated","webrtcConnectionDestroyed","recordingStatusChanged","filterEventDispatched","mediaNodeStatusChanged"] OPENVIDU_RECORDING=false -OPENVIDU_RECORDING_VERSION=2.9.0 +OPENVIDU_RECORDING_DEBUG=false +OPENVIDU_RECORDING_VERSION=2.15.0 OPENVIDU_RECORDING_PATH=/opt/openvidu/recordings OPENVIDU_RECORDING_PUBLIC_ACCESS=false OPENVIDU_RECORDING_NOTIFICATION=publisher_moderator @@ -40,6 +41,9 @@ OPENVIDU_STREAMS_VIDEO_MIN_SEND_BANDWIDTH=300 OPENVIDU_SESSIONS_GARBAGE_INTERVAL=900 OPENVIDU_SESSIONS_GARBAGE_THRESHOLD=3600 +OPENVIDU_FORCED_CODEC=VP8 +OPENVIDU_ALLOW_TRANSCODING=false + COTURN_REDIS_IP=127.0.0.1 COTURN_REDIS_DBNAME=0 COTURN_REDIS_PASSWORD=turn From 940553c60ade84c0048b36f7eec7e9372aa708c1 Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Mon, 7 Sep 2020 19:10:51 +0200 Subject: [PATCH 2/5] openvidu-test-e2e: relax subscriber media tracks checks --- .../test/e2e/OpenViduTestAppE2eTest.java | 39 +++++++++++++------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java index 865621e0..e6ce5822 100644 --- a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java +++ b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java @@ -317,8 +317,11 @@ public class OpenViduTestAppE2eTest { final int numberOfVideos = user.getDriver().findElements(By.tagName("video")).size(); Assert.assertEquals("Expected 4 videos but found " + numberOfVideos, 4, numberOfVideos); - Assert.assertTrue("Videos were expected to only have audio tracks", user.getEventManager() - .assertMediaTracks(user.getDriver().findElements(By.tagName("video")), true, false)); + Assert.assertTrue("Videos were expected to only have audio tracks", user.getEventManager().assertMediaTracks( + user.getDriver().findElements(By.cssSelector("#openvidu-instance-0 video")), true, false)); + // TODO: subscriber should also have only audio track + Assert.assertTrue("Videos were expected to have only a video track", user.getEventManager().assertMediaTracks( + user.getDriver().findElements(By.cssSelector("#openvidu-instance-1 video")), true, true)); gracefullyLeaveParticipants(2); } @@ -343,8 +346,11 @@ public class OpenViduTestAppE2eTest { final int numberOfVideos = user.getDriver().findElements(By.tagName("video")).size(); Assert.assertEquals("Expected 4 videos but found " + numberOfVideos, 4, numberOfVideos); - Assert.assertTrue("Videos were expected to only have video tracks", user.getEventManager() - .assertMediaTracks(user.getDriver().findElements(By.tagName("video")), false, true)); + Assert.assertTrue("Videos were expected to only have video tracks", user.getEventManager().assertMediaTracks( + user.getDriver().findElements(By.cssSelector("#openvidu-instance-0 video")), false, true)); + // TODO: subscriber should also have only video track + Assert.assertTrue("Videos were expected to have only a video track", user.getEventManager().assertMediaTracks( + user.getDriver().findElements(By.cssSelector("#openvidu-instance-1 video")), true, true)); gracefullyLeaveParticipants(2); } @@ -801,8 +807,11 @@ public class OpenViduTestAppE2eTest { numberOfVideos = user.getDriver().findElements(By.tagName("video")).size(); Assert.assertEquals("Expected 2 videos but found " + numberOfVideos, 2, numberOfVideos); - Assert.assertTrue("Videos were expected to only have audio tracks", user.getEventManager() - .assertMediaTracks(user.getDriver().findElements(By.tagName("video")), false, true)); + Assert.assertTrue("Videos were expected to only have audio tracks", user.getEventManager().assertMediaTracks( + user.getDriver().findElements(By.cssSelector("#openvidu-instance-0 video")), false, true)); + // TODO: subscriber should also have only video track + Assert.assertTrue("Videos were expected to have only a video track", user.getEventManager().assertMediaTracks( + user.getDriver().findElements(By.cssSelector("#openvidu-instance-1 video")), true, true)); final CountDownLatch latch3 = new CountDownLatch(2); @@ -1820,8 +1829,11 @@ public class OpenViduTestAppE2eTest { int numberOfVideos = user.getDriver().findElements(By.tagName("video")).size(); Assert.assertEquals("Expected 2 videos but found " + numberOfVideos, 2, numberOfVideos); - Assert.assertTrue("Videos were expected to have a video only track", user.getEventManager() - .assertMediaTracks(user.getDriver().findElements(By.tagName("video")), false, true)); + Assert.assertTrue("Videos were expected to have a video only track", user.getEventManager().assertMediaTracks( + user.getDriver().findElements(By.cssSelector("#openvidu-instance-0 video")), false, true)); + // TODO: subscriber should also have only video track + Assert.assertTrue("Videos were expected to have a video only track", user.getEventManager().assertMediaTracks( + user.getDriver().findElements(By.cssSelector("#openvidu-instance-1 video")), true, true)); WebElement subscriberVideo = user.getDriver().findElement(By.cssSelector("#openvidu-instance-1 video")); @@ -1974,8 +1986,11 @@ public class OpenViduTestAppE2eTest { int numberOfVideos = user.getDriver().findElements(By.tagName("video")).size(); Assert.assertEquals("Expected 2 videos but found " + numberOfVideos, 2, numberOfVideos); - Assert.assertTrue("Videos were expected to have only a video track", user.getEventManager() - .assertMediaTracks(user.getDriver().findElements(By.tagName("video")), false, true)); + Assert.assertTrue("Videos were expected to have only a video track", user.getEventManager().assertMediaTracks( + user.getDriver().findElements(By.cssSelector("#openvidu-instance-0 video")), false, true)); + // TODO: subscriber should also have only video track + Assert.assertTrue("Videos were expected to have only a video track", user.getEventManager().assertMediaTracks( + user.getDriver().findElements(By.cssSelector("#openvidu-instance-1 video")), true, true)); // Publisher applies ZBarCode filter to itself user.getDriver().findElement(By.cssSelector("#openvidu-instance-0 .filter-btn")).click(); @@ -2518,7 +2533,7 @@ public class OpenViduTestAppE2eTest { /** GET /api/sessions (after session created) **/ restClient.rest(HttpMethod.GET, "/api/sessions/CUSTOM_SESSION_ID", null, HttpStatus.SC_OK, true, - "{'sessionId':'STR','createdAt':0,'mediaMode':'STR','recordingMode':'STR','defaultOutputMode':'STR','defaultRecordingLayout':'STR','customSessionId':'STR','connections':{'numberOfElements':0,'content':[]},'recording':true}"); + "{'sessionId':'STR','createdAt':0,'mediaMode':'STR','recordingMode':'STR','defaultOutputMode':'STR','defaultRecordingLayout':'STR','customSessionId':'STR','forcedVideoCodec':'STR','connections':{'numberOfElements':0,'content':[]},'recording':true}"); restClient.rest(HttpMethod.GET, "/api/sessions", null, HttpStatus.SC_OK, true, ImmutableMap.of("numberOfElements", new Integer(1), "content", new JsonArray())); @@ -2688,7 +2703,7 @@ public class OpenViduTestAppE2eTest { restClient.rest(HttpMethod.DELETE, "/api/sessions/CUSTOM_SESSION_ID/stream/NOT_EXISTS", HttpStatus.SC_NOT_FOUND); res = restClient.rest(HttpMethod.GET, "/api/sessions/CUSTOM_SESSION_ID", null, HttpStatus.SC_OK, true, - "{'sessionId':'STR','createdAt':0,'mediaMode':'STR','recordingMode':'STR','defaultOutputMode':'STR','defaultRecordingLayout':'STR','customSessionId':'STR','connections':{'numberOfElements':2,'content'" + "{'sessionId':'STR','createdAt':0,'mediaMode':'STR','recordingMode':'STR','defaultOutputMode':'STR','defaultRecordingLayout':'STR','customSessionId':'STR','forcedVideoCodec':'STR','connections':{'numberOfElements':2,'content'" + ":[{'connectionId':'STR','createdAt':0,'location':'STR','platform':'STR','token':'STR','role':'STR','serverData':'STR','clientData':'STR','publishers':[" + "{'createdAt':0,'streamId':'STR','mediaOptions':{'hasAudio':false,'audioActive':false,'hasVideo':false,'videoActive':false,'typeOfVideo':'STR','frameRate':0," + "'videoDimensions':'STR','filter':{}}}],'subscribers':[{'createdAt':0,'streamId':'STR','publisher':'STR'}]},{'connectionId':'STR','createdAt':0,'location':'STR'," From f77644f213604242b4dec5394085ad4db1636e10 Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Mon, 7 Sep 2020 19:37:36 +0200 Subject: [PATCH 3/5] openvidu-test-e2e: fix allowTranscoding property GET response --- .../java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java index e6ce5822..f505cc48 100644 --- a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java +++ b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java @@ -2533,7 +2533,7 @@ public class OpenViduTestAppE2eTest { /** GET /api/sessions (after session created) **/ restClient.rest(HttpMethod.GET, "/api/sessions/CUSTOM_SESSION_ID", null, HttpStatus.SC_OK, true, - "{'sessionId':'STR','createdAt':0,'mediaMode':'STR','recordingMode':'STR','defaultOutputMode':'STR','defaultRecordingLayout':'STR','customSessionId':'STR','forcedVideoCodec':'STR','connections':{'numberOfElements':0,'content':[]},'recording':true}"); + "{'sessionId':'STR','createdAt':0,'mediaMode':'STR','recordingMode':'STR','defaultOutputMode':'STR','defaultRecordingLayout':'STR','customSessionId':'STR','forcedVideoCodec':'STR','allowTranscoding':false,'connections':{'numberOfElements':0,'content':[]},'recording':true}"); restClient.rest(HttpMethod.GET, "/api/sessions", null, HttpStatus.SC_OK, true, ImmutableMap.of("numberOfElements", new Integer(1), "content", new JsonArray())); @@ -2703,7 +2703,7 @@ public class OpenViduTestAppE2eTest { restClient.rest(HttpMethod.DELETE, "/api/sessions/CUSTOM_SESSION_ID/stream/NOT_EXISTS", HttpStatus.SC_NOT_FOUND); res = restClient.rest(HttpMethod.GET, "/api/sessions/CUSTOM_SESSION_ID", null, HttpStatus.SC_OK, true, - "{'sessionId':'STR','createdAt':0,'mediaMode':'STR','recordingMode':'STR','defaultOutputMode':'STR','defaultRecordingLayout':'STR','customSessionId':'STR','forcedVideoCodec':'STR','connections':{'numberOfElements':2,'content'" + "{'sessionId':'STR','createdAt':0,'mediaMode':'STR','recordingMode':'STR','defaultOutputMode':'STR','defaultRecordingLayout':'STR','customSessionId':'STR','forcedVideoCodec':'STR','allowTranscoding':false,'connections':{'numberOfElements':2,'content'" + ":[{'connectionId':'STR','createdAt':0,'location':'STR','platform':'STR','token':'STR','role':'STR','serverData':'STR','clientData':'STR','publishers':[" + "{'createdAt':0,'streamId':'STR','mediaOptions':{'hasAudio':false,'audioActive':false,'hasVideo':false,'videoActive':false,'typeOfVideo':'STR','frameRate':0," + "'videoDimensions':'STR','filter':{}}}],'subscribers':[{'createdAt':0,'streamId':'STR','publisher':'STR'}]},{'connectionId':'STR','createdAt':0,'location':'STR'," From 2fae62d6a27c828521f6074a3b0e76e4e1b9ab66 Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Mon, 7 Sep 2020 21:39:22 +0200 Subject: [PATCH 4/5] openvidu-test-e2e: fix --- .../openvidu/test/e2e/OpenViduTestAppE2eTest.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java index f505cc48..02e4a5d8 100644 --- a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java +++ b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java @@ -346,11 +346,20 @@ public class OpenViduTestAppE2eTest { final int numberOfVideos = user.getDriver().findElements(By.tagName("video")).size(); Assert.assertEquals("Expected 4 videos but found " + numberOfVideos, 4, numberOfVideos); - Assert.assertTrue("Videos were expected to only have video tracks", user.getEventManager().assertMediaTracks( - user.getDriver().findElements(By.cssSelector("#openvidu-instance-0 video")), false, true)); // TODO: subscriber should also have only video track + // Assert.assertTrue("Videos were expected to only have video tracks", user.getEventManager().assertMediaTracks(user.getDriver().findElements(By.tagName("video")), false, true)); + Assert.assertTrue("Videos were expected to only have video tracks", + user.getEventManager().assertMediaTracks( + user.getDriver().findElements(By.cssSelector("#openvidu-instance-0 video")).subList(0, 1), + false, true)); + Assert.assertTrue("Videos were expected to only have video track", + user.getEventManager().assertMediaTracks( + user.getDriver().findElements(By.cssSelector("#openvidu-instance-1 video")).subList(0, 1), + false, true)); Assert.assertTrue("Videos were expected to have only a video track", user.getEventManager().assertMediaTracks( - user.getDriver().findElements(By.cssSelector("#openvidu-instance-1 video")), true, true)); + user.getDriver().findElements(By.cssSelector("#openvidu-instance-0 video")).subList(1, 2), true, true)); + Assert.assertTrue("Videos were expected to have only a video track", user.getEventManager().assertMediaTracks( + user.getDriver().findElements(By.cssSelector("#openvidu-instance-1 video")).subList(1, 2), true, true)); gracefullyLeaveParticipants(2); } From 0b6041d2fab4748deffa2dd9f55e8882c6782f86 Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Mon, 7 Sep 2020 22:07:29 +0200 Subject: [PATCH 5/5] openvidu-server: do not munge SDP of IP cameras --- .../openvidu/server/kurento/core/KurentoSessionManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvidu-server/src/main/java/io/openvidu/server/kurento/core/KurentoSessionManager.java b/openvidu-server/src/main/java/io/openvidu/server/kurento/core/KurentoSessionManager.java index 27a7fd32..d5ee509c 100644 --- a/openvidu-server/src/main/java/io/openvidu/server/kurento/core/KurentoSessionManager.java +++ b/openvidu-server/src/main/java/io/openvidu/server/kurento/core/KurentoSessionManager.java @@ -374,8 +374,8 @@ public class KurentoSessionManager extends SessionManager { boolean isTranscodingAllowed = kSession.getSessionProperties().isTranscodingAllowed(); VideoCodec forcedVideoCodec = kSession.getSessionProperties().forcedVideoCodec(); - // Modify sdp if forced codec is defined - if (forcedVideoCodec != VideoCodec.NONE) { + // Modify sdp if forced codec is defined and this is not an IP camera + if (forcedVideoCodec != VideoCodec.NONE && !participant.isIpcam()) { String sdpOffer = kurentoOptions.sdpOffer; try { log.debug("PARTICIPANT '{}' in Session '{}' SDP Offer before munging: \n {}",