EOS not being received and processed.

Steve Cookson it at sca-uk.com
Tue Oct 30 07:05:03 PDT 2012


Hi Guys, 
I have a pipleine that looks like this: 
gst-launch -e v4l2src device=/dev/video0 queue-size=1 always-copy=0 !
videoscale ! videorate ! video/x-raw-yuv,framerate=30000/1001 ! \ 
ffmpegcolorspace ! tee name=t t. ! queue ! xvimagesink sync=false
force-aspect-ratio=true t. ! queue ! jpegenc quality=100 ! avimux ! \ 
filesink location=video.avi 
When I type ctl-c the file ends correctly and the duration is currectly
shown on the file.  
When my programme does the same thing (I'm using a modified version of
wxMediaCtrl), the duration is not properly shown (ie it shows duration = 0).
Other things like seek do not work properly either.  Here is the bit of code
that is supposed to send EOS (including debag stuff). 
Regards 
Steve 

//--------------------------------------------------------------------------
--- 
// wxGStreamerMediaBackend::Stop 
// 
// READY the stream and sets the position to 0. Note that this is 
// synchronous (!) READYing. 
// 
// Due to the mutex locking this is probably thread-safe actually. 
//--------------------------------------------------------------------------
--- 
bool wxGStreamerMediaBackend::Stop() 
{ 
    printf ("Stop\(\) triggered.\n"); 
    {   // begin state lock 
        wxMutexLocker lock(m_asynclock); 
        //if(gst_element_set_state (m_playbin, 
        //                          GST_STATE_PAUSED) == GST_STATE_FAILURE
|| 
        //  !SyncStateChange(m_playbin, GST_STATE_PAUSED)) 
        //{ 
        //    wxLogSysError(wxT("Could not set state to paused for
Stop()")); 
        //    return false; 
        //} 
        if(gst_element_set_state (m_playbin, 
                                  GST_STATE_READY) == GST_STATE_FAILURE || 
          !SyncStateChange(m_playbin, GST_STATE_READY)) 
        { 
            wxLogSysError(wxT("Could not set state to READY for Stop()")); 
            return false; 
        } 
     
    }   // end state lock 

    bool bSeekedOK = wxGStreamerMediaBackend::SetPosition(0); 

    if(!bSeekedOK) 
    { 
        wxLogSysError(wxT("Could not seek to initial position in Stop()")); 
        return false; 
    } 
    printf ("EOS being sent.\n"); 
    if(!gst_element_send_event(m_playbin, gst_event_new_eos())){ 
        printf ("EOS send failed.\n"); 
    } else { 
        printf ("EOS send succeded.\n"); 
    } 
    QueueStopEvent(); // Success 
    return true; 
} 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20121030/cb5e8ea2/attachment-0001.html>


More information about the gstreamer-devel mailing list