mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-17 22:06:41 +00:00
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.
This commit is contained in:
parent
7f27b81e05
commit
d2e309d341
1 changed files with 14 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue