From: Sangchul Lee Date: Thu, 23 Dec 2021 07:07:21 +0000 (+0900) Subject: webrtc_ini: Add new item to set bundle policy and apply it X-Git-Tag: submit/tizen/20211229.072812~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=abca093b1c2cb6ed2749dc28e662430630369612;p=platform%2Fcore%2Fapi%2Fwebrtc.git webrtc_ini: Add new item to set bundle policy and apply it [general] ; SDP bundle policy (0:none, 1:balanced, 2:max compat, 3:max bundle) bundle policy = 3 Note that 1 and 2 are not supported yet. [Version] 0.3.31 [Issue Type] Improvement Change-Id: I47f72ad12d21399727a398ea74da7e452b5a71ec Signed-off-by: Sangchul Lee --- diff --git a/include/webrtc_private.h b/include/webrtc_private.h index 67c5fd64..038639e0 100644 --- a/include/webrtc_private.h +++ b/include/webrtc_private.h @@ -295,6 +295,7 @@ typedef struct _ini_item_general_s { gchar **gst_excluded_elements; const char *stun_server; int jitterbuffer_latency; + int bundle_policy; } ini_item_general_s; typedef struct _ini_item_media_source_s { diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index 3621e85c..8bb7fcf1 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.3.30 +Version: 0.3.31 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/webrtc_ini.c b/src/webrtc_ini.c index 844c5d09..8e486552 100644 --- a/src/webrtc_ini.c +++ b/src/webrtc_ini.c @@ -27,6 +27,7 @@ bool g_verbose = false; #define DEFAULT_NICE_VERBOSE false #define DEFAULT_NETWORK_SIMULATOR false #define DEFAULT_JITTERBUFFER_LATENCY 200 /* ms */ +#define DEFAULT_BUNDLE_POLICY GST_WEBRTC_BUNDLE_POLICY_MAX_BUNDLE /* categories */ #define INI_CATEGORY_GENERAL "general" @@ -55,6 +56,7 @@ bool g_verbose = false; #define INI_ITEM_GST_EXCLUDED_ELEMENTS "gstreamer excluded elements" #define INI_ITEM_STUN_SERVER "stun server" #define INI_ITEM_RTP_JITTERBUFFER_LATENCY "rtp jitterbuffer latency" +#define INI_ITEM_BUNDLE_POLICY "bundle policy" /* items for media source */ #define INI_ITEM_SOURCE_ELEMENT "source element" @@ -224,6 +226,7 @@ static void __dump_ini(webrtc_ini_s *ini) __dump_item(INI_ITEM_GST_EXCLUDED_ELEMENTS, INI_ITEM_TYPE_STRINGS, ini->general.gst_excluded_elements); __dump_item(INI_ITEM_STUN_SERVER, INI_ITEM_TYPE_STRING, (void *)ini->general.stun_server); __dump_item(INI_ITEM_RTP_JITTERBUFFER_LATENCY, INI_ITEM_TYPE_INT, &ini->general.jitterbuffer_latency); + __dump_item(INI_ITEM_BUNDLE_POLICY, INI_ITEM_TYPE_INT, &ini->general.bundle_policy); LOG_INFO("[%s]", INI_CATEGORY_MEDIA_SOURCE); __dump_items_of_source(&ini->media_source); @@ -467,6 +470,7 @@ int _load_ini(webrtc_s *webrtc) __ini_read_list(ini->dict, INI_CATEGORY_GENERAL, INI_ITEM_GST_EXCLUDED_ELEMENTS, &ini->general.gst_excluded_elements); ini->general.stun_server = __ini_get_string(ini->dict, INI_CATEGORY_GENERAL, INI_ITEM_STUN_SERVER, NULL); ini->general.jitterbuffer_latency = __ini_get_int(ini->dict, INI_CATEGORY_GENERAL, INI_ITEM_RTP_JITTERBUFFER_LATENCY, DEFAULT_JITTERBUFFER_LATENCY); + ini->general.bundle_policy = __ini_get_int(ini->dict, INI_CATEGORY_GENERAL, INI_ITEM_BUNDLE_POLICY, DEFAULT_BUNDLE_POLICY); /* default setting for a media source */ __apply_media_source_setting(ini, &ini->media_source, INI_CATEGORY_MEDIA_SOURCE); diff --git a/src/webrtc_private.c b/src/webrtc_private.c index a0cc5328..7ca08716 100644 --- a/src/webrtc_private.c +++ b/src/webrtc_private.c @@ -1469,7 +1469,7 @@ int _gst_build_pipeline(webrtc_s *webrtc) g_free(webrtcbin_name); g_object_set(G_OBJECT(webrtc->gst.webrtcbin), - "bundle-policy", 3, /* 3 for max-bundle */ + "bundle-policy", webrtc->ini.general.bundle_policy, "latency", webrtc->ini.general.jitterbuffer_latency, "netsim", webrtc->ini.general.network_simulator, NULL);