EOS not being received and processed.

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

EOS not being received and processed.

it
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;
}



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