mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 10:25:33 +00:00
videotestsrc: set DTS and PTS, sync on DTS
This commit is contained in:
parent
136a3fd37f
commit
044afd72eb
1 changed files with 3 additions and 2 deletions
|
@ -748,7 +748,7 @@ gst_video_test_src_get_times (GstBaseSrc * basesrc, GstBuffer * buffer,
|
||||||
{
|
{
|
||||||
/* for live sources, sync on the timestamp of the buffer */
|
/* for live sources, sync on the timestamp of the buffer */
|
||||||
if (gst_base_src_is_live (basesrc)) {
|
if (gst_base_src_is_live (basesrc)) {
|
||||||
GstClockTime timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
GstClockTime timestamp = GST_BUFFER_DTS (buffer);
|
||||||
|
|
||||||
if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
|
if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
|
||||||
/* get duration to calculate end time */
|
/* get duration to calculate end time */
|
||||||
|
@ -830,7 +830,8 @@ gst_video_test_src_fill (GstPushSrc * psrc, GstBuffer * buffer)
|
||||||
|
|
||||||
gst_video_frame_unmap (&frame);
|
gst_video_frame_unmap (&frame);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (buffer) = src->timestamp_offset + src->running_time;
|
GST_BUFFER_DTS (buffer) = src->timestamp_offset + src->running_time;
|
||||||
|
GST_BUFFER_PTS (buffer) = GST_BUFFER_DTS (buffer);
|
||||||
GST_BUFFER_OFFSET (buffer) = src->n_frames;
|
GST_BUFFER_OFFSET (buffer) = src->n_frames;
|
||||||
src->n_frames++;
|
src->n_frames++;
|
||||||
GST_BUFFER_OFFSET_END (buffer) = src->n_frames;
|
GST_BUFFER_OFFSET_END (buffer) = src->n_frames;
|
||||||
|
|
Loading…
Reference in a new issue