|
I have a Gstreamer video source element, which is mostly live - i.e. reading video frames from a camera, and outputting them on the Gstreamer pipeline. So normally, it uses the Gstreamer pipeline-clock, and just starts with the first frame at time 0, second 33ms later etc.
However, in a certain setup, when the Gstreamer pipeline stops, there are already some video frames cached in memory (with timestamps in the past), which need sending out on the Gstreamer pipeline, before it continues as normal sending video frames live from its start time. The frames in the past should be sent out instantaneously (i.e. shouldn't hold up sending out the live frames); and all frames should be timestamped correctly - e.g. with 33ms between each frame.
The issue I'm encountering is that the DTS/PTS timestamps are GstClockTime which is unsigned - so I can't use negative timestamps to represent times in the past.
What is the correct way to handle this? Should I be using a different clock from the pipeline clock, i.e. one for which 'zero' is a long time in the past? Do I need to create my own GstClock instance to do this? Or are there standard approaches for achieving?
Thanks,
Lawrence
|