* additional extra size. */
#define DEFAULT_EXTRA_SIZE_BYTES 10 * 1024 * 1024 /* 10 MB */
#define DEFAULT_EXTRA_SIZE_BUFFERS 5
+#ifdef TIZEN_FEATURE_MQ_MODIFICATION_EXTRA_SIZE_TIME
+#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_WATERMARK 0.01
PROP_MAX_SIZE_BYTES,
PROP_MAX_SIZE_BUFFERS,
PROP_MAX_SIZE_TIME,
+#ifdef TIZEN_FEATURE_MQ_MODIFICATION
+ PROP_CURR_SIZE_BYTES,
+#endif
PROP_USE_BUFFERING,
PROP_LOW_PERCENT,
PROP_HIGH_PERCENT,
"Max. amount of data in the queue (in ns, 0=disable)", 0, G_MAXUINT64,
DEFAULT_MAX_SIZE_TIME, G_PARAM_READWRITE | GST_PARAM_MUTABLE_PLAYING |
G_PARAM_STATIC_STRINGS));
-
+#ifdef TIZEN_FEATURE_MQ_MODIFICATION
+ g_object_class_install_property (gobject_class, PROP_CURR_SIZE_BYTES,
+ g_param_spec_uint ("curr-size-bytes", "Current buffered size (kB)",
+ "buffered amount of data in the queue (bytes)", 0, G_MAXUINT,
+ 0, G_PARAM_READABLE | GST_PARAM_MUTABLE_PLAYING |
+ G_PARAM_STATIC_STRINGS));
+#endif
g_object_class_install_property (gobject_class, PROP_EXTRA_SIZE_BYTES,
g_param_spec_uint ("extra-size-bytes", "Extra Size (kB)",
"Amount of data the queues can grow if one of them is empty (bytes, 0=disable)"
}
}
+#ifdef TIZEN_FEATURE_MQ_MODIFICATION
+static guint
+get_current_size_bytes (GstMultiQueue * mq)
+{
+ GList *tmp;
+ guint current_size_bytes = 0;
+
+ for (tmp = mq->queues; tmp; tmp = g_list_next (tmp)) {
+ GstSingleQueue *sq = (GstSingleQueue *) tmp->data;
+ GstDataQueueSize size;
+
+ gst_data_queue_get_level (sq->queue, &size);
+
+ current_size_bytes += size.bytes;
+
+ GST_DEBUG_OBJECT (mq,
+ "queue %d: bytes %u/%u, time %" G_GUINT64_FORMAT "/%"
+ G_GUINT64_FORMAT, sq->id, size.bytes, sq->max_size.bytes,
+ sq->cur_time, sq->max_size.time);
+ }
+
+ GST_INFO_OBJECT (mq, "current_size_bytes : %u", current_size_bytes);
+
+ return current_size_bytes;
+}
+#endif
+
static void
gst_multi_queue_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
case PROP_MAX_SIZE_TIME:
g_value_set_uint64 (value, mq->max_size.time);
break;
+#ifdef TIZEN_FEATURE_MQ_MODIFICATION
+ case PROP_CURR_SIZE_BYTES:
+ g_value_set_uint (value, get_current_size_bytes(mq));
+ break;
+#endif
case PROP_USE_BUFFERING:
g_value_set_boolean (value, mq->use_buffering);
break;
break;
}
+#ifdef TIZEN_FEATURE_MQ_MODIFICATION
+ /* to stop buffering during playing state */
+ case GST_STATE_CHANGE_PAUSED_TO_PLAYING:{
+ GST_MULTI_QUEUE_MUTEX_LOCK (mqueue);
+ mqueue->buffering = FALSE;
+ GST_MULTI_QUEUE_MUTEX_UNLOCK (mqueue);
+ gst_multi_queue_post_buffering (mqueue);
+ break;
+ }
+#endif
case GST_STATE_CHANGE_PAUSED_TO_READY:{
GList *tmp;
gst_single_queue_flush (mq, sq, FALSE, FALSE);
gst_single_queue_start (mq, sq);
+#ifdef TIZEN_FEATURE_MQ_MODIFICATION
+ /* need to reset the buffering data after seeking */
+ GList *tmp;
+ tmp = mq->queues;
+ while (tmp) {
+ GstSingleQueue *q = (GstSingleQueue *) tmp->data;
+ if (q->flushing)
+ goto done;
+ tmp = g_list_next (tmp);
+ }
+ recheck_buffering_status (mq);
+#endif
goto done;
case GST_EVENT_SEGMENT:
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
res = gst_data_queue_push (sq->queue, (GstDataQueueItem *) item);
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
+#ifdef TIZEN_FEATURE_MQ_MODIFICATION
+ if (!res || sq->flushing) {
+ gst_multi_queue_item_destroy (item);
+ goto out_flushing;
+ }
+#else
if (!res || sq->flushing)
goto out_flushing;
+#endif
/* it might be that the query has been taken out of the queue
* while we were unlocked. So, we need to check if the last
* handled query is the same one than the one we just
#define IS_FILLED(q, format, value) (((q)->max_size.format) != 0 && \
((q)->max_size.format) <= (value))
+#ifdef TIZEN_FEATURE_MQ_MODIFICATION_EXTRA_SIZE_TIME
+#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
*/
return TRUE;
/* check time or bytes */
+#ifdef TIZEN_FEATURE_MQ_MODIFICATION_EXTRA_SIZE_TIME
+ res = IS_FILLED_EXTRA (sq, time, sq->cur_time) || IS_FILLED (sq, bytes, bytes);
+#else
res = IS_FILLED (sq, bytes, bytes);
+#endif
/* We only care about limits in time if we're not a sparse stream or
* we're not syncing by running time */
if (!sq->is_sparse || !mq->sync_by_running_time) {