[gst-cvs] gst-openmax: Properly calculate timestamps when input buffers are split

Felipe Contreras felipec at kemper.freedesktop.org
Wed Apr 1 13:50:12 PDT 2009


Module: gst-openmax
Branch: master
Commit: 29970d76a7871387a0039b40aed457590492e033
URL:    http://cgit.freedesktop.org/gstreamer/gst-openmax/commit/?id=29970d76a7871387a0039b40aed457590492e033

Author: Marco Ballesio <marco.ballesio at nokia.com>
Date:   Fri Mar 20 19:44:58 2009 +0200

Properly calculate timestamps when input buffers are split

Signed-off-by: Marco Ballesio <marco.ballesio at nokia.com>
Signed-off-by: Felipe Contreras <felipe.contreras at nokia.com>

---

 omx/gstomx_base_filter.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/omx/gstomx_base_filter.c b/omx/gstomx_base_filter.c
index a1daf80..0f47a7b 100644
--- a/omx/gstomx_base_filter.c
+++ b/omx/gstomx_base_filter.c
@@ -641,7 +641,16 @@ pad_chain (GstPad *pad,
 
                 if (self->use_timestamps)
                 {
-                    omx_buffer->nTimeStamp = gst_util_uint64_scale_int (GST_BUFFER_TIMESTAMP (buf),
+                    GstClockTime timestamp_offset = 0;
+
+                    if (buffer_offset && GST_BUFFER_DURATION (buf) != GST_CLOCK_TIME_NONE)
+                    {
+                        timestamp_offset = gst_util_uint64_scale_int (buffer_offset,
+                                                                      GST_BUFFER_DURATION (buf),
+                                                                      GST_BUFFER_SIZE (buf));
+                    }
+
+                    omx_buffer->nTimeStamp = gst_util_uint64_scale_int (GST_BUFFER_TIMESTAMP (buf) + timestamp_offset,
                                                                         OMX_TICKS_PER_SECOND,
                                                                         GST_SECOND);
                 }





More information about the Gstreamer-commits mailing list