From 0f6f5b6bb99c366708bd05e33bc13fe40b25d955 Mon Sep 17 00:00:00 2001 From: Eunhae Choi Date: Fri, 16 Dec 2016 16:29:43 +0900 Subject: [PATCH] multiqueue: consider the extra time if there is spare buffer bytes Change-Id: I36817ba8b11cc08327c50cf0c9a14982e22be94f --- plugins/elements/gstmultiqueue.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index 425654c..8c9b024 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -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; } -- 2.7.4