mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 12:32:29 +00:00
timecodestamper: Fix waiting for the first video frame in case of live video input
This commit is contained in:
parent
d7bb5b8a16
commit
bbdb392abe
1 changed files with 11 additions and 5 deletions
|
@ -1238,14 +1238,20 @@ gst_timecodestamper_transform_ip (GstBaseTransform * vfilter,
|
||||||
GstClockID clock_id;
|
GstClockID clock_id;
|
||||||
GstClockTime base_time =
|
GstClockTime base_time =
|
||||||
gst_element_get_base_time (GST_ELEMENT_CAST (timecodestamper));
|
gst_element_get_base_time (GST_ELEMENT_CAST (timecodestamper));
|
||||||
|
GstClockTime wait_time;
|
||||||
|
|
||||||
|
/* If we have no latency yet then wait at least 8 frames durations.
|
||||||
|
* See LATENCY query handling for details. */
|
||||||
|
if (timecodestamper->latency == GST_CLOCK_TIME_NONE) {
|
||||||
|
wait_time = base_time + running_time + 8 * frame_duration;
|
||||||
|
} else {
|
||||||
|
wait_time = base_time + running_time + timecodestamper->latency;
|
||||||
|
}
|
||||||
|
|
||||||
GST_TRACE_OBJECT (timecodestamper,
|
GST_TRACE_OBJECT (timecodestamper,
|
||||||
"Waiting for clock to reach %" GST_TIME_FORMAT,
|
"Waiting for clock to reach %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (base_time + running_time +
|
GST_TIME_ARGS (wait_time));
|
||||||
timecodestamper->latency));
|
clock_id = gst_clock_new_single_shot_id (clock, wait_time);
|
||||||
clock_id =
|
|
||||||
gst_clock_new_single_shot_id (clock,
|
|
||||||
base_time + running_time + timecodestamper->latency);
|
|
||||||
|
|
||||||
timecodestamper->video_clock_id = clock_id;
|
timecodestamper->video_clock_id = clock_id;
|
||||||
g_mutex_unlock (&timecodestamper->mutex);
|
g_mutex_unlock (&timecodestamper->mutex);
|
||||||
|
|
Loading…
Reference in a new issue