mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-21 21:46:22 +00:00
decklinkvideosink: Remove late frame-dropping workaround for basesink bug
This was fixed by https://bugzilla.gnome.org/show_bug.cgi?id=749258 in basesink, and is not necessary to duplicate here anymore.
This commit is contained in:
parent
4796cef882
commit
e3aaff400a
2 changed files with 0 additions and 44 deletions
|
@ -417,7 +417,6 @@ gst_decklink_video_sink_prepare (GstBaseSink * bsink, GstBuffer * buffer)
|
|||
GstClockTime timestamp, duration;
|
||||
GstClockTime running_time, running_time_duration;
|
||||
gint i;
|
||||
GstClock *clock;
|
||||
|
||||
GST_DEBUG_OBJECT (self, "Preparing buffer %p", buffer);
|
||||
|
||||
|
@ -440,47 +439,6 @@ gst_decklink_video_sink_prepare (GstBaseSink * bsink, GstBuffer * buffer)
|
|||
gst_segment_to_running_time (&GST_BASE_SINK_CAST (self)->segment,
|
||||
GST_FORMAT_TIME, timestamp + duration) - running_time;
|
||||
|
||||
// FIXME: https://bugzilla.gnome.org/show_bug.cgi?id=742916
|
||||
// We need to drop late buffers here immediately instead of
|
||||
// potentially overflowing the internal queue of the hardware
|
||||
clock = gst_element_get_clock (GST_ELEMENT_CAST (self));
|
||||
if (clock) {
|
||||
GstClockTime clock_running_time, base_time, clock_time, latency,
|
||||
max_lateness;
|
||||
|
||||
base_time = gst_element_get_base_time (GST_ELEMENT_CAST (self));
|
||||
clock_time = gst_clock_get_time (clock);
|
||||
if (base_time != GST_CLOCK_TIME_NONE && clock_time != GST_CLOCK_TIME_NONE) {
|
||||
clock_running_time = clock_time - base_time;
|
||||
latency = gst_base_sink_get_latency (GST_BASE_SINK_CAST (self));
|
||||
max_lateness = gst_base_sink_get_max_lateness (GST_BASE_SINK_CAST (self));
|
||||
|
||||
if (clock_running_time >
|
||||
running_time + running_time_duration + latency + max_lateness) {
|
||||
GST_DEBUG_OBJECT (self,
|
||||
"Late buffer: %" GST_TIME_FORMAT " > %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (clock_running_time),
|
||||
GST_TIME_ARGS (running_time + running_time_duration));
|
||||
|
||||
if (self->last_render_time == GST_CLOCK_TIME_NONE
|
||||
|| (self->last_render_time < clock_running_time
|
||||
&& clock_running_time - self->last_render_time >= GST_SECOND)) {
|
||||
GST_DEBUG_OBJECT (self,
|
||||
"Rendering frame nonetheless because we had none for more than 1s");
|
||||
running_time = clock_running_time;
|
||||
running_time_duration = 0;
|
||||
} else {
|
||||
GST_WARNING_OBJECT (self, "Dropping frame");
|
||||
gst_object_unref (clock);
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gst_object_unref (clock);
|
||||
}
|
||||
self->last_render_time = running_time;
|
||||
|
||||
ret = self->output->output->CreateVideoFrame (self->info.width,
|
||||
self->info.height, self->info.stride[0], bmdFormat8BitYUV,
|
||||
bmdFrameFlagDefault, &frame);
|
||||
|
@ -691,7 +649,6 @@ gst_decklink_video_sink_change_state (GstElement * element,
|
|||
gst_element_post_message (element,
|
||||
gst_message_new_clock_provide (GST_OBJECT_CAST (element),
|
||||
self->output->clock, TRUE));
|
||||
self->last_render_time = GST_CLOCK_TIME_NONE;
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:{
|
||||
GstClock *clock, *audio_clock;
|
||||
|
|
|
@ -56,7 +56,6 @@ struct _GstDecklinkVideoSink
|
|||
|
||||
GstClockTime internal_base_time;
|
||||
GstClockTime external_base_time;
|
||||
GstClockTime last_render_time;
|
||||
|
||||
GstDecklinkOutput *output;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue