<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19298"></HEAD>
<BODY>
<DIV dir=ltr align=left>Hi Guys, </DIV>
<DIV> </DIV>
<DIV>I have a pipleine that looks like this: </DIV>
<DIV> </DIV>
<DIV>gst-launch -e v4l2src device=/dev/video0 queue-size=1 always-copy=0 !
videoscale ! videorate ! video/x-raw-yuv,framerate=30000/1001 ! \
<BR>ffmpegcolorspace ! tee name=t t. ! queue ! xvimagesink sync=false
force-aspect-ratio=true t. ! queue ! jpegenc quality=100 ! avimux ! \
<BR>filesink location=video.avi </DIV>
<DIV> </DIV>
<DIV>When I type ctl-c the file ends correctly and the duration is currectly
shown on the file. </DIV>
<DIV> </DIV>
<DIV>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). </DIV>
<DIV> </DIV>
<DIV>Regards </DIV>
<DIV> </DIV>
<DIV>Steve </DIV>
<DIV> </DIV>
<DIV><BR>//-----------------------------------------------------------------------------
<BR>// wxGStreamerMediaBackend::Stop <BR>// <BR>// READY the stream and sets the
position to 0. Note that this is <BR>// synchronous (!) READYing. <BR>// <BR>//
Due to the mutex locking this is probably thread-safe actually.
<BR>//-----------------------------------------------------------------------------
<BR>bool wxGStreamerMediaBackend::Stop() <BR>{ <BR> printf
("Stop\(\) triggered.\n"); <BR> { // begin state
lock <BR> wxMutexLocker
lock(m_asynclock); <BR>
//if(gst_element_set_state (m_playbin,
<BR>
//
GST_STATE_PAUSED) == GST_STATE_FAILURE ||
<BR> //
!SyncStateChange(m_playbin, GST_STATE_PAUSED))
<BR> //{
<BR> //
wxLogSysError(wxT("Could not set state to paused for Stop()"));
<BR> // return
false; <BR> //}
<BR> if(gst_element_set_state
(m_playbin,
<BR>
GST_STATE_READY) == GST_STATE_FAILURE ||
<BR>
!SyncStateChange(m_playbin, GST_STATE_READY))
<BR> {
<BR>
wxLogSysError(wxT("Could not set state to READY for Stop()"));
<BR> return
false; <BR> } <BR>
<BR> } // end state lock
<BR><BR> bool bSeekedOK =
wxGStreamerMediaBackend::SetPosition(0); <BR><BR>
if(!bSeekedOK) <BR> {
<BR> wxLogSysError(wxT("Could not seek
to initial position in Stop()")); <BR>
return false; <BR> } <BR> printf ("EOS being
sent.\n"); <BR> if(!gst_element_send_event(m_playbin,
gst_event_new_eos())){ <BR> printf
("EOS send failed.\n"); <BR> } else {
<BR> printf ("EOS send succeded.\n");
<BR> } <BR> QueueStopEvent(); // Success
<BR> return true; <BR>} <BR><BR><BR></DIV></BODY></HTML>