<br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Riccardo Corona</b> <<a href="mailto:coronariccardo@gmail.com">coronariccardo@gmail.com</a>><br>Date: 30-mag-2007
13.28<br>Subject: Re: [gst-devel] Fakesrc signal handoff question<br>To: Tim Muller <<a href="mailto:t.i.m@zen.co.uk">t.i.m@zen.co.uk</a>><br><br></span>This's my testing pipeline :<br><br>..............................
<br>pipeline = gst_pipeline_new ("pipeline");<br> fakesrc = gst_element_factory_make ("fakesrc", "source");<br> decoder = gst_element_factory_make ("ffdec_mpeg4","mpeg4-decoder");
<br> videoscale = gst_element_factory_make ("videoscale", "scaling-video");<br> par = gst_element_factory_make ("capsfilter", "dimens");<br> videorate=gst_element_factory_make("videorate", "rateVideo");
<br><br> parFakesrc = gst_element_factory_make ("capsfilter", "fakeSrcType");<br><br> parDDSink = gst_element_factory_make ("capsfilter", "ddSinkSetup");<br><br> g_object_set (G_OBJECT(parFakesrc), "caps",
<br> gst_caps_new_simple ("video/mpeg",<br> "width", G_TYPE_INT, 720,<br> "height", G_TYPE_INT, 288,<br> "framerate",GST_TYPE_FRACTION,25,1,<br> "mpegversion",G_TYPE_INT,4,
<br> "systemstream",G_TYPE_BOOLEAN,false),<br> NULL);<br><br> g_object_set (G_OBJECT(par), "caps",<br> gst_caps_new_simple( "video/x-raw-yuv",<br> "width", G_TYPE_INT, 720,
<br> "height", G_TYPE_INT, 576,NULL),<br> NULL );<br><br> g_object_set (G_OBJECT (fakesrc),<br> "blocksize",40000,<br> "signal-handoffs", TRUE,<br> "sizemin", 0,
<br> "sizemax", 30000,<br> "sizetype", 3,<br> "datarate", 2000, <br> "filltype",2,<br> NULL);<br><br> g_object_set (G_OBJECT (videorate),<br>
"in", 0,
<br> "out", 25,<br> NULL);<br><br> g_object_set (G_OBJECT(parDDSink), "caps",<br> gst_caps_new_simple ("video/x-raw-rgb",<br> "width", G_TYPE_INT, 720,
<br> "height", G_TYPE_INT, 576,<br> "framerate",GST_TYPE_FRACTION,25,1),<br> NULL);<br><br> conv = gst_element_factory_make ("ffmpegcolorspace", "converter");
<br><br> videosink = gst_element_factory_make ("directdrawsink", "directdraw");<br><br> gst_bin_add_many (GST_BIN (pipeline),<br> fakesrc, parFakesrc, decoder,videoscale ,par,videorate, conv,parDDSink, videosink, NULL);
<br><br> gst_element_link_many (fakesrc,parFakesrc,decoder,videoscale, par,videorate, conv, parDDSink, videosink, NULL);<br><br><br>........................<br><br><br>Some of the pads are unusefull but I've leaved it...
<br>I can't find any pads or element properties to convert my time_t (<a name="112dcbe8594e1d2e_returnValueToggle">the time as seconds elapsed since midnight, January 1, 1970) to the TIME type that you are talking about.
<br>However I've tried the buffer allocation with GST_BUFFER_MALLOCDATA but nothing is changed.
<br>I don't believe that is possible to run my MFC application with GST_DEBUG output, or I was unable to find a way to do it.<br>I see that offset parameter of gst_buffer increments with the first packets from 0 to X, it sounds good but the offset_end have a different value (the ending byte of the offset, I assume), so I've tried to force this value to the offset one but nothing to do.
<br>I think that the problem is in timestamp value but I cannot find a way to escape from this hell...<br><br></a><br><br><br><br><div><span class="gmail_quote">2007/5/30, Tim Muller <<a href="mailto:t.i.m@zen.co.uk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
t.i.m@zen.co.uk
</a>>:</span><div><span class="q" id="q_112dcbe8594e1d2e_1"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Riccardo Corona <<a href="mailto:coronariccardo@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
coronariccardo@gmail.com
</a>> wrote :<br><br>Hi,<br><br>> Hi,during my test with gstreamer app for win32 I've used a fakesrc with<br>> an handoff function in which I obtain some mpeg4 fragment that is put into<br>> a gstbuffer. I've also used the right plugin to visualize the mpeg4 packet
<br>> on my directdraw sink.<br><br>Some more details about the pipeline used would probably be helpful.<br><br><br>> It works weel only for the first 2-3 packets received and then the refresh<br>> of the images stops and, if I run in debug mode, I can see that some thread
<br>> stop its execution but there isn't gstreamer thread. This is main part of<br>> may handoff:<br><br>> static void<br>> cb_handoff (GstElement *fakesrc, GstBuffer *buffer, GstPad *pad,<br>> gpointer user_data)
<br>> {<br>> MyClass* dlg=(MyClass*)user_data;<br>><br>> //fg_image is the object that contains the correct (I've checked it...)<br>> //mpeg4 fragment<br>> //dt contains the time of the fragment
<br>> //dlg->t is a struct tm that allows to obtain time_t<br>> ...<br>> buffer->timestamp = mktime(&dlg->t);//GST_CLOCK_TIME_NONE;<br><br>The timestamps you're creating, are they 0-based? (there may also be problems
<br>due to fakesrc sending a newsegment event in BYTES format, but the videosink<br>expecting a TIME format, so it depends on your pipeline setup if there's an<br>element that converts it to TIME Format or not).<br><br>
> //fg_image->pixel_ptr contains the mpeg4 image buffer<br>> gst_buffer_set_data(buffer,fg_image->pixel_ptr,fg_image->dimension);<br><br>Have you tried memcpy()'ing the data first, to make sure the data you're
<br>passing is not invalidated while it makes its way through the pipeline?<br>Maybe something like (this assumes you're getting passed empty buffers, which<br>may not be the case if you've set certain fakesrc properties):
<br><br> GST_BUFFER_MALLOCDATA(buffer) =<br> g_memdup (fg_image->pixel_ptr,fg_image->dimension);<br> GST_BUFFER_DATA(buffer) = GST_BUFFER_MALLOCDATA(buffer);<br> GST_BUFFER_SIZE(buffer) = fg_image->dimension;
<br><br><br>In case it's your handoff callback that stops being called, run your program with<br><br> GST_DEBUG=basesrc:5 yourapp<br><br>(or whatever the way to set an environment variable is on win32) to see why it stops/pauses (see 'flow' or 'reason').
<br><br> Cheers<br> -Tim<br><br><br><br><br><br></blockquote></span></div></div><br><br clear="all"><br>-- <br><span class="sg">Riccardo Corona
</span><br clear="all"><br>-- <br>Riccardo Corona