[aravis] timestamping gstreamer buffers

  • From: Patrick Doyle <wpdster@xxxxxxxxx>
  • To: aravis@xxxxxxxxxxxxx
  • Date: Mon, 14 Apr 2014 13:07:38 -0400

Is this a bug in the code, or in my understanding:

According to gst-inspect-1.0 aravissrc:

  do-timestamp        : Apply current stream time to buffers
                        flags: readable, writable
                        Boolean. Default: false


I was expecting that, when do-timestamp is true, aravissrc would grab
the timestamp field from the GigEVision packet and stuff it in into
the timestamp field of the gstreamer buffer.

But when I look in gstaravis.c, I see (note the "!" in the first if statement):

if (!gst_base_src_get_do_timestamp(GST_BASE_SRC(push_src))) {
  if (gst_aravis->timestamp_offset == 0) {
    gst_aravis->timestamp_offset = arv_buffer->timestamp_ns;
    gst_aravis->last_timestamp = arv_buffer->timestamp_ns;
  }

  GST_BUFFER_PTS (*buffer) = arv_buffer->timestamp_ns -
gst_aravis->timestamp_offset;
  GST_BUFFER_DURATION (*buffer) = arv_buffer->timestamp_ns -
gst_aravis->last_timestamp;

  gst_aravis->last_timestamp = arv_buffer->timestamp_ns;
}

which looks like it fills in the GST_BUFFER_PTS when do-timestamp is
false.  Am I misunderstanding the timestamp notion in gstreamer?  Or
is this simply a typo in the code?

(Unfortunately, this doesn't explain the weird latency issues I'm
seeing with my Blackfly camera, but it does explain weird, sub
milliscecond frame durations when I put the stream through a queue
element).

--wpd

Other related posts: