From: Eunhye Choi Date: Thu, 4 Feb 2021 11:20:08 +0000 (+0900) Subject: queue2: resolve buffering issue X-Git-Tag: accepted/tizen/unified/20210208.134758^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=01226cb2c8b15f74739d17b6120c02fb55b60721;p=platform%2Fupstream%2Fgstreamer.git queue2: resolve buffering issue set seek threshold based on the in_rate value to reduce the seek request which make slow the data receiving by additional http server connection. Change-Id: Id64200028761704c6019f5d42e6fe49547dad6a0 --- diff --git a/packaging/gstreamer.spec b/packaging/gstreamer.spec index e69582c..2aa3181 100644 --- a/packaging/gstreamer.spec +++ b/packaging/gstreamer.spec @@ -2,7 +2,7 @@ Name: gstreamer Version: 1.16.2 -Release: 3 +Release: 4 Summary: Streaming-Media Framework Runtime License: LGPL-2.0+ Group: Multimedia/Framework @@ -75,6 +75,7 @@ export CFLAGS="%{optflags} \ -DTIZEN_FEATURE_FAKESINK_MODIFICATION\ -DTIZEN_FEATURE_INPUT_SELECTOR_MODIFICATION\ -DTIZEN_FEATURE_UPSTREAM\ + -DTIZEN_FEATURE_SEEK_THRESHOLD\ %if "%{tizen_profile_name}" == "tv" -DTIZEN_PROFILE_TV\ -DTIZEN_FEATURE_TRUSTZONE\ diff --git a/plugins/elements/gstqueue2.c b/plugins/elements/gstqueue2.c index b2c22c7..950bef0 100644 --- a/plugins/elements/gstqueue2.c +++ b/plugins/elements/gstqueue2.c @@ -1421,6 +1421,18 @@ get_seek_threshold (GstQueue2 * queue) /* FIXME, find a good threshold based on the incoming rate. */ threshold = 1024 * 512; +#ifdef TIZEN_FEATURE_SEEK_THRESHOLD + guint64 seek_thresholds[] = + {(1.5*1024*1024), (1*1024*1024), (512*1024), (256*1024)}; + + for (int i = 0 ; i < G_N_ELEMENTS(seek_thresholds) ; i++) { + if (seek_thresholds[i] < (guint64)queue->byte_in_rate) { + threshold = seek_thresholds[i]; + break; + } + } +#endif + if (QUEUE_IS_USING_RING_BUFFER (queue)) { threshold = MIN (threshold, QUEUE_MAX_BYTES (queue) - queue->cur_level.bytes);