[ITC][webrtc][non-ACR] Remove unused variables and add some logs 03/268603/2
authorSangchul Lee <sc11.lee@samsung.com>
Wed, 10 Nov 2021 08:01:48 +0000 (17:01 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 28 Dec 2021 05:09:52 +0000 (14:09 +0900)
Change-Id: Id0f5d1ae62b430db4049a7c1164bf434af4f57ce
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
(cherry picked from commit 2066615bebfaaadbe5f33e6f100522c603a05193)

src/itc/webrtc/ITs-webrtc-common.h
src/itc/webrtc/ITs-webrtc.c

index 48d882c5ff8dc2822fb97bb6c5eaaa4167179523..7344704940a55aff94ef6138198119bb55d6a50d 100755 (executable)
 #define RUN_POLLING_LOOP {\
        if(g_bCallbackCalled == false)\
        {\
+               int nTimeoutId;\
                g_pMainLoop = g_main_loop_new(NULL, false);\
-               g_nTimeoutId = g_timeout_add(TIMEOUT_CB, Timeout, g_pMainLoop);\
+               nTimeoutId = g_timeout_add(TIMEOUT_CB, Timeout, g_pMainLoop);\
+               dlog_print(DLOG_DEBUG, "NativeTCT", "[%s(%d)] call g_main_loop_run(), g_pMainLoop[%p]", __FUNCTION__, __LINE__, g_pMainLoop);\
                g_main_loop_run(g_pMainLoop);\
-               g_source_remove(g_nTimeoutId);\
+               g_source_remove(nTimeoutId);\
                g_pMainLoop = NULL;\
        }\
 }
@@ -62,7 +64,6 @@
 }
 bool g_bWebRTCCreation;
 webrtc_h g_hWebRtcHandle;
-int g_nTimeoutId;
 static GMainLoop *g_pMainLoop = NULL;
 bool g_bCallbackCalled;
 gboolean Timeout(gpointer data);
