Merge branch 'mediasoup' of github.com:OpenVidu/openvidu into mediasoup

pull/600/head
cruizba 2020-09-08 12:32:33 +02:00
commit 16bdf6cd88
3 changed files with 43 additions and 15 deletions

View File

@ -376,8 +376,8 @@ public class KurentoSessionManager extends SessionManager {
log.debug("PARTICIPANT '{}' in Session '{}' publishing SDP before munging: \n {}",
participant.getParticipantPublicId(), kSession.getSessionId(), kurentoOptions.sdpOffer);
// 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 {
kurentoOptions.sdpOffer = this.sdpMunging.setCodecPreference(forcedVideoCodec, sdpOffer);

View File

@ -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

View File

@ -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,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.tagName("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-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);
}
@ -801,8 +816,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 +1838,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 +1995,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 +2542,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','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()));
@ -2688,7 +2712,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','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',"