From: Sangchul Lee Date: Mon, 25 Oct 2021 06:13:58 +0000 (+0900) Subject: webrtc_test: Fix bug of room join test X-Git-Tag: submit/tizen/20211028.055213~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28ffe452dbe427b2d98cff5b9b2c00669b0c7d3e;p=platform%2Fcore%2Fapi%2Fwebrtc.git webrtc_test: Fix bug of room join test 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 --- diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index 907b43a9..cee0194d 100644 --- a/packaging/capi-media-webrtc.spec +++ b/packaging/capi-media-webrtc.spec @@ -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 diff --git a/test/webrtc_test.c b/test/webrtc_test.c index 50e978e1..44d9d006 100644 --- a/test/webrtc_test.c +++ b/test/webrtc_test.c @@ -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;