__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;
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)),
#define DEFAULT_PCM_OUT_SAMPLERATE 44100
#define DEFAULT_PCM_OUT_CHANNEL 2
+#define MQ_UNLINKED_CACHE_TIME (500 * GST_MSECOND)
+
/*---------------------------------------------------------------------------
| LOCAL CONSTANT DEFINITIONS: |
---------------------------------------------------------------------------*/
}
} 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;