queue2: resolve buffering issue 01/253101/5 accepted/tizen/unified/20210208.134758 submit/tizen/20210205.064935
authorEunhye Choi <eunhae1.choi@samsung.com>
Thu, 4 Feb 2021 11:20:08 +0000 (20:20 +0900)
committerEunhye Choi <eunhae1.choi@samsung.com>
Fri, 5 Feb 2021 03:39:08 +0000 (12:39 +0900)
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
plugins/elements/gstqueue2.c

index e69582c..2aa3181 100644 (file)
@@ -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\
index b2c22c7..950bef0 100644 (file)
@@ -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);