webrtc_test: Fix bug of room join test 07/265607/5
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 25 Oct 2021 06:13:58 +0000 (15:13 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 26 Oct 2021 03:57:15 +0000 (12:57 +0900)
In case of room scenario, when a remote peer is joining the room
where the first handle has already joined, new webrtc handle uses
same media sources that the first handle is using.

[Version] 0.2.140
[Issue Type] Bug fix

Change-Id: Ifa9ecea9b01a35370d871a8277668cba4b64083c
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-webrtc.spec
test/webrtc_test.c

index 907b43a99010fc45ee17394d4699379d77e22af8..cee0194deb29bd7d53a04f3570686731019b5b5f 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.2.139
+Version:    0.2.140
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 50e978e1c843df6115d8d1c652dac3553dfc99bd..44d9d0060401af52fbf6aa39be9ef70aabdd7507 100644 (file)
@@ -3362,6 +3362,8 @@ static void __auto_configure_add_peer(gchar *peer_id, bool is_offer)
                g_conns[i].remote_peer_id = atoi((const char *)peer_id);
                g_conns[i].is_for_room = true;
                g_conns[i].is_offer = is_offer;
+               if (i > 0) /* follow the source type of the first one */
+                       g_conns[i].room_source_type = g_conns[0].room_source_type;
 
                _webrtc_create(i);
                _webrtc_set_error_cb(i);
@@ -3372,14 +3374,16 @@ static void __auto_configure_add_peer(gchar *peer_id, bool is_offer)
 
                switch (g_conns[i].room_source_type) {
                case 1:
-                       _webrtc_add_media_source(i, WEBRTC_MEDIA_SOURCE_TYPE_VIDEOTEST + 1, &source_id);
-                       _webrtc_media_source_set_video_loopback(i, source_id);
                        _webrtc_add_media_source(i, WEBRTC_MEDIA_SOURCE_TYPE_AUDIOTEST + 1, NULL);
+                       _webrtc_add_media_source(i, WEBRTC_MEDIA_SOURCE_TYPE_VIDEOTEST + 1, &source_id);
+                       if (i == 0) /* only set loopback video of the first one */
+                               _webrtc_media_source_set_video_loopback(i, source_id);
                        break;
                case 2:
-                       _webrtc_add_media_source(i, WEBRTC_MEDIA_SOURCE_TYPE_CAMERA + 1, &source_id);
-                       _webrtc_media_source_set_video_loopback(i, source_id);
                        _webrtc_add_media_source(i, WEBRTC_MEDIA_SOURCE_TYPE_MIC + 1, NULL);
+                       _webrtc_add_media_source(i, WEBRTC_MEDIA_SOURCE_TYPE_CAMERA + 1, &source_id);
+                       if (i == 0) /* only set loopback video of the first one */
+                               _webrtc_media_source_set_video_loopback(i, source_id);
                        break;
                default:
                        return;