From bf46d6a7a1abf12ae589e9caf92c1afed314e37f Mon Sep 17 00:00:00 2001 From: Eunhae Choi Date: Fri, 30 Nov 2018 14:05:49 +0900 Subject: [PATCH] queue2, multiqueue: remove dead code - sync with tv product code - mq: remove RVU related code which was deleted in product add missed tizen feature define - q2: enable public modification Change-Id: I382be3c3adf53c64533a6971beca28f62f7c31c8 --- configure.ac | 2 +- packaging/gstreamer.spec | 1 - plugins/elements/gstmultiqueue.c | 469 +-------------------------------------- plugins/elements/gstmultiqueue.h | 11 - plugins/elements/gstqueue2.c | 2 - 5 files changed, 7 insertions(+), 478 deletions(-) diff --git a/configure.ac b/configure.ac index 8b8ff7a..87e5ee2 100644 --- a/configure.ac +++ b/configure.ac @@ -915,7 +915,7 @@ dnl Check for tv-profile AC_ARG_ENABLE(tv-profile, AC_HELP_STRING([--enable-tv-profile], [using tv-profile]), [ case "${enableval}" in - yes) HAVE_TV_PROFILE="-DTIZEN_PROFILE_TV -DTIZEN_FEATURE_TRUSTZONE -DRVU_LIVESTREAMING_OPTIMIZATION" ;; + yes) HAVE_TV_PROFILE="-DTIZEN_PROFILE_TV -DTIZEN_FEATURE_TRUSTZONE" ;; no) HAVE_TV_PROFILE= ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-tv-profile) ;; esac diff --git a/packaging/gstreamer.spec b/packaging/gstreamer.spec index 6bd0e2b..15752a4 100644 --- a/packaging/gstreamer.spec +++ b/packaging/gstreamer.spec @@ -75,7 +75,6 @@ export CFLAGS="%{optflags} \ -DTIZEN_FEATURE_FAKESINK_MODIFICATION\ %if "%{tizen_profile_name}" == "tv" -DTIZEN_PROFILE_TV\ - -DRVU_LIVESTREAMING_OPTIMIZATION\ -DTIZEN_FEATURE_TRUSTZONE\ %endif -DTIZEN_FEATURE_RTSPSRC_MODIFICATION\ diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index d9270ac..38f1efa 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -109,16 +109,6 @@ */ typedef struct _GstSingleQueue GstSingleQueue; -#ifdef RVU_LIVESTREAMING_OPTIMIZATION -/*RVU patch*/ -enum -{ - SQ_VIDEO_STREAM = 0, - SQ_AUDIO_STREAM, - SQ_OTHER_STREAM -}; -#endif - struct _GstSingleQueue { /* unique identifier of the queue */ @@ -179,12 +169,6 @@ struct _GstSingleQueue /* For interleave calculation */ GThread *thread; - -#ifdef RVU_LIVESTREAMING_OPTIMIZATION -/*RVU patch : update buffering percent*/ - gint sq_stream_type; - GstClockTime cur_time_of_begin_buffering; -#endif }; @@ -202,10 +186,6 @@ struct _GstMultiQueueItem guint32 posid; gboolean is_query; -#ifdef RVU_LIVESTREAMING_OPTIMIZATION - /*RVU patch : for update single queue buffering percent*/ - GstSingleQueue *sq; -#endif }; static GstSingleQueue *gst_single_queue_new (GstMultiQueue * mqueue, guint id); @@ -225,12 +205,6 @@ static void gst_single_queue_flush_queue (GstSingleQueue * sq, gboolean full); static void calculate_interleave (GstMultiQueue * mq); -#ifdef RVU_LIVESTREAMING_OPTIMIZATION -/*RVU patch : work for get stream type to set single queue buffering params*/ -static void single_queue_set_stream_type (GstSingleQueue * squeue, - GstBuffer * buffer); -static void early_exit_buffering (GstMultiQueue * mq); -#endif static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink_%u", GST_PAD_SINK, @@ -305,20 +279,6 @@ enum PROP_USE_INTERLEAVE, PROP_UNLINKED_CACHE_TIME, PROP_MINIMUM_INTERLEAVE, -#ifdef RVU_LIVESTREAMING_OPTIMIZATION -/*RVU patch : buffering params*/ - PROP_MAX_AUDIO_SIZE_BYTES, - PROP_MAX_AUDIO_SIZE_BUFFERS, - PROP_MAX_AUDIO_SIZE_TIME, - PROP_MAX_VIDEO_SIZE_BYTES, - PROP_MAX_VIDEO_SIZE_BUFFERS, - PROP_MAX_VIDEO_SIZE_TIME, - PROP_ENABLE_BUFFERING_OPT, -/*RVU patch : rvu reset, disable audio buffering and adaptive buffering property*/ - PROP_RESET_FLAG, - PROP_DISABLE_AUDIO_BUFFERING, - PROP_BUFFERING_ENHANCEMENT, -#endif PROP_LAST }; @@ -656,59 +616,6 @@ gst_multi_queue_class_init (GstMultiQueueClass * klass) "Synchronize deactivated or not-linked streams by running time", DEFAULT_SYNC_BY_RUNNING_TIME, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); -#ifdef RVU_LIVESTREAMING_OPTIMIZATION -/*RVU patch : buffering params property*/ - g_object_class_install_property (gobject_class, PROP_MAX_AUDIO_SIZE_BYTES, - g_param_spec_uint ("max-size-audio-bytes", "Max. size (kB)", - "Max. amount of data in the audio queue (bytes, 0=disable)", 0, - G_MAXUINT, DEFAULT_MAX_SIZE_BYTES, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - g_object_class_install_property (gobject_class, PROP_MAX_AUDIO_SIZE_BUFFERS, - g_param_spec_uint ("max-size-audio-buffers", "Max. size (buffers)", - "Max. number of buffers in the audio queue (0=disable)", 0, G_MAXUINT, - DEFAULT_MAX_SIZE_BUFFERS, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - g_object_class_install_property (gobject_class, PROP_MAX_AUDIO_SIZE_TIME, - g_param_spec_uint64 ("max-size-audio-time", "Max. size (ns)", - "Max. amount of data in the audio queue (in ns, 0=disable)", 0, - G_MAXUINT64, DEFAULT_MAX_SIZE_TIME, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - g_object_class_install_property (gobject_class, PROP_MAX_VIDEO_SIZE_BYTES, - g_param_spec_uint ("max-size-video-bytes", "Max. size (kB)", - "Max. amount of data in the video queue (bytes, 0=disable)", - 0, G_MAXUINT, DEFAULT_MAX_SIZE_BYTES, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - g_object_class_install_property (gobject_class, PROP_MAX_VIDEO_SIZE_BUFFERS, - g_param_spec_uint ("max-size-video-buffers", "Max. size (buffers)", - "Max. number of buffers in the video queue (0=disable)", 0, G_MAXUINT, - DEFAULT_MAX_SIZE_BUFFERS, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - g_object_class_install_property (gobject_class, PROP_MAX_VIDEO_SIZE_TIME, - g_param_spec_uint64 ("max-size-video-time", "Max. size (ns)", - "Max. amount of data in the video queue (in ns, 0=disable)", 0, - G_MAXUINT64, DEFAULT_MAX_SIZE_TIME, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - g_object_class_install_property (gobject_class, PROP_ENABLE_BUFFERING_OPT, - g_param_spec_boolean ("enable-buffering-opt", - "make buffering optimize enable", - "enable to control the buffering queue size and time.", FALSE, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - -/*RVU patch : rvu reset, disable audio buffering and adaptive buffering property*/ - g_object_class_install_property (gobject_class, PROP_RESET_FLAG, - g_param_spec_int ("buffering-reset-flag", "reset flag", - "reset buffering flag", 0, 1, 0, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - g_object_class_install_property (gobject_class, PROP_DISABLE_AUDIO_BUFFERING, - g_param_spec_boolean ("disable-audio-buffering", - "disable audio stream buffering", "disable audio buffering solution", - FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - g_object_class_install_property (gobject_class, PROP_BUFFERING_ENHANCEMENT, - g_param_spec_boolean ("enhancement-buffering", "enhancement buffering solution", - "enhancement buffering solution", - FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); -#endif g_object_class_install_property (gobject_class, PROP_USE_INTERLEAVE, g_param_spec_boolean ("use-interleave", "Use interleave", @@ -771,21 +678,6 @@ gst_multi_queue_init (GstMultiQueue * mqueue) mqueue->counter = 1; mqueue->highid = -1; mqueue->high_time = GST_CLOCK_STIME_NONE; -#ifdef RVU_LIVESTREAMING_OPTIMIZATION -/*RVU patch : buffering params init*/ - mqueue->audio_max_size.bytes = DEFAULT_MAX_SIZE_BYTES; - mqueue->audio_max_size.visible = DEFAULT_MAX_SIZE_BUFFERS; - mqueue->audio_max_size.time = DEFAULT_MAX_SIZE_TIME; - mqueue->video_max_size.bytes = DEFAULT_MAX_SIZE_BYTES; - mqueue->video_max_size.visible = DEFAULT_MAX_SIZE_BUFFERS; - mqueue->video_max_size.time = DEFAULT_MAX_SIZE_TIME; - mqueue->buffering_start_time = 0; - mqueue->stream_duration = 0; -/*RVU patch : rvu reset flag, disable audio buffering flag and adaptive buffering flag*/ - mqueue->buffering_reset = FALSE; - mqueue->disable_audio_buffering = FALSE; - mqueue->enhancement_buffering = FALSE; -#endif g_mutex_init (&mqueue->qlock); g_mutex_init (&mqueue->buffering_post_lock); @@ -878,45 +770,6 @@ gst_multi_queue_set_property (GObject * object, guint prop_id, GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); gst_multi_queue_post_buffering (mq); break; -#ifdef RVU_LIVESTREAMING_OPTIMIZATION -/*RVU patch : buffering params property*/ - case PROP_MAX_AUDIO_SIZE_BYTES: - GST_MULTI_QUEUE_MUTEX_LOCK (mq); - mq->audio_max_size.bytes = g_value_get_uint (value); - SET_CHILD_PROPERTY (mq, bytes); - GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); - break; - case PROP_MAX_AUDIO_SIZE_BUFFERS: - GST_MULTI_QUEUE_MUTEX_LOCK (mq); - mq->audio_max_size.visible = g_value_get_uint (value); - SET_CHILD_PROPERTY (mq, visible); - GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); - break; - case PROP_MAX_AUDIO_SIZE_TIME: - GST_MULTI_QUEUE_MUTEX_LOCK (mq); - mq->audio_max_size.time = g_value_get_uint64 (value); - SET_CHILD_PROPERTY (mq, time); - GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); - break; - case PROP_MAX_VIDEO_SIZE_BYTES: - GST_MULTI_QUEUE_MUTEX_LOCK (mq); - mq->video_max_size.bytes = g_value_get_uint (value); - SET_CHILD_PROPERTY (mq, bytes); - GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); - break; - case PROP_MAX_VIDEO_SIZE_BUFFERS: - GST_MULTI_QUEUE_MUTEX_LOCK (mq); - mq->video_max_size.visible = g_value_get_uint (value); - SET_CHILD_PROPERTY (mq, visible); - GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); - break; - case PROP_MAX_VIDEO_SIZE_TIME: - GST_MULTI_QUEUE_MUTEX_LOCK (mq); - mq->video_max_size.time = g_value_get_uint64 (value); - SET_CHILD_PROPERTY (mq, time); - GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); - break; -#endif case PROP_EXTRA_SIZE_BYTES: mq->extra_size.bytes = g_value_get_uint (value); break; @@ -969,30 +822,6 @@ gst_multi_queue_set_property (GObject * object, guint prop_id, calculate_interleave (mq); GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); break; - -#ifdef RVU_LIVESTREAMING_OPTIMIZATION -/*RVU patch : rvu reset buffering, disable audio buffering and adaptive buffering property*/ - case PROP_RESET_FLAG: - mq->buffering = FALSE; - mq->percent = 0; - mq->buffering_reset = TRUE; - GST_DEBUG_OBJECT (mq, "MQ RESET FLAG!\n"); - break; - case PROP_DISABLE_AUDIO_BUFFERING: - { - mq->disable_audio_buffering = g_value_get_boolean (value); - GST_LOG_OBJECT (mq, "disable-audio-buffering %d\n", - mq->disable_audio_buffering); - } - break; - case PROP_BUFFERING_ENHANCEMENT: - { - mq->enhancement_buffering = g_value_get_boolean (value); - GST_LOG_OBJECT (mq, "mq->enhancement_buffering %d\n", - mq->enhancement_buffering); - } - break; -#endif default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1087,15 +916,6 @@ gst_multi_queue_get_property (GObject * object, guint prop_id, case PROP_MINIMUM_INTERLEAVE: g_value_set_uint64 (value, mq->min_interleave_time); break; -#ifdef RVU_LIVESTREAMING_OPTIMIZATION -/*RVU patch : rvu disable audio buffering and adaptive buffering property*/ - case PROP_DISABLE_AUDIO_BUFFERING: - g_value_set_boolean (value, mq->disable_audio_buffering); - break; - case PROP_BUFFERING_ENHANCEMENT: - g_value_set_boolean (value, mq->enhancement_buffering); - break; -#endif default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1370,28 +1190,12 @@ get_buffering_level (GstSingleQueue * sq) MAX_BUFFERING_LEVEL, sq->max_size.time); buffering_level = MAX (buffering_level, tmp); } -#ifdef RVU_LIVESTREAMING_OPTIMIZATION - /*RVU patch : rvu adaptive buffering */ - if (sq->mqueue->enhancement_buffering == TRUE) - GST_LOG_OBJECT (sq->mqueue, - "MULTIQUEUE ENHANCEMENT BUFFERING SOLUTION ENABLE!\n"); - - if (sq->mqueue->enhancement_buffering == FALSE) { - if (sq->max_size.bytes > 0) { - tmp = (size.bytes * 100) / sq->max_size.bytes; - percent = MAX (percent, tmp); - } - } else { - GST_LOG_OBJECT (sq->mqueue, "disable bytes buffering profile!\n"); - } -#else if (sq->max_size.bytes > 0) { tmp = gst_util_uint64_scale_int (size.bytes, MAX_BUFFERING_LEVEL, sq->max_size.bytes); buffering_level = MAX (buffering_level, tmp); } -#endif } return buffering_level; @@ -1402,70 +1206,10 @@ static void update_buffering (GstMultiQueue * mq, GstSingleQueue * sq) { gint buffering_level, percent; -#ifdef RVU_LIVESTREAMING_OPTIMIZATION - /*RVU patch : disable mq audio buffering solution */ - GstPad *audio_pad = NULL; - GstCaps *audio_caps = NULL; - GstStructure *audio_caps_str = NULL; - const char *audio_mime = NULL; - const char *audio_stream_type = NULL; -#endif /* nothing to dowhen we are not in buffering mode */ if (!mq->use_buffering) return; -#ifdef RVU_LIVESTREAMING_OPTIMIZATION - /*RVU patch : disable mq audio buffering solution */ - if ((sq != NULL) && (mq->disable_audio_buffering == TRUE)) { - GST_LOG_OBJECT (mq, "disable audio buffering solution start!\n"); - audio_pad = GST_PAD_PEER (sq->sinkpad); - audio_caps = gst_pad_get_current_caps (audio_pad); - if (NULL == audio_caps) { - GST_LOG_OBJECT (mq, "audio caps is null!\n"); - goto NEXT_STEP; - } - - audio_caps_str = gst_caps_get_structure (audio_caps, 0); - if (NULL == audio_caps_str) { - GST_LOG_OBJECT (mq, "audio caps string is NULL!\n"); - goto NEXT_STEP; - } - - audio_mime = gst_structure_get_name (audio_caps_str); - if (NULL == audio_mime) { - GST_LOG_OBJECT (mq, "audio caps string mime is NULL!\n"); - goto NEXT_STEP; - } - - GST_LOG_OBJECT (mq, "audio_mime:[%s]\n", audio_mime); - if (g_strrstr (audio_mime, "audio")) { - GST_LOG_OBJECT (mq, - "non-drm audio single queue!, skip audio buffering\n"); - goto LAST_POS; - } else if (g_strrstr (audio_mime, "drm")) { - audio_stream_type = - gst_structure_get_string (audio_caps_str, "stream-type"); - if (NULL == audio_stream_type) { - GST_LOG_OBJECT (mq, "drm audio single queue can not get stream-type\n"); - goto NEXT_STEP; - } - if (g_strrstr (audio_stream_type, "audio")) { - GST_LOG_OBJECT (mq, "drm audio single queue!, skip audio buffering!\n"); - goto LAST_POS; - } - } - GST_LOG_OBJECT (mq, "disable audio buffering solution end!\n"); - } - -NEXT_STEP: - if (audio_caps != NULL) { - GST_LOG_OBJECT (mq, - "audio caps release for disable audio buffering solution!\n"); - gst_caps_unref (audio_caps); - audio_caps = NULL; - } -#endif - buffering_level = get_buffering_level (sq); /* scale so that if buffering_level equals the high watermark, @@ -1479,29 +1223,10 @@ NEXT_STEP: if (buffering_level >= mq->high_watermark) { mq->buffering = FALSE; } -#ifdef RVU_LIVESTREAMING_OPTIMIZATION -/*RVU patch : rvu reset buffering */ - if (mq->buffering_reset) { - if (percent < mq->low_percent) { - mq->buffering = TRUE; - mq->percent = percent; - mq->percent_changed = TRUE; - } - } -#endif /* make sure it increases */ percent = MAX (mq->buffering_percent, percent); SET_PERCENT (mq, percent); -#ifdef RVU_LIVESTREAMING_OPTIMIZATION -/*RVU patch : adaptive buffering solution*/ - if (mq->enhancement_buffering == TRUE) { - if (percent >= mq->high_percent) { - mq->percent_changed = TRUE; - GST_LOG_OBJECT (mq, "MULTIQUEUE ENHANCEMENT BUFFERING!\n"); - } - } -#endif } else { GList *iter; gboolean is_buffering = TRUE; @@ -1521,109 +1246,6 @@ NEXT_STEP: SET_PERCENT (mq, percent); } } -#ifdef RVU_LIVESTREAMING_OPTIMIZATION -/*common update buffering */ -/*while starts buffering, need restore start time */ - if (mq->enable_buffering_opt) { - if (percent < mq->low_percent && mq->buffering == TRUE) { - struct timeval tv = { 0 }; - GList *iter = NULL; - gettimeofday (&tv, NULL); - - mq->buffering_start_time = - GST_SECOND * (guint64) tv.tv_sec + (guint64) tv.tv_usec * GST_USECOND; - /*update all single queue */ - for (iter = mq->queues; iter; iter = g_list_next (iter)) { - GstSingleQueue *oq = (GstSingleQueue *) iter->data; - oq->cur_time_of_begin_buffering = oq->cur_time; - } - GST_DEBUG_OBJECT (mq, - "update buffering start time, cur_time is : %" G_GUINT64_FORMAT, - sq->cur_time_of_begin_buffering); - } else if (mq->buffering == TRUE) { - struct timeval tv = { 0 }; - gettimeofday (&tv, NULL); - GstClockTime buffering_duration = sq->cur_time; - guint64 tmp_time = - GST_SECOND * (guint64) tv.tv_sec + (guint64) tv.tv_usec * GST_USECOND; - guint64 elapsed_time = 0; - - /*caculate elapsed time */ - tmp_time -= mq->buffering_start_time; - elapsed_time = tmp_time; - /*buffering percentage increase until its src pad is blocked, */ - if (sq->cur_time > sq->cur_time_of_begin_buffering) - buffering_duration = sq->cur_time - sq->cur_time_of_begin_buffering; - - GST_DEBUG_OBJECT (mq, - "%s, elapsed time is: %" G_GUINT64_FORMAT " cur_time is: %" - G_GUINT64_FORMAT, sq->sq_stream_type == SQ_VIDEO_STREAM ? "vq" : "aq", - elapsed_time, buffering_duration); - tmp_time /= GST_SECOND; - - /*demuxer speed is lower than decoder */ - if (tmp_time > 0 && (tmp_time % 3 == 0) - && buffering_duration < elapsed_time - && sq->sq_stream_type == SQ_VIDEO_STREAM) { - GstFormat format = GST_FORMAT_TIME; - guint64 cur_position = sq->srctime; - GstCaps *video_caps = NULL; - GstStructure *caps_structure = NULL; - gint rnum = 0, rdenom = 1; - gint r_framerate = 0, remaining_frame = 0, instant_throughput = - 0, estimated_video_frame_count = 0; - GstDataQueueSize size; - - if (cur_position <= 0 || mq->stream_duration <= 0) { - GST_DEBUG_OBJECT (mq, "no duration or position"); - return; - } - gst_data_queue_get_level (sq->queue, &size); - - video_caps = gst_pad_get_current_caps (sq->sinkpad); - GST_DEBUG_OBJECT (mq, "stream caps: %" GST_PTR_FORMAT, video_caps); - - if (video_caps != NULL) { - caps_structure = gst_caps_get_structure (video_caps, 0); - - if (caps_structure != NULL) - gst_structure_get_fraction (caps_structure, "r_framerate", &rnum, - &rdenom); - - gst_caps_unref (video_caps); - } - - else - return; - - if (rdenom != 0) - r_framerate = rnum / rdenom; - - 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; - 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); - if (remaining_frame != 0) - estimated_video_frame_count = - (int) ((remaining_frame * r_framerate) / (r_framerate + - instant_throughput)); - } - } - } -#endif -#ifdef TIZEN_PROFILE_TV -/*RVU patch : rvu case disable audio buffering */ - return; -LAST_POS: - if (audio_caps != NULL) { - gst_caps_unref (audio_caps); - audio_caps = NULL; - } - GST_LOG_OBJECT (mq, "DISABLE AUDIO BUFFERING MESSAGE HANDLE!\n"); - return; -#endif } static void @@ -2192,18 +1814,7 @@ next: if (sq->flushing) goto out_flushing; -#ifdef RVU_LIVESTREAMING_OPTIMIZATION - if (mq->stream_duration == 0) { - GstPad *peer = NULL; - peer = gst_pad_get_peer (sq->sinkpad); - if (peer) { - if (!gst_pad_query_duration (peer, GST_FORMAT_TIME, - &(mq->stream_duration))) - GST_WARNING_OBJECT (mq, "Could not query upstream length!"); - gst_object_unref (peer); - } - } -#endif + /* Get something from the queue, blocking until that happens, or we get * flushed */ if (!(gst_data_queue_pop (sq->queue, &sitem))) @@ -2487,70 +2098,6 @@ out_flushing: } } -#ifdef RVU_LIVESTREAMING_OPTIMIZATION -/*RVU patch : set buffering params*/ -static void -single_queue_set_stream_type (GstSingleQueue * squeue, GstBuffer * buffer) -{ - if (squeue->sq_stream_type == -1 && buffer) { - GstCaps *buffer_caps = NULL; - GstStructure *caps_str = NULL; - const gchar *mime_type = NULL; - const gchar *drm_stream_type = NULL; - struct timeval tv = { 0 }; - - do { - buffer_caps = gst_pad_get_current_caps (squeue->sinkpad); //GST_BUFFER_CAPS(buffer); - if (NULL == buffer_caps) { - GST_DEBUG_OBJECT (squeue->mqueue, "cannot get caps from single queue."); - break; - } - - GST_DEBUG_OBJECT (squeue->mqueue, "single queue caps %" GST_PTR_FORMAT, - buffer_caps); - - caps_str = gst_caps_get_structure (buffer_caps, 0); - if (NULL == caps_str) { - GST_DEBUG_OBJECT (squeue->mqueue, "cannot get structure from capse."); - break; - } - - mime_type = gst_structure_get_name (caps_str); - if (NULL == mime_type) { - GST_DEBUG_OBJECT (squeue->mqueue, - "cannot get mimetype from structure."); - break; - } - - drm_stream_type = gst_structure_get_string (caps_str, "stream-type"); - - if (g_strrstr (mime_type, "video/") || (drm_stream_type - && g_strrstr (drm_stream_type, "video/"))) { - squeue->sq_stream_type = SQ_VIDEO_STREAM; - /*subtitle stream */ - if (g_strrstr (mime_type, "video/x-dvb-subpicture")) - squeue->sq_stream_type = SQ_OTHER_STREAM; - - gettimeofday (&tv, NULL); - if (squeue->mqueue->buffering_start_time == 0) - squeue->mqueue->buffering_start_time = - GST_SECOND * (guint64) tv.tv_sec + - (guint64) tv.tv_usec * GST_USECOND; - } else if (g_strrstr (mime_type, "audio/") || (drm_stream_type - && g_strrstr (drm_stream_type, "audio/"))) { - squeue->sq_stream_type = SQ_AUDIO_STREAM; - gettimeofday (&tv, NULL); - if (squeue->mqueue->buffering_start_time == 0) - squeue->mqueue->buffering_start_time = - GST_SECOND * (guint64) tv.tv_sec + - (guint64) tv.tv_usec * GST_USECOND; - } else { - squeue->sq_stream_type = SQ_OTHER_STREAM; - } - } while (0); - } -} -#endif /** * gst_multi_queue_chain: * @@ -2570,11 +2117,6 @@ gst_multi_queue_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) sq = gst_pad_get_element_private (pad); mq = sq->mqueue; -#ifdef RVU_LIVESTREAMING_OPTIMIZATION - if (mq->enable_buffering_opt) { - single_queue_set_stream_type (sq, buffer); - } -#endif /* if eos, we are always full, so avoid hanging incoming indefinitely */ if (sq->is_eos) goto was_eos; @@ -2921,8 +2463,12 @@ gst_multi_queue_sink_query (GstPad * pad, GstObject * parent, GstQuery * query) GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); res = gst_data_queue_push (sq->queue, (GstDataQueueItem *) item); GST_MULTI_QUEUE_MUTEX_LOCK (mq); - if (!res || sq->flushing) + if (!res || sq->flushing) { +#ifdef TIZEN_FEATURE_MQ_MODIFICATION + gst_multi_queue_item_destroy (item); +#endif goto out_flushing; + } /* 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 @@ -3503,9 +3049,6 @@ gst_single_queue_new (GstMultiQueue * mqueue, guint id) sq->sink_tainted = TRUE; sq->src_tainted = TRUE; -#ifdef TIZEN_FEATURE_TRUSTZONE - sq->sq_stream_type = -1; -#endif name = g_strdup_printf ("sink_%u", sq->id); templ = gst_static_pad_template_get (&sinktemplate); sq->sinkpad = g_object_new (GST_TYPE_MULTIQUEUE_PAD, "name", name, diff --git a/plugins/elements/gstmultiqueue.h b/plugins/elements/gstmultiqueue.h index d207c18..524fcf9 100644 --- a/plugins/elements/gstmultiqueue.h +++ b/plugins/elements/gstmultiqueue.h @@ -87,17 +87,6 @@ struct _GstMultiQueue { GstClockTimeDiff last_interleave_update; GstClockTime unlinked_cache_time; - -#ifdef RVU_LIVESTREAMING_OPTIMIZATION - /*RVU patch - reset functionality & buffering optimization*/ - gboolean enable_buffering_opt; - guint64 buffering_start_time; - guint64 stream_duration; - GstDataQueueSize video_max_size, audio_max_size; - gboolean buffering_reset; - gboolean disable_audio_buffering; - gboolean enhancement_buffering; -#endif }; struct _GstMultiQueueClass { diff --git a/plugins/elements/gstqueue2.c b/plugins/elements/gstqueue2.c index 3c543a6..03c2613 100644 --- a/plugins/elements/gstqueue2.c +++ b/plugins/elements/gstqueue2.c @@ -3513,7 +3513,6 @@ gst_queue2_handle_src_query (GstPad * pad, GstObject * parent, GstQuery * query) gst_query_parse_scheduling (query, &flags, NULL, NULL, NULL); #ifdef TIZEN_FEATURE_QUEUE2_MODIFICATION -#ifndef TIZEN_PROFILE_TV if (!(flags & GST_SCHEDULING_FLAG_SEEKABLE)) { GST_DEBUG_OBJECT(queue, "peer can support only push mode"); gst_query_set_scheduling (query, flags, 0, -1, 0); @@ -3521,7 +3520,6 @@ gst_queue2_handle_src_query (GstPad * pad, GstObject * parent, GstQuery * query) break; } #endif -#endif GST_DEBUG_OBJECT(queue, "peer can support pull mode"); /* we can operate in pull mode when we are using a tempfile */ -- 2.7.4