<div dir="ltr">Hi Sebastian,<div><br></div><div>I think I managed to do that.</div><div><br></div><div>That's my solution:</div><div><br></div><div>To set the start time, I do this:</div><div><div><span class="" style="white-space:pre"> </span>GstEvent *ev = gst_event_new_step(GST_FORMAT_TIME, startTimePosition, 1.0, TRUE, FALSE);</div>
</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 12, 2013 at 11:25 AM, Sebastian Dröge <span dir="ltr"><<a href="mailto:sebastian@centricular.com" target="_blank">sebastian@centricular.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mo, 2013-11-11 at 18:56 -0200, Marcus Nascimento wrote:<br>
> I'm working on a media platform and I have to implement a wrapper to<br>
> GStreamer that offers the following interface:<br>
><br>
> - SetStartTime: Set the start position (in time)<br>
> - SetEndTime: Set the end position (in time)<br>
> - SetStartFrame: Set the start position (in frames)<br>
> - SetEndFrame: Set the end position (in frames)<br>
> - SetStartSample: Set the start position (in samples)<br>
> - SetEndSample: Set the end position (in samples)<br>
> - AddTimeAlarm: A listener will be notified when a given time is reached.<br>
> - AddFrameAlarm: A listener will be notified when a given frame is reached.<br>
> - AddSampleAlarm: A listener will be notified when a given sample is<br>
> reached.<br>
><br>
> I'll never play streamming media nor remote media, but only local files.<br>
><br>
> The biggest problem up to now cames from the fact it is possible to set<br>
> Start/End position in time, and add frame alarms, for instance.<br>
><br>
> I'm using STEP events to set the start position. It is just a matter of<br>
> using gst_event_new_step passing the right parameters for that<br>
> (GST_FORMAT_TIME for time, GST_FORMAT_DEFAULT for samples and<br>
> GST_FORMAT_BUFFERS for frames).<br>
><br>
> In any case, I need to know which frame corresponds to the step destination.<br>
> To do that, I'm incrementing the frame counter everytime I receive a QOS<br>
> message durring the STEP execution. I do that until I receive a STEP_DONE<br>
> message. By that time, I know what is the current time and current frame.<br>
> It seems to work fine. Does anyone know if that is not correct?<br>
><br>
> After the STEP is complete, I'm using a pad probe (buffer probe) to keep<br>
> counting the frames.<br>
> This way, I can know for sure when a frame alarm has expired.<br>
><br>
> Strange thing is: When I set the StartFrame to 300, the corresponding time<br>
> is a little after 9s.<br>
> But, when I schedule an alarm to the same frame 300, the corresponding time<br>
> is around 7s.<br>
> It is very strange for me.<br>
><br>
> Can anyone help me understanding what's going on?<br>
<br>
</div></div>It would be useful to have some test case to explain what exactly you do<br>
how and to have a way to reproduce it. Also which file formats are you<br>
using and which GStreamer version on which platform? :)<br>
<br>
How do you get "the corresponding time" when you do StartFrame(300)? And<br>
how for the alarms? The alarms are counting the frames via a pad probe<br>
and you get the buffer timestamp from there?<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Sebastian Dröge <<a href="mailto:sebastian@centricular.com">sebastian@centricular.com</a>><br>
Centricular Ltd - <a href="http://www.centricular.com" target="_blank">http://www.centricular.com</a><br>
Expertise, Straight from the Source<br>
</font></span><br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Marcus Nascimento<br><br>
</div>