[Bug 768110] new plugin: ahssrc (Android hardware sensor source)

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Tue Jun 28 06:34:54 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=768110

--- Comment #3 from Sebastian Dröge (slomo) <slomo at coaxion.net> ---
Review of attachment 330460:
 --> (https://bugzilla.gnome.org/review?bug=768110&attachment=330460)

This seems very useful indeed :)

::: sys/androidmedia/gstahssrc.c
@@ +719,3 @@
+  buffer = gst_buffer_new_wrapped (data, self->buffer_size);
+  GST_BUFFER_DURATION (buffer) = duration;
+  GST_BUFFER_PTS (buffer) = buffer_ts;

As Olivier said, you really want to timestamp with the pipeline clock here.
Just use GST_ELEMENT_CLOCK() instead of using your own system clock.

Alternatively if there is indeed a timestamp provided by the Android APIs (is
there?) you need to know which clock it comes from (probably the monotonic
system clock). You can then either really slave that to the pipeline clock to
transform timestamps (timestamps must always be according to the pipeline
clock), or go the easy way and assume there is not much drift between the two:
  capture_time = whatever android gives you
  current_time = gst_clock_get_time(clock android uses)
  pipeline_time = gst_clock_get_time(element clock)
  buffer_time = pipeline_time - (current_time - capture_time)  // check for
wraparound

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list