示例#1
0
            public RtpClockInstant(ByteBuffer buffer,
                                   uint clockRate,
                                   RtpTimestamp ts,
                                   GetReferenceTimestamp getRefTs,
                                   SetReferenceTimestamp setRefTs)
            {
                _buffer       = buffer;
                _rtpTimestamp = ts;

                if (_reset)
                {
                    _reset = false;
                    setRefTs(_buffer.TimeReference);
                    _rtpTimestamp.Next(1);
                    _rtpTimestamp.Reset();
                }
                else
                {
                    var delta = getRefTs() - _buffer.TimeReference;
                    _rtpTimestamp.At((long)TimeSpan.FromMilliseconds(delta.TotalMilliseconds * clockRate).TotalSeconds);
                }
            }
示例#2
0
 public DefaultRtpClock(uint clockRate)
 {
     _clockRate    = clockRate;
     _rtpTimestamp = new RtpTimestamp();
 }