summaryrefslogtreecommitdiff
path: root/sys/decklink
diff options
context:
space:
mode:
authorVivia Nikolaidou <vivia@ahiru.eu>2018-01-04 15:41:51 +0200
committerVivia Nikolaidou <vivia@ahiru.eu>2018-01-04 15:41:51 +0200
commit42a03a812483d3cfe6d78c2b0b7c1e0df22ef61e (patch)
tree4dd2e2936cb972e81b7f4bb0183f79b58ada7777 /sys/decklink
parentc7a60ed9099f10591d33da53897b87098da98833 (diff)
Revert "WIP: Revert "Revert "decklink: Detect gaps on incoming stream times, issue warnings"""
Diffstat (limited to 'sys/decklink')
-rw-r--r--sys/decklink/gstdecklinkaudiosrc.cpp45
-rw-r--r--sys/decklink/gstdecklinkaudiosrc.h5
-rw-r--r--sys/decklink/gstdecklinkvideosrc.cpp28
-rw-r--r--sys/decklink/gstdecklinkvideosrc.h4
4 files changed, 0 insertions, 82 deletions
diff --git a/sys/decklink/gstdecklinkaudiosrc.cpp b/sys/decklink/gstdecklinkaudiosrc.cpp
index 10fb1ed20..a9b503638 100644
--- a/sys/decklink/gstdecklinkaudiosrc.cpp
+++ b/sys/decklink/gstdecklinkaudiosrc.cpp
@@ -36,10 +36,6 @@ GST_DEBUG_CATEGORY_STATIC (gst_decklink_audio_src_debug);
#define DEFAULT_DISCONT_WAIT (1 * GST_SECOND)
#define DEFAULT_CHANNELS (GST_DECKLINK_AUDIO_CHANNELS_2)
-#ifndef ABSDIFF
-#define ABSDIFF(x, y) ( (x) > (y) ? ((x) - (y)) : ((y) - (x)) )
-#endif
-
enum
{
PROP_0,
@@ -705,44 +701,6 @@ retry:
self->info.rate) - timestamp;
}
- // Detect gaps in stream time
- self->processed += sample_count;
-
- if (p.stream_timestamp != GST_CLOCK_TIME_NONE) {
- GstClockTime start_stream_time, end_stream_time;
-
- start_stream_time = p.stream_timestamp;
-
- start_offset =
- gst_util_uint64_scale (start_stream_time, self->info.rate, GST_SECOND);
-
- end_offset = start_offset + sample_count;
- end_stream_time = gst_util_uint64_scale_int (end_offset, GST_SECOND,
- self->info.rate);
-
- if (self->expected_stream_time != GST_CLOCK_TIME_NONE &&
- ABSDIFF (self->expected_stream_time, p.stream_timestamp) >
- gst_util_uint64_scale (2, GST_SECOND, self->info.rate)) {
- GstMessage *msg;
- GstClockTime running_time;
-
- self->dropped +=
- gst_util_uint64_scale (ABSDIFF (self->expected_stream_time,
- p.stream_timestamp), self->info.rate, GST_SECOND);
- running_time =
- gst_segment_to_running_time (&GST_BASE_SRC (self)->segment,
- GST_FORMAT_TIME, timestamp);
-
- msg =
- gst_message_new_qos (GST_OBJECT (self), TRUE, running_time, p.stream_timestamp,
- timestamp, duration);
- gst_message_set_qos_stats (msg, GST_FORMAT_DEFAULT, self->processed,
- self->dropped);
- gst_element_post_message (GST_ELEMENT (self), msg);
- }
- self->expected_stream_time = end_stream_time;
- }
-
if (p.no_signal)
GST_BUFFER_FLAG_SET (*buffer, GST_BUFFER_FLAG_GAP);
GST_BUFFER_TIMESTAMP (*buffer) = timestamp;
@@ -949,9 +907,6 @@ gst_decklink_audio_src_change_state (GstElement * element,
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
- self->processed = 0;
- self->dropped = 0;
- self->expected_stream_time = GST_CLOCK_TIME_NONE;
if (!gst_decklink_audio_src_open (self)) {
ret = GST_STATE_CHANGE_FAILURE;
goto out;
diff --git a/sys/decklink/gstdecklinkaudiosrc.h b/sys/decklink/gstdecklinkaudiosrc.h
index c631d39e6..64cde673e 100644
--- a/sys/decklink/gstdecklinkaudiosrc.h
+++ b/sys/decklink/gstdecklinkaudiosrc.h
@@ -71,11 +71,6 @@ struct _GstDecklinkAudioSrc
/* counter to keep track of timestamps */
guint64 next_offset;
- /* detect gaps in stream time */
- GstClockTime expected_stream_time;
- guint64 processed;
- guint64 dropped;
-
/* Last time we noticed a discont */
GstClockTime discont_time;
diff --git a/sys/decklink/gstdecklinkvideosrc.cpp b/sys/decklink/gstdecklinkvideosrc.cpp
index b4daa853b..c47c8eed1 100644
--- a/sys/decklink/gstdecklinkvideosrc.cpp
+++ b/sys/decklink/gstdecklinkvideosrc.cpp
@@ -36,10 +36,6 @@ GST_DEBUG_CATEGORY_STATIC (gst_decklink_video_src_debug);
#define DEFAULT_SKIP_FIRST_TIME (0)
#define DEFAULT_DROP_NO_SIGNAL_FRAMES (FALSE)
-#ifndef ABSDIFF
-#define ABSDIFF(x, y) ( (x) > (y) ? ((x) - (y)) : ((y) - (x)) )
-#endif
-
enum
{
PROP_0,
@@ -829,26 +825,6 @@ gst_decklink_video_src_create (GstPushSrc * bsrc, GstBuffer ** buffer)
}
}
- if (self->expected_stream_time != GST_CLOCK_TIME_NONE &&
- ABSDIFF (self->expected_stream_time, f.stream_timestamp) > 1) {
- GstMessage *msg;
- GstClockTime running_time;
-
- self->dropped += f.stream_timestamp - self->expected_stream_time;
- running_time = gst_segment_to_running_time (&GST_BASE_SRC (self)->segment,
- GST_FORMAT_TIME, f.timestamp);
-
- msg = gst_message_new_qos (GST_OBJECT (self), TRUE, running_time, f.stream_timestamp,
- f.timestamp, f.duration);
- gst_message_set_qos_stats (msg, GST_FORMAT_TIME, self->processed,
- self->dropped);
- gst_element_post_message (GST_ELEMENT (self), msg);
- }
- if (self->first_stream_time == GST_CLOCK_TIME_NONE)
- self->first_stream_time = f.stream_timestamp;
- self->processed = f.stream_timestamp - self->dropped - self->first_stream_time;
- self->expected_stream_time = f.stream_timestamp + f.stream_duration;
-
g_mutex_unlock (&self->lock);
if (caps_changed) {
caps = gst_decklink_mode_get_caps (f.mode, f.format, TRUE);
@@ -1104,10 +1080,6 @@ gst_decklink_video_src_change_state (GstElement * element,
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
- self->processed = 0;
- self->dropped = 0;
- self->expected_stream_time = GST_CLOCK_TIME_NONE;
- self->first_stream_time = GST_CLOCK_TIME_NONE;
if (!gst_decklink_video_src_open (self)) {
ret = GST_STATE_CHANGE_FAILURE;
goto out;
diff --git a/sys/decklink/gstdecklinkvideosrc.h b/sys/decklink/gstdecklinkvideosrc.h
index 49c5ba8cf..c17106524 100644
--- a/sys/decklink/gstdecklinkvideosrc.h
+++ b/sys/decklink/gstdecklinkvideosrc.h
@@ -58,10 +58,6 @@ struct _GstDecklinkVideoSrc
gboolean output_stream_time;
GstClockTime skip_first_time;
gboolean drop_no_signal_frames;
- GstClockTime expected_stream_time;
- guint64 processed;
- guint64 dropped;
- guint64 first_stream_time;
GstVideoInfo info;
GstDecklinkVideoFormat video_format;