Pipeline preroll problem

Duchassin Frederic duchassin at sefram.fr
Fri Apr 19 09:04:37 UTC 2019


Hello,

This is a code snippets of my application :

// Firstly, i link my scanning branch :

      /* CreateGstreamer element */
       m_pQueueTsParse = gst_element_factory_make("queue", "queueTsParse");
       g_object_set(G_OBJECT(m_pQueueTsParse), "max-size-buffers", 
(guint)0, NULL);
       g_object_set(G_OBJECT(m_pQueueTsParse), "max-size-bytes", 
(guint)0, NULL);
       g_object_set(G_OBJECT(m_pQueueTsParse), "max-size-time", 
(guint64)0, NULL);

       m_pTsparse = gst_element_factory_make("tsparse", "tsparse");
       m_pFakesink = gst_element_factory_make("fakesink", "fakesink");
       g_object_set(G_OBJECT(m_pFakesink), "async", false, NULL);

       /*add gstelement to pipeline bin*/
       gst_bin_add_many(GST_BIN(m_pPipeline), m_pQueueTsParse, 
m_pTsparse, m_pFakesink, NULL);

       /*link element*/
       gst_element_link_many(m_pTee, m_pQueueTsParse, m_pTsparse, 
m_pFakesink, NULL);

// Secondly, i link my playing branch :

       m_pDecodebin = gst_element_factory_make("decodebin", "decodebin1");
       g_object_set(G_OBJECT(m_pDecodebin), "max-size-buffers", (guint) 
0, NULL);
       g_object_set(G_OBJECT(m_pDecodebin), "max-size-bytes", (guint) 
100000000, NULL);
       g_object_set(G_OBJECT(m_pDecodebin), "max-size-time", (guint64) 
0, NULL);

       m_pVideoqueue = gst_element_factory_make("queue", "queueVideo");
       m_pVideosink = gst_element_factory_make("kmssink", "kmssink1");
       g_object_set(G_OBJECT(m_pVideosink), "max-lateness", (gint64) 
200000000, NULL);
       //m_pVideosink = gst_element_factory_make("waylandsink", 
"waylandsink1");

       m_pAudioqueue = gst_element_factory_make("queue", "queueAudio");
       g_object_set(G_OBJECT(m_pAudioqueue), "max-size-time", (guint64) 
10000000000, NULL);
       g_object_set(G_OBJECT(m_pAudioqueue), "max-size-buffers", 
(guint64) 2000, NULL);

       m_pAudioConvert = gst_element_factory_make("audioconvert", 
"audioconvert1");
       m_pAudiosink = gst_element_factory_make("alsasink", "alsasink1");

       //CB for dynamic link
       g_signal_connect (m_pDecodebin, "autoplug-select", G_CALLBACK 
(cb_autoplug_select_decodebin), this);
       g_signal_connect (m_pDecodebin, "pad-added", G_CALLBACK 
(cb_new_pad_decodebin), this);
       g_signal_connect (m_pDecodebin, "element-added", G_CALLBACK 
(cb_element_added_decodebin), this);
       g_signal_connect (m_pDecodebin, "autoplug-continue", G_CALLBACK 
(cb_autoplug_continue_decodebin), this);

       /*add gstelement to pipeline bin*/
       gst_bin_add_many(GST_BIN(m_pPipeline), m_pDecodebin, 
m_pVideoqueue, m_pVideosink, m_pAudioqueue, m_pAudioConvert, 
m_pAudiosink, NULL);

       /*link element*/
       gst_element_link_many(m_pTee, m_pDecodebin, NULL);
       gst_element_link_many(m_pVideoqueue, m_pVideosink, NULL);
       gst_element_link_many(m_pAudioqueue, m_pAudioConvert, 
m_pAudiosink, NULL);


// And finally, i play the pipeline :

      gst_element_set_state(m_pPipeline, GST_STATE_PLAYING);


--> as a result, my pipeline is blocked in prerolling state.....and i 
don't really understand why.

But If i link my scan branch after the playing branch, it magically works !

Is somebody could explain me why ?


BR

Frédéric




More information about the gstreamer-devel mailing list