Cast: Skip receiver log messages with time delta that can't be encoded.
commit6768763ed80e114f74b914d1c4a89c88c32ba0e9
authorimcheng@chromium.org <imcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Wed, 5 Mar 2014 18:30:05 +0000 (5 18:30 +0000)
committerimcheng@chromium.org <imcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Wed, 5 Mar 2014 18:30:05 +0000 (5 18:30 +0000)
treeff82fce56e80aa0289ad0ef2ace011a9b6f8b62e
parent1ba28941d5dd867ffb34d33fa37de7db2f1851af
Cast: Skip receiver log messages with time delta that can't be encoded.

When sending receiver log messages in RTCP, we use 12 bits to represent
the time delta of (current event timestamp - event timestamp of first
event in frame). We have a DCHECK to check the time delta can fit in 12
bits, which is failing because we try to encode events that are more
than 2^12 - 1 milliseconds apart.

This change throws away events that are older than 2^12 milliseconds
from the latest event of the frame when building receiver log.

Furthermore, it sorts the events to make sure that delta is
nonnegative.

Also, added comments and changed some variable naming to try to make
it more clear what we are doing during encoding.

TODO in later CL: instead of delta from first event, delta from
previous event.

BUG=348254

Review URL: https://codereview.chromium.org/185873004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255089 0039d316-1c4b-4281-b951-d872f2087c98
media/cast/rtcp/rtcp_sender.cc
media/cast/rtcp/rtcp_sender_unittest.cc