test: Add test case for webrtc_null_source_set_media_type() 45/314245/3
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 4 Jul 2024 08:15:51 +0000 (17:15 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 9 Jul 2024 08:15:11 +0000 (17:15 +0900)
[Version] 1.1.11
[Issue Type] Test application

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

index f6fa44d3eca891cf6774643226e4111fb4242283..f540cb697fbae7b0bb461a342e7760a065105c13 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    1.1.10
+Version:    1.1.11
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 5afdf00f2fb6eb16016099a4bdc2acb1bebe7e91..ebd6c5b941d2d8b9c259dd66a52275167266f5d8 100644 (file)
@@ -839,6 +839,15 @@ static void _webrtc_start_media_source(int index, unsigned int source_id)
        g_print("webrtc_start_media_source() success, source_id[%u]\n", source_id);
 }
 
+static void _webrtc_null_source_set_media_type(int index, unsigned int source_id, webrtc_media_type_e media_type)
+{
+       int ret = webrtc_null_source_set_media_type(g_ad.conns[index].webrtc, source_id, media_type);
+       RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret);
+
+       g_print("webrtc_null_source_set_media_type() success, source_id[%u], media_type[%s]\n",
+               source_id, g_webrtc_media_type_str[media_type]);
+}
+
 void _webrtc_set_display_type(int index, int type)
 {
        g_ad.conns[index].render.display_type = type;
@@ -3800,7 +3809,8 @@ static void test_webrtc_media_source(char *cmd)
                }
                break;
        }
-       case CURRENT_STATUS_MEDIA_SOURCE_GET_TRANSCEIVER_MID: {
+       case CURRENT_STATUS_MEDIA_SOURCE_GET_TRANSCEIVER_MID:
+       case CURRENT_STATUS_NULL_SOURCE_SET_MEDIA_TYPE: {
                static unsigned int id;
                static unsigned int media_type;
 
@@ -3811,7 +3821,10 @@ static void test_webrtc_media_source(char *cmd)
                        return;
                case 1:
                        media_type = value - 1;
-                       _webrtc_media_source_get_transceiver_mid(0, id, media_type);
+                       if (g_ad.menu_status == CURRENT_STATUS_MEDIA_SOURCE_GET_TRANSCEIVER_MID)
+                               _webrtc_media_source_get_transceiver_mid(0, id, media_type);
+                       else
+                               _webrtc_null_source_set_media_type(0, id, media_type);
                        id = media_type = 0;
                        g_ad.input_count = 0;
                        break;
index f07126371fee8272520d6df9e2885a6d72dec935..1401ad2529d87d17a960ea886277b7217017fb6b 100644 (file)
@@ -83,6 +83,7 @@ menu_info_s g_menu_infos[] = {
        { "te", CURRENT_STATUS_MEDIA_SOURCE_ACTIVE_TRANSCEIVER_ENCODING, true },
        { "tm", CURRENT_STATUS_MEDIA_SOURCE_GET_TRANSCEIVER_MID, true },
        { "ms", CURRENT_STATUS_START_MEDIA_SOURCE, true },
+       { "nsm", CURRENT_STATUS_NULL_SOURCE_SET_MEDIA_TYPE, true },
        /* webrtc media render */
        { "dt", CURRENT_STATUS_SET_DISPLAY_TYPE, true },
        { "dm", CURRENT_STATUS_SET_DISPLAY_MODE, true },
@@ -248,6 +249,7 @@ void display_menu_main(void)
        g_print("gc. Get transceiver codec\n");
        g_print("spt. *Set payload type\t");
        g_print("gpt. *Get payload type\n");
+       g_print("nsm. *Set media type to null source\t");
        g_print("pa. Set media path to file source\n");
        g_print("sfl. Set file source looping\t");
        g_print("gfl. Get file source looping\n");
@@ -370,6 +372,7 @@ void display_menu_webrtc_media_source(void)
        case CURRENT_STATUS_MEDIA_SOURCE_GET_TRANSCEIVER_DIRECTION:
        case CURRENT_STATUS_MEDIA_SOURCE_GET_TRANSCEIVER_CODEC:
        case CURRENT_STATUS_MEDIA_SOURCE_GET_TRANSCEIVER_MID:
+       case CURRENT_STATUS_NULL_SOURCE_SET_MEDIA_TYPE:
                if (get_appdata()->input_count == 0)
                        g_print("*** input source id.\n");
                else if (get_appdata()->input_count == 1)
index 6d7a35f5ffe4441bd3a714af751b47fe0f127dc4..80775e0d8c939569b7ade6abae01c526142a2c21 100644 (file)
@@ -122,6 +122,7 @@ enum {
        CURRENT_STATUS_MEDIA_SOURCE_ACTIVE_TRANSCEIVER_ENCODING = TEST_MENU_WEBRTC_MEDIA_SOURCE | 0x23,
        CURRENT_STATUS_MEDIA_SOURCE_GET_TRANSCEIVER_MID = TEST_MENU_WEBRTC_MEDIA_SOURCE | 0x24,
        CURRENT_STATUS_START_MEDIA_SOURCE = TEST_MENU_WEBRTC_MEDIA_SOURCE | 0x25,
+       CURRENT_STATUS_NULL_SOURCE_SET_MEDIA_TYPE = TEST_MENU_WEBRTC_MEDIA_SOURCE | 0x26,
        /* webrtc media render */
        CURRENT_STATUS_SET_DISPLAY_TYPE = TEST_MENU_WEBRTC_MEDIA_RENDER | 0x01,
        CURRENT_STATUS_SET_DISPLAY_MODE = TEST_MENU_WEBRTC_MEDIA_RENDER | 0x02,