diff options
author | Thibault Saunier <thibault.saunier@collabora.com> | 2012-02-23 14:46:09 -0300 |
---|---|---|
committer | Edward Hervey <edward.hervey@collabora.co.uk> | 2012-02-24 10:57:09 +0100 |
commit | 6a8d2c45f6d0b0d8d2ef25a639ff35787af4544e (patch) | |
tree | c9045aaab00868c7f50bf8d328eaa34f8a6f004a /gst/mpegtsdemux/mpegtspacketizer.h | |
parent | 48a699812b5cb25d712d737740e9cf64147c1eac (diff) |
mpegtspacketizer: Estimate clock skew and retimestamps buffers more precisly
Apply the EPTLA algotithm to estimate clock skew.
Reusing code from -good/gst/rtpmanager/rtpjitterbuffer.c
Diffstat (limited to 'gst/mpegtsdemux/mpegtspacketizer.h')
-rw-r--r-- | gst/mpegtsdemux/mpegtspacketizer.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gst/mpegtsdemux/mpegtspacketizer.h b/gst/mpegtsdemux/mpegtspacketizer.h index 832862577..84da5f647 100644 --- a/gst/mpegtsdemux/mpegtspacketizer.h +++ b/gst/mpegtsdemux/mpegtspacketizer.h @@ -28,6 +28,8 @@ #include <gst/base/gstadapter.h> #include <glib.h> +#include "gstmpegdefs.h" + #define MPEGTS_NORMAL_PACKETSIZE 188 #define MPEGTS_M2TS_PACKETSIZE 192 #define MPEGTS_DVB_ASI_PACKETSIZE 204 @@ -39,6 +41,8 @@ #define MPEGTS_AFC_PCR_FLAG 0x10 #define MPEGTS_AFC_OPCR_FLAG 0x08 +#define MAX_WINDOW 512 + G_BEGIN_DECLS #define GST_TYPE_MPEGTS_PACKETIZER \ @@ -79,6 +83,21 @@ struct _MpegTSPacketizer2 { /* current offset of the tip of the adapter */ guint64 offset; gboolean empty; + + /* clock skew calculation */ + gboolean calculate_skew; + GstClockTime base_time; + GstClockTime base_pcrtime; + GstClockTime base_extrtp; + GstClockTime prev_out_time; + GstClockTime last_pcrtime; + gint64 window[MAX_WINDOW]; + guint window_pos; + guint window_size; + gboolean window_filling; + gint64 window_min; + gint64 skew; + gint64 prev_send_diff; }; struct _MpegTSPacketizer2Class { |