self->current_packets =
gst_queue_array_new_for_struct (sizeof (CapturePacket),
DEFAULT_BUFFER_SIZE);
+
+ self->skipped_last = 0;
+ self->skip_from_timestamp = GST_CLOCK_TIME_NONE;
+ self->skip_to_timestamp = GST_CLOCK_TIME_NONE;
}
void
if (!self->flushing) {
CapturePacket p;
guint skipped_packets = 0;
- GstClockTime from_timestamp = GST_CLOCK_TIME_NONE;
- GstClockTime to_timestamp = GST_CLOCK_TIME_NONE;
while (gst_queue_array_get_length (self->current_packets) >=
self->buffer_size) {
CapturePacket *tmp = (CapturePacket *)
gst_queue_array_pop_head_struct (self->current_packets);
- if (skipped_packets == 0)
- from_timestamp = tmp->timestamp;
+ if (skipped_packets == 0 && self->skipped_last == 0)
+ self->skip_from_timestamp = tmp->timestamp;
skipped_packets++;
- to_timestamp = tmp->timestamp;
+ self->skip_to_timestamp = tmp->timestamp;
capture_packet_clear (tmp);
}
- if (skipped_packets > 0)
+ if (self->skipped_last == 0 && skipped_packets > 0) {
+ GST_WARNING_OBJECT (self, "Starting to drop audio packets");
+ }
+
+ if (skipped_packets == 0 && self->skipped_last > 0) {
GST_WARNING_OBJECT (self,
"Dropped %u old packets from %" GST_TIME_FORMAT " to %"
- GST_TIME_FORMAT, skipped_packets, GST_TIME_ARGS (from_timestamp),
- GST_TIME_ARGS (to_timestamp));
+ GST_TIME_FORMAT, self->skipped_last,
+ GST_TIME_ARGS (self->skip_from_timestamp),
+ GST_TIME_ARGS (self->skip_to_timestamp));
+ self->skipped_last = 0;
+ }
+ self->skipped_last += skipped_packets;
memset (&p, 0, sizeof (p));
p.packet = packet;
GstClockTime discont_time;
guint buffer_size;
+
+ guint skipped_last;
+ GstClockTime skip_from_timestamp;
+ GstClockTime skip_to_timestamp;
};
struct _GstDecklinkAudioSrcClass
self->window_fill = 0;
self->window_skip = 1;
self->window_skip_count = 0;
+ self->skipped_last = 0;
+ self->skip_from_timestamp = GST_CLOCK_TIME_NONE;
+ self->skip_to_timestamp = GST_CLOCK_TIME_NONE;
gst_base_src_set_live (GST_BASE_SRC (self), TRUE);
gst_base_src_set_format (GST_BASE_SRC (self), GST_FORMAT_TIME);
GstVideoTimeCodeFlags flags = GST_VIDEO_TIME_CODE_FLAGS_NONE;
guint field_count = 0;
guint skipped_frames = 0;
- GstClockTime from_timestamp = GST_CLOCK_TIME_NONE;
- GstClockTime to_timestamp = GST_CLOCK_TIME_NONE;
while (gst_queue_array_get_length (self->current_frames) >=
self->buffer_size) {
CaptureFrame *tmp = (CaptureFrame *)
gst_queue_array_pop_head_struct (self->current_frames);
if (tmp->frame) {
- if (skipped_frames == 0)
- from_timestamp = tmp->timestamp;
+ if (skipped_frames == 0 && self->skipped_last == 0)
+ self->skip_from_timestamp = tmp->timestamp;
skipped_frames++;
- to_timestamp = tmp->timestamp;
+ self->skip_to_timestamp = tmp->timestamp;
}
capture_frame_clear (tmp);
}
- if (skipped_frames > 0)
+ if (self->skipped_last == 0 && skipped_frames > 0) {
+ GST_WARNING_OBJECT (self, "Starting to drop frames");
+ }
+
+ if (skipped_frames == 0 && self->skipped_last > 0) {
GST_WARNING_OBJECT (self,
"Dropped %u old frames from %" GST_TIME_FORMAT " to %"
- GST_TIME_FORMAT, skipped_frames, GST_TIME_ARGS (from_timestamp),
- GST_TIME_ARGS (to_timestamp));
+ GST_TIME_FORMAT, self->skipped_last,
+ GST_TIME_ARGS (self->skip_from_timestamp),
+ GST_TIME_ARGS (self->skip_to_timestamp));
+ self->skipped_last = 0;
+ }
+
+ self->skipped_last += skipped_frames;
memset (&f, 0, sizeof (f));
f.frame = frame;
gboolean output_afd_bar;
gint last_afd_bar_vbi_line;
gint last_afd_bar_vbi_line_field2;
+
+ guint skipped_last;
+ GstClockTime skip_from_timestamp;
+ GstClockTime skip_to_timestamp;
};
struct _GstDecklinkVideoSrcClass