/* for lip-sync */
guint64 clock_base;
+ guint64 clock_base_time;
gint clock_rate;
gint64 ts_offset;
gint64 prev_ts_offset;
stream->local_unix =
gst_util_uint64_scale_int (stream->local_rtp, GST_SECOND,
stream->clock_rate);
+ stream->local_unix += stream->clock_base_time;
/* calculate delta between server and receiver */
stream->unix_delta = stream->last_unix - stream->local_unix;
if (type == GST_RTCP_SDES_CNAME) {
stream->clock_base = GST_BUFFER_OFFSET (buffer);
+ stream->clock_base_time = GST_BUFFER_OFFSET_END (buffer);
/* associate the stream to CNAME */
gst_rtp_bin_associate (bin, stream, len, data);
}
/* get time of arrival */
g_get_current_time (¤t);
arrival->time = GST_TIMEVAL_TO_TIME (current);
+ arrival->timestamp = GST_BUFFER_TIMESTAMP (buffer);
arrival->ntpnstime = ntpnstime;
/* get packet size including header overhead */
return;
GST_BUFFER_OFFSET (packet->buffer) = source->clock_base;
+ GST_BUFFER_OFFSET_END (packet->buffer) = source->clock_base_time;
prevsender = RTP_SOURCE_IS_SENDER (source);
src->payload = 0;
src->clock_rate = -1;
src->clock_base = -1;
+ src->clock_base_time = -1;
src->packets = g_queue_new ();
src->seqnum_base = -1;
src->last_rtptime = -1;
if (src->clock_base == -1) {
GST_DEBUG ("using clock-base of %" G_GUINT32_FORMAT, rtptime);
src->clock_base = rtptime;
+ src->clock_base_time = arrival->timestamp;
}
/* convert arrival time to RTP timestamp units, truncate to 32 bits, we don't
gint clock_rate;
gint32 seqnum_base;
gint64 clock_base;
+ guint64 clock_base_time;
GstClockTime bye_time;
GstClockTime last_activity;
/**
* RTPArrivalStats:
- * @time: arrival time of a packet
+ * @time: arrival time of a packet according to the system clock
+ * @timestamp: arrival time of a packet as buffer timestamp
* @address: address of the sender of the packet
* @bytes: bytes of the packet including lowlevel overhead
* @payload_len: bytes of the RTP payload
*/
typedef struct {
GstClockTime time;
+ GstClockTime timestamp;
guint64 ntpnstime;
gboolean have_address;
GstNetAddress address;