Question about preroll and DVR element

Martin Kelly mkelly at xevo.com
Wed Feb 20 20:46:39 UTC 2019


Hi,

I have a question regarding the exact mechanics of preroll in regards to 
an element I'm working on. I'm writing a DVR element that records a 
circular buffer and outputs a portion of that buffer on demand via a 
signal. It's working correctly except for one issue: In a non-live 
pipeline that requires preroll, the preroll buffer is being added onto 
the first clip that gets generated. This makes sense but causes issues 
for the element. For instance, you might see the following:

Clip requested (timestamps 0:10 to 0:15 seconds).

Normally this should result in a 5 second clip, with the first clip 
buffer being near 0:10 seconds.

Instead, we see the following:

preroll buffer (0:033 or similar), then buffers at 0:10 to 0:15 seconds).

If you save this clip as a file, you get a stall at the beginning of the 
file because the first buffer is much earlier than the second, and this 
comes across as a gap in playback.

Other than the sink somehow knowing about this and dropping the first 
buffer, is there a clean way to handle this case?

Thanks,
Martin


More information about the gstreamer-devel mailing list