index bf14e48c0ec659617f79dba299fbf83a36cceeab..8780448564b61b67db17f7752554b14bcf5ef04c 100755 (executable)
@@ -69,6 +69,7 @@ static void webrtcSessionDescriptionCreatedCB(webrtc_h webrtc, const char *descr
        FPRINTF("[Line : %d][%s] Callback webrtcSessionDescriptionCreatedCB called\\n", __LINE__, API_NAMESPACE);
        if (g_pMainLoop)
        {
+               dlog_print(DLOG_DEBUG, "NativeTCT", "[%s(%d)] call g_main_loop_quit(), g_pMainLoop[%p]", __FUNCTION__, __LINE__, g_pMainLoop);
                g_main_loop_quit(g_pMainLoop);
                g_pMainLoop = NULL;
        }
@@ -105,6 +106,7 @@ static void webrtcStateChangedCB(webrtc_h webrtc, webrtc_state_e previous, webrt
        FPRINTF("[Line : %d][%s] Callback webrtcStateChangedCB called\\n", __LINE__, API_NAMESPACE);
        if (g_pMainLoop)
        {
+               dlog_print(DLOG_DEBUG, "NativeTCT", "[%s(%d)] call g_main_loop_quit(), g_pMainLoop[%p]", __FUNCTION__, __LINE__, g_pMainLoop);
                g_main_loop_quit(g_pMainLoop);
                g_pMainLoop = NULL;
        }
@@ -121,6 +123,7 @@ static void webrtcSignalingStateChangeCB(webrtc_h webrtc, webrtc_signaling_state
        FPRINTF("[Line : %d][%s] Callback webrtcSignalingStateChangeCB called\\n", __LINE__, API_NAMESPACE);
        if (g_pMainLoop)
        {
+               dlog_print(DLOG_DEBUG, "NativeTCT", "[%s(%d)] call g_main_loop_quit(), g_pMainLoop[%p]", __FUNCTION__, __LINE__, g_pMainLoop);
                g_main_loop_quit(g_pMainLoop);
                g_pMainLoop = NULL;
        }
@@ -257,7 +260,6 @@ int ITc_webrtc_start_stop_p(void)
        START_TEST;
 
        g_bCallbackCalled = false;
-       int nTimeoutId = -1;
 
        int nRet = webrtc_set_ice_candidate_cb(g_hWebRtcHandle, webrtcIceCandidateCB, NULL);
        PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_set_ice_candidate_cb", WebRtcGetError(nRet));
@@ -922,7 +924,6 @@ int ITc_media_webrtc_create_offer_answer_p(void)
        char *pszOffer, *pszAnswer;
        webrtc_h hLocalWebRtcHandle,hWebRtcHandle;
        g_bCallbackCalled = false;
-       int nTimeoutId = -1;
 
        int nRet = webrtc_create(&hWebRtcHandle);
        PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_create", WebRtcGetError(nRet));
@@ -1027,7 +1028,6 @@ int ITc_media_webrtc_set_local_description_p(void)
        unsigned int nId;
        char *pszOffer;
        g_bCallbackCalled = false;
-       int nTimeoutId = -1;
 
        int nRet = webrtc_add_media_source(g_hWebRtcHandle, WEBRTC_MEDIA_SOURCE_TYPE_AUDIOTEST, &nId);
        PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_add_media_source", WebRtcGetError(nRet));
@@ -1081,7 +1081,6 @@ int ITc_media_webrtc_set_remote_description_p(void)
 {
        START_TEST;
        g_bCallbackCalled = false;
-       int nTimeoutId = -1;
        webrtc_h hLocalWebRtcHandle;
        unsigned int nId;
        char *pszOffer;
@@ -1163,7 +1162,6 @@ int ITc_media_webrtc_add_ice_candidate_p(void)
 {
        START_TEST;
        g_bCallbackCalled = false;
-       int nTimeoutId = -1;
 
        int nRet = webrtc_set_ice_candidate_cb(g_hWebRtcHandle, webrtcIceCandidateCB, NULL);
        PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_set_ice_candidate_cb", WebRtcGetError(nRet));
@@ -1386,7 +1384,6 @@ int ITc_media_webrtc_create_offer_async_p(void)
        char *pszOffer, *pszAnswer;
        webrtc_h hLocalWebRtcHandle;
        g_bCallbackCalled = false;
-       int nTimeoutId = -1;
 
        int nRet = webrtc_add_media_source(g_hWebRtcHandle, WEBRTC_MEDIA_SOURCE_TYPE_CAMERA, &nId);
        if (nRet == WEBRTC_ERROR_NOT_SUPPORTED) {
@@ -1448,7 +1445,6 @@ int ITc_media_webrtc_create_answer_async_p(void)
        char *pszOffer, *pszAnswer;
        webrtc_h hLocalWebRtcHandle, hWebRtcHandle;
        g_bCallbackCalled = false;
-       int nTimeoutId = -1;
 
        int nRet = webrtc_add_media_source(g_hWebRtcHandle, WEBRTC_MEDIA_SOURCE_TYPE_AUDIOTEST, &nId);
        PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_add_media_source", WebRtcGetError(nRet));
@@ -1549,7 +1545,6 @@ int ITc_media_webrtc_media_source_set_audio_loopback_p(void)
        unsigned int nId;
        sound_stream_info_h hStreamInfo;
        g_bCallbackCalled = false;
-       int nTimeoutId = -1;
 
        createWindow();
        int nRet = webrtc_add_media_source(g_hWebRtcHandle, WEBRTC_MEDIA_SOURCE_TYPE_AUDIOTEST, &nId);
@@ -1608,7 +1603,6 @@ int ITc_media_webrtc_media_source_set_video_loopback_p(void)
        unsigned int nId;
        sound_stream_info_h hStreamInfo;
        g_bCallbackCalled = false;
-       int nTimeoutId = -1;
 
        createWindow();
        int nRet = webrtc_add_media_source(g_hWebRtcHandle, WEBRTC_MEDIA_SOURCE_TYPE_VIDEOTEST, &nId);
@@ -1661,7 +1655,6 @@ int ITc_media_webrtc_set_get_display_mode_p(void)
        unsigned int nId,nTrackId;
        sound_stream_info_h hStreamInfo;
        g_bCallbackCalled = false;
-       int nTimeoutId = -1;
        webrtc_display_mode_e eMode;
 
        createWindow();
@@ -1721,7 +1714,6 @@ int ITc_media_webrtc_set_get_display_visible_p(void)
        unsigned int nId,nTrackId;
        sound_stream_info_h hStreamInfo;
        g_bCallbackCalled = false;
-       int nTimeoutId = -1;
        webrtc_display_mode_e eMode;
        bool bGetVisible, bSetVisible = false;