mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 20:59:44 +00:00
decklink: Print one "dropped N old frames" message, not one per frame
If we drop many frames at once, printing one message per video frame and one per audio packet would cause a lot of disk IO. Just print a total at the end. https://bugzilla.gnome.org/show_bug.cgi?id=788780
This commit is contained in:
parent
f272ddf9c7
commit
0355bb7c34
2 changed files with 26 additions and 4 deletions
sys/decklink
|
@ -526,16 +526,27 @@ gst_decklink_audio_src_got_packet (GstElement * element,
|
|||
g_mutex_lock (&self->lock);
|
||||
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);
|
||||
GST_WARNING_OBJECT (self, "Dropping old packet at %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (tmp->timestamp));
|
||||
if (skipped_packets == 0)
|
||||
from_timestamp = tmp->timestamp;
|
||||
skipped_packets++;
|
||||
to_timestamp = tmp->timestamp;
|
||||
capture_packet_clear (tmp);
|
||||
}
|
||||
|
||||
if (skipped_packets > 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));
|
||||
|
||||
memset (&p, 0, sizeof (p));
|
||||
p.packet = packet;
|
||||
p.timestamp = timestamp;
|
||||
|
|
|
@ -679,16 +679,27 @@ gst_decklink_video_src_got_frame (GstElement * element,
|
|||
const GstDecklinkMode *bmode;
|
||||
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);
|
||||
GST_WARNING_OBJECT (self, "Dropping old frame at %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (tmp->timestamp));
|
||||
if (skipped_frames == 0)
|
||||
from_timestamp = tmp->timestamp;
|
||||
skipped_frames++;
|
||||
to_timestamp = tmp->timestamp;
|
||||
capture_frame_clear (tmp);
|
||||
}
|
||||
|
||||
if (skipped_frames > 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));
|
||||
|
||||
memset (&f, 0, sizeof (f));
|
||||
f.frame = frame;
|
||||
f.timestamp = timestamp;
|
||||
|
|
Loading…
Reference in a new issue