From 01226cb2c8b15f74739d17b6120c02fb55b60721 Mon Sep 17 00:00:00 2001 From: Eunhye Choi Date: Thu, 4 Feb 2021 20:20:08 +0900 Subject: [PATCH] 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 --- packaging/gstreamer.spec | 3 ++- plugins/elements/gstqueue2.c | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) 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); -- 2.7.4