summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-01-13 17:44:17 +0100
committerSebastian Dröge <sebastian@centricular.com>2015-01-13 17:44:17 +0100
commitd2e309d3412131ee7b7bcb32063fcd5cce26eef9 (patch)
treef1bb21c3f2ccfd3ecbb0a0e1537f9ead3ab78a8d /sys
parent7f27b81e05e7b56eaee7bae7bfa90184063a1f33 (diff)
decklinkvideosink: Get our own "start time" instead of the one of the pipeline
decklinkvideosink might be added later to the pipeline, or its state might be handled separately from the pipeline. In which case the running time when we (last) went into PLAYING state will be different from the pipeline's. However we need our own start time to tell the Decklink API, which running time should be displayed at the moment we go to PLAYING and start scheduled rendering.
Diffstat (limited to 'sys')
-rw-r--r--sys/decklink/gstdecklinkvideosink.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/decklink/gstdecklinkvideosink.cpp b/sys/decklink/gstdecklinkvideosink.cpp
index 72e3b5add..62f19a1b2 100644
--- a/sys/decklink/gstdecklinkvideosink.cpp
+++ b/sys/decklink/gstdecklinkvideosink.cpp
@@ -537,9 +537,15 @@ gst_decklink_video_sink_change_state (GstElement * element,
gst_clock_set_master (self->output->clock, NULL);
break;
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:{
- GstClockTime start_time = gst_element_get_start_time (element);
+ GstClockTime start_time;
HRESULT res;
+ // FIXME: start time is the same for the complete pipeline,
+ // but what we need here is the start time of this element!
+ start_time = gst_element_get_base_time (element);
+ if (start_time != GST_CLOCK_TIME_NONE)
+ start_time = gst_clock_get_time (GST_ELEMENT_CLOCK (self)) - start_time;
+
// FIXME: This will probably not work
if (start_time == GST_CLOCK_TIME_NONE)
start_time = 0;
@@ -563,9 +569,15 @@ gst_decklink_video_sink_change_state (GstElement * element,
break;
}
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:{
- GstClockTime start_time = gst_element_get_start_time (element);
+ GstClockTime start_time;
HRESULT res;
+ // FIXME: start time is the same for the complete pipeline,
+ // but what we need here is the start time of this element!
+ start_time = gst_element_get_base_time (element);
+ if (start_time != GST_CLOCK_TIME_NONE)
+ start_time = gst_clock_get_time (GST_ELEMENT_CLOCK (self)) - start_time;
+
// FIXME: This will probably not work
if (start_time == GST_CLOCK_TIME_NONE)
start_time = 0;