#define DEFAULT_VERBOSE_LOG false
#define DEFAULT_NICE_VERBOSE false
#define DEFAULT_JITTERBUFFER_LATENCY 200 /* ms */
+#define DEFAULT_BUNDLE_POLICY GST_WEBRTC_BUNDLE_POLICY_MAX_BUNDLE
/* categories */
#define INI_CATEGORY_GENERAL "general"
#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"
__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);
__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);
}
g_free(webrtcbin_name);
- g_object_set(G_OBJECT(webrtc->gst.webrtcbin), "bundle-policy", 3, NULL); /* 3 for max-bundle */
+ g_object_set(G_OBJECT(webrtc->gst.webrtcbin),
+ "bundle-policy", webrtc->ini.general.bundle_policy,
+ "latency", webrtc->ini.general.jitterbuffer_latency,
+ NULL);
if (webrtc->ini.general.stun_server) {
webrtc->stun_server_url = g_strdup(webrtc->ini.general.stun_server);
LOG_INFO("stun_server[%s]", webrtc->stun_server_url);
}
- g_object_set(G_OBJECT(webrtc->gst.webrtcbin), "latency", webrtc->ini.general.jitterbuffer_latency, NULL);
-
_connect_and_append_signal(&webrtc->signals, (GObject *)webrtc->gst.webrtcbin, "on-negotiation-needed", G_CALLBACK(__webrtcbin_on_negotiation_needed_cb), webrtc);
_connect_and_append_signal(&webrtc->signals, (GObject *)webrtc->gst.webrtcbin, "on-ice-candidate", G_CALLBACK(__webrtcbin_on_ice_candidate_cb), webrtc);
_connect_and_append_signal(&webrtc->signals, (GObject *)webrtc->gst.webrtcbin, "notify::connection-state", G_CALLBACK(__webrtcbin_peer_connection_state_cb), webrtc);