Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Issue 1435833003: Introduce helper class NtpTime (Closed)

Created:
5 years, 1 month ago by danilchap
Modified:
5 years ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, stefan-webrtc, mflodman
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Introducing helper class NtpTime Seconds and fractions parts of the ntp time presented with two values, but used as one. This helper structure can make that use more clear.

Patch Set 1 #

Total comments: 9

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+145 lines, -0 lines) Patch
M webrtc/modules/modules.gyp View 1 chunk +1 line, -0 lines 0 comments Download
A webrtc/modules/rtp_rtcp/source/ntp_time.h View 1 2 1 chunk +68 lines, -0 lines 0 comments Download
A webrtc/modules/rtp_rtcp/source/ntp_time_unittest.cc View 1 2 1 chunk +76 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
danilchap
5 years, 1 month ago (2015-11-11 11:04:17 UTC) #3
sprang_webrtc
Looks good. Would we have use of this outside of the rtp module? https://codereview.webrtc.org/1435833003/diff/1/webrtc/modules/rtp_rtcp/source/ntp_time.h File ...
5 years, 1 month ago (2015-11-12 15:34:48 UTC) #4
danilchap
https://codereview.webrtc.org/1435833003/diff/1/webrtc/modules/rtp_rtcp/source/ntp_time.h File webrtc/modules/rtp_rtcp/source/ntp_time.h (right): https://codereview.webrtc.org/1435833003/diff/1/webrtc/modules/rtp_rtcp/source/ntp_time.h#newcode38 webrtc/modules/rtp_rtcp/source/ntp_time.h:38: void clear() { seconds_ = fractions_ = 0; } ...
5 years, 1 month ago (2015-11-12 19:05:31 UTC) #5
sprang_webrtc
lgtm with nit https://codereview.webrtc.org/1435833003/diff/1/webrtc/modules/rtp_rtcp/source/ntp_time.h File webrtc/modules/rtp_rtcp/source/ntp_time.h (right): https://codereview.webrtc.org/1435833003/diff/1/webrtc/modules/rtp_rtcp/source/ntp_time.h#newcode41 webrtc/modules/rtp_rtcp/source/ntp_time.h:41: uint32_t MidNtp() const { return (seconds_ ...
5 years, 1 month ago (2015-11-16 09:55:25 UTC) #6
danilchap
5 years, 1 month ago (2015-11-16 11:01:33 UTC) #7
https://codereview.webrtc.org/1435833003/diff/1/webrtc/modules/rtp_rtcp/sourc...
File webrtc/modules/rtp_rtcp/source/ntp_time.h (right):

https://codereview.webrtc.org/1435833003/diff/1/webrtc/modules/rtp_rtcp/sourc...
webrtc/modules/rtp_rtcp/source/ntp_time.h:44: explicit operator bool() const {
return seconds_ != 0 || fractions_ != 0; }
On 2015/11/16 09:55:25, språng wrote:
> On 2015/11/12 19:05:31, danilchap wrote:
> > On 2015/11/12 15:34:48, språng wrote:
> > > When would this be used? Are we implicitly saying time 0 is not a valid
> > number?
> > > I think testing for equality with NtpTime(0, 0) would be more clear in
that
> > > case, or the use of rtc::Otional for instance.
> > 
> > To make it more explicit conversion to bool replaced with function 'valid'.
> > 
> > This kind of test used in RtcpReciver to check if NtpTime was ever received.

> > According to NTP standard value 0/0 considered invalid.
> > RFC1305, Data format section:  "There will exist an 200-picosecond interval,
> > henceforth ignored, every 136 years when the 64-bit field will be zero and
> thus
> > considered invalid."
> 
> Gotcha. A comment to that affect would be great. :)

Done.

Powered by Google App Engine
This is Rietveld 408576698