multiqueue: consider the extra time if there is spare buffer bytes 10/105810/1 accepted/tizen/3.0/common/20161221.181255 accepted/tizen/3.0/ivi/20161221.010944 accepted/tizen/3.0/mobile/20161221.011614 accepted/tizen/3.0/tv/20161221.010730 accepted/tizen/3.0/wearable/20161221.011103 submit/tizen_3.0/20161220.100802
authorEunhae Choi <eunhae1.choi@samsung.com>
Fri, 16 Dec 2016 07:29:43 +0000 (16:29 +0900)
committereunhae choi <eunhae1.choi@samsung.com>
Mon, 19 Dec 2016 13:07:37 +0000 (05:07 -0800)
Change-Id: I36817ba8b11cc08327c50cf0c9a14982e22be94f

plugins/elements/gstmultiqueue.c

index 425654c..8c9b024 100644 (file)
@@ -268,7 +268,11 @@ enum
  * aditional extra size. */
 #define DEFAULT_EXTRA_SIZE_BYTES 10 * 1024 * 1024       /* 10 MB */
 #define DEFAULT_EXTRA_SIZE_BUFFERS 5
+#ifdef TIZEN_FEATURE_MQ_MODIFICATION
+#define DEFAULT_EXTRA_SIZE_TIME 10 * GST_SECOND
+#else
 #define DEFAULT_EXTRA_SIZE_TIME 3 * GST_SECOND
+#endif
 
 #define DEFAULT_USE_BUFFERING FALSE
 #define DEFAULT_LOW_PERCENT   10
@@ -1354,7 +1358,7 @@ NEXT_STEP:
 
         GST_DEBUG_OBJECT (mq, "r_framerate is %d ", r_framerate);
 
-        remaining_frame = (mq->stream_duration - cur_position) * r_framerate / GST_SECOND - size.visible;       // packets num in video queue;     
+        remaining_frame = (mq->stream_duration - cur_position) * r_framerate / GST_SECOND - size.visible;       // packets num in video queue;
         instant_throughput = size.visible * GST_SECOND / elapsed_time;  // packets num / per seconds
         GST_DEBUG_OBJECT (mq, "remaining_fram is %d, instant_throughput is %d",
             remaining_frame, instant_throughput);
@@ -2654,6 +2658,10 @@ compute_high_time (GstMultiQueue * mq)
 #define IS_FILLED(q, format, value) (((q)->max_size.format) != 0 && \
      ((q)->max_size.format) <= (value))
 
+#ifdef TIZEN_FEATURE_MQ_MODIFICATION
+#define IS_FILLED_EXTRA(q, format, value) (((((q)->extra_size.format) != 0) || (((q)->max_size.format) != 0)) && \
+     (((q)->extra_size.format)+((q)->max_size.format)) <= (value))
+#endif
 /*
  * GstSingleQueue functions
  */
@@ -2787,8 +2795,11 @@ single_queue_check_full (GstDataQueue * dataq, guint visible, guint bytes,
     return TRUE;
 
   /* check time or bytes */
+#ifdef TIZEN_FEATURE_MQ_MODIFICATION
+  res = IS_FILLED_EXTRA (sq, time, sq->cur_time) || IS_FILLED (sq, bytes, bytes);
+#else
   res = IS_FILLED (sq, time, sq->cur_time) || IS_FILLED (sq, bytes, bytes);
-
+#endif
   return res;
 }