[0.6.289] Fix not-linked error during prepare 28/300628/2 accepted/tizen/unified/20231031.163523
authorEunhye Choi <eunhae1.choi@samsung.com>
Mon, 30 Oct 2023 07:31:58 +0000 (16:31 +0900)
committerEunhye Choi <eunhae1.choi@samsung.com>
Mon, 30 Oct 2023 07:37:36 +0000 (16:37 +0900)
- if sync-by-running-time is true on mq, it can push data
  to srcpad which is not linked yet.
- enlarge the mq unlinked cache size to avoid not-linked error.
- set the property at app instead of urisourcebin inside.
  : abandoned ee91eeab8a86e769759eb678dcd3df08a3fdae27

Change-Id: I01fc84076d629356c207dd78c900bb85441a7d9b

packaging/libmm-player.spec
src/mm_player_gst.c
src/mm_player_priv.c

index 8d7e461..aab3ada 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.6.288
+Version:    0.6.289
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index c240c25..ec3a3b7 100644 (file)
@@ -1573,7 +1573,6 @@ static void
 __mmplayer_gst_handle_state_message(mmplayer_t *player, GstMessage *msg)
 {
        mmplayer_gst_element_t *mainbin;
-       const GValue *voldstate, *vnewstate, *vpending;
        GstState oldstate = GST_STATE_NULL;
        GstState newstate = GST_STATE_NULL;
        GstState pending = GST_STATE_NULL;
@@ -1587,20 +1586,7 @@ __mmplayer_gst_handle_state_message(mmplayer_t *player, GstMessage *msg)
        if (msg->src != (GstObject *)mainbin[MMPLAYER_M_PIPE].gst)
                return;
 
-       /* get state info from msg */
-       voldstate = gst_structure_get_value(gst_message_get_structure(msg), "old-state");
-       vnewstate = gst_structure_get_value(gst_message_get_structure(msg), "new-state");
-       vpending = gst_structure_get_value(gst_message_get_structure(msg), "pending-state");
-
-       if (!voldstate || !vnewstate) {
-               LOGE("received msg has wrong format.");
-               return;
-       }
-
-       oldstate = (GstState)voldstate->data[0].v_int;
-       newstate = (GstState)vnewstate->data[0].v_int;
-       if (vpending)
-               pending = (GstState)vpending->data[0].v_int;
+       gst_message_parse_state_changed(msg, &oldstate, &newstate, &pending);
 
        LOGD("state changed [%s] : %s ---> %s     final : %s",
                GST_OBJECT_NAME(GST_MESSAGE_SRC(msg)),
index aadaca9..1004e50 100644 (file)
 #define DEFAULT_PCM_OUT_SAMPLERATE     44100
 #define DEFAULT_PCM_OUT_CHANNEL        2
 
+#define MQ_UNLINKED_CACHE_TIME         (500 * GST_MSECOND)
+
 /*---------------------------------------------------------------------------
 |    LOCAL CONSTANT DEFINITIONS:                                                                                       |
 ---------------------------------------------------------------------------*/
@@ -7891,8 +7893,15 @@ _mmplayer_gst_element_added(GstBin *bin, GstElement *element, gpointer data)
                }
        } else if ((player->pipeline->mainbin[MMPLAYER_M_DEMUX].gst) &&
                (g_strrstr(GST_ELEMENT_NAME(element), "multiqueue"))) {
+
                LOGD("plugged element is multiqueue. take it %s", GST_ELEMENT_NAME(element));
 
+               /* set mq unlinked cache size to avoid not-linked error */
+               gboolean sync_by_running_time = FALSE;
+               g_object_get(G_OBJECT(element), "sync-by-running-time", &sync_by_running_time, NULL);
+               if (sync_by_running_time)
+                       g_object_set(G_OBJECT(element), "unlinked-cache-time", MQ_UNLINKED_CACHE_TIME, NULL);
+
                player->pipeline->mainbin[MMPLAYER_M_DEMUXED_S_BUFFER].id = MMPLAYER_M_DEMUXED_S_BUFFER;
                player->pipeline->mainbin[MMPLAYER_M_DEMUXED_S_BUFFER].gst = element;