playbin2 element time out from PAUSE to PLAYING state

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

playbin2 element time out from PAUSE to PLAYING state

smarky
Hello @ all, 
I am developing a media player class using qt on freescale's  imx515 processor and i am using playbin2 elent to create the pipeline. I am able to play/stop/pause amy video i want but the problem is that when i am letting a playlist loop for a long time (> 4Hours) in poll_for_state_change() : 

int CGStreamer::poll_for_state_change(GstState sRecState, GstElement * elem) 

    GTimeVal tfthen, tfnow; 
    GstClockTimeDiff diff; 
    GstStateChangeReturn result = GST_STATE_CHANGE_FAILURE; 
    GstState current; 
    guint32 timeescap = 0; 
    gchar *ele_name = gst_element_get_name(elem); 

    g_get_current_time(&tfthen); 
    result = gst_element_set_state(elem, sRecState); 

    if(result == GST_STATE_CHANGE_FAILURE) 
    { 
        if( NULL != ele_name ) 
        { 
            g_free(ele_name); 
        } 
        return -1; 
    } 

    while(1) 
    { 
        gst_element_get_state(elem, ¤t, NULL, GST_SECOND); 
        g_get_current_time(&tfnow); 
        diff = GST_TIMEVAL_TO_TIME(tfnow) - GST_TIMEVAL_TO_TIME(tfthen); 
        diff /= (1000 * 1000); 
        timeescap = (unsigned int) diff; 

        if( sRecState == current ) 
        { 
            break; 
        } 
        else 
        { 
            if (timeescap > 10000)      /* 10s */ 
            { 
                printf( "\n%s(): Element %s time out in state transferring from %s to %s\n", 
                    __FUNCTION__, ele_name, 
                    gst_element_state_get_name (current), 
                    gst_element_state_get_name (sRecState) ); 
                if( NULL != ele_name ) 
                { 
                    g_free(ele_name); 
                } 
                return -1; 
            } 
        } 
    } 

    if( NULL != ele_name ) 
    { 
        g_free(ele_name); 
    } 

    return 0; 


I get Element playbin20 time out in state transferring from PAUSE to PLAYING. 

Since i am new to the whole gstreamer environment i was really surprised to get a timeout since my application waits for EOS before any state change on the element. 
Have you any idea why this might happen ? 

Thanks in advance for your help. 

Best Regards, 

Stavros.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel