570 Commits

Author SHA1 Message Date
Peter Boström
f14c47a58c Remove ignored return code from modules.
ModuleProcessImpl doesn't act on return codes and having them around is
confusing (it's unclear what an error return code here would do even).

BUG=
R=tommi@webrtc.org

Review URL: https://codereview.webrtc.org/1703833002 .

Cr-Commit-Position: refs/heads/master@{#11747}
2016-02-24 15:51:23 +00:00
Danil Chapovalov
a094fd1550 RTT intermediate calculation use ntp time instead of milliseconds.
Compact NTP representation was designed exactly for that purpose: calculate RTT. No need to map to ms before doing arithmetic on this values.
  Because of this change there is no need to keep mapping between compact ntp presentation and milliseconds in the RTCPSender.

BUG=webrtc:5565
R=stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1491843004 .

Cr-Commit-Position: refs/heads/master@{#11710}
2016-02-22 17:59:47 +00:00
sprang
e2d83d6560 Use CallStats for RTT in Call, rather than VideoSendStream::GetRtt()
Also move some stats reporting from vie_channel to send stats proxy

BUG=

Review URL: https://codereview.webrtc.org/1669623004

Cr-Commit-Position: refs/heads/master@{#11688}
2016-02-19 17:03:34 +00:00
Peter Boström
fc968a283c Fix sequence-number replay race for padding.
Prevents allocating sequence numbers for packets that go out on the
network even though sending media is disabled.

This race caused a replay of sequence numbers when GetRtpState() on a
stopped stream would not return the last sequence number sent, since the
pacer thread could request and send padding on a later sequence number
before the modules are disconnected from the pacer.

BUG=webrtc:5543
R=stefan@webrtc.org
TEST=Repeating EndToEndTest.RestartingSendStreamPreservesRtpState 1000 times under TSan.

Review URL: https://codereview.webrtc.org/1715703002 .

Cr-Commit-Position: refs/heads/master@{#11685}
2016-02-19 15:14:44 +00:00
Danil Chapovalov
1e80ce438e webrtc::RtpPacket name freed for better RtpPacket
There were two different structures named RtpPacket in webrtc namespace:
RtpPacket defined in fec_test_helper renamed to test::RawRtpPacket
RtpPacket defined in rtp_sender_video and producer_fec removed as unused

BUG=webrtc:5261
R=sprang@google.com, stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1710103004 .

Cr-Commit-Position: refs/heads/master@{#11682}
2016-02-19 15:02:24 +00:00
aleungbroadsoft
0e2e50ca1c Always append the BYE packet type at the end
When composing a RTCP packet, if there is a BYE
to be appended, preserve it and append it at the
end after all other packet types are added.

BUG=webrtc:5498
NOTRY=true

Review URL: https://codereview.webrtc.org/1674963004

Cr-Commit-Position: refs/heads/master@{#11672}
2016-02-18 16:33:33 +00:00
danilchap
69e59e619a [rtp_rtcp] rtc::scoped_ptr<rtcp::RawPacket> replaced with rtc::Buffer
rtcp::RawPacket is rtc::Buffer, it had no extra functionality.
rtc::Buffer is a movable class - no point to wrap it into rtc::scoped_ptr
change is large, but straightforward:
  rtc::scoped_ptr<rtcp::RawPacket> replaced with rtc::Buffer
  ->Buffer() replaced with .data()
  ->Length() replaced with .size()

BUG=webrtc:5260

Review URL: https://codereview.webrtc.org/1696203002

Cr-Commit-Position: refs/heads/master@{#11649}
2016-02-17 11:11:50 +00:00
Peter Boström
9d0c43242b Remove video-codec max bitrate from TMMBN.
TMMBN was capped by configured max bitrate for no apparent reason.
Removing this to not require payload-type reconfiguration on new
video-codec settings. Actual removal of payload-type reconfiguration
will happen in a pending CL.

BUG=webrtc:5494
R=stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1702043002 .

Cr-Commit-Position: refs/heads/master@{#11639}
2016-02-16 16:59:36 +00:00
danilchap
9f35d55c58 Added accessor and Parse function.
Create function merged into one.

BUG=webrtc:5260

Review URL: https://codereview.webrtc.org/1439553003

Cr-Commit-Position: refs/heads/master@{#11581}
2016-02-11 16:19:06 +00:00
danilchap
09fef9e6f7 [rtp_rtcp] Added Sender Report Request rtcp packet.
BUG=webrtc:5260
R=åsapersson

Review URL: https://codereview.webrtc.org/1555543005

Cr-Commit-Position: refs/heads/master@{#11538}
2016-02-09 13:57:56 +00:00
Peter Boström
c0ae305a9e Fix null-pointer dereference in RTPSenderVideo.
Since the address of the dereference is taken this inputs a garbage
almost-null pointer into RtpPacketizer. Not likely that a load/store is
performed on the address, but UBSan fires and it's a source of potential
future errors.

BUG=webrtc:5124, webrtc:5490
R=stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1677003002 .

Cr-Commit-Position: refs/heads/master@{#11528}
2016-02-08 14:00:22 +00:00
danilchap
7336eeb690 [rtp_rtcp] rtcp::Tmmbn cleaned and got Parse function
Added accessor and Parse function
removed dependencies on structures from rtcp_utility.h (except RtcpCommonHeader)
removed limitation of 50 items per TMMBN.

BUG=webrtc:5260
R=åsapersson

Review URL: https://codereview.webrtc.org/1670973002

Cr-Commit-Position: refs/heads/master@{#11524}
2016-02-08 11:35:20 +00:00
danilchap
f174e3a260 [rtp_rtcp] rtcp::Tmmbr cleaned and got Parse function
Added accessor and Parse function
removed dependencies on structures from rtcp_utility.h (except RtcpCommonHeader)

BUG=webrtc:5260
R=åsapersson

Review URL: https://codereview.webrtc.org/1675583002

Cr-Commit-Position: refs/heads/master@{#11502}
2016-02-05 12:56:40 +00:00
kjellander
988d31eb9b Move gtest_prod_util.h out of webrtc/test tree.
This is needed because the target is defined in webrtc/common.gyp
and its current location crosses package boundaries when generating
projects for some build systems.

NOTRY=True

Review URL: https://codereview.webrtc.org/1665603003

Cr-Commit-Position: refs/heads/master@{#11496}
2016-02-05 08:23:57 +00:00
danilchap
a92d6be411 rtcp::TmmbItem designed to replace RTCPUtility::RTCPPacketRTPFBTMMBRItem (for creating and parsing rtcp TMMBR/TMMBN packets)
std::vector<rtcp::TmmbItem> will replace TMMBRSet class for storage, processing and preparing TMBBR/TMMBN
(i.e. this TmmbItem replaces Timber structure introduced in https://codereview.webrtc.org/1474693002 )
Previous structures store bitrate in kbps. TmmbItem use bps removing need to regularly divide and multiply by 1000.

BUG=webrtc:5260
R=åsapersson

Review URL: https://codereview.webrtc.org/1576223003

Cr-Commit-Position: refs/heads/master@{#11491}
2016-02-04 15:33:44 +00:00
Stefan Holmer
10880011d9 Support multiple rtx codecs.
Adds negotiation of rtx codecs for red and vp9. To keep backwards
compatibility with older Chrome versions, this change includes two
hacks:
1. Red packets will be retransmitted over the rtx codec associated with
   vp8 if no rtx codec is associated with red. This is how Chrome does
   it today and ensures that we still can send red over rtx to older
   versions.

2. If rtx packets associated with the media codec (vp8/vp9 etc) are
   received and red has been negotiated, we will assume that the sender
   incorrectly has packetized red inside the rtx header associated with
   media. We will therefore restore it with the red payload type
   instead, which ensures that we can still receive rtx associated with
   red from old versions.

Offering multiple rtx codecs to older versions should not be a problem
since old versions themselves only try to negotiate rtx for vp8.

R=pbos@webrtc.org
TBR=mflodman@webrtc.org
BUG=webrtc:4024
TEST=Verified by running apprtc and emulating packet loss between Chrome with and without the patch.

Review URL: https://codereview.webrtc.org/1649493004 .

Cr-Commit-Position: refs/heads/master@{#11472}
2016-02-03 12:30:10 +00:00
noahric
d983c3c9e5 Add SEI to the list of packets counted as keyframe.
It's generated by some encoders between SPS/PPS and an IDR frame, so we should treat it like sps/pps.

BUG=

Review URL: https://codereview.webrtc.org/1664733002

Cr-Commit-Position: refs/heads/master@{#11470}
2016-02-03 11:43:50 +00:00
tommi
ae695e95a6 Refactor RtpSender and SSRCDatabase.
* SSRCDatabase doesn't need to be a global instance, so I've changed it to be a "regular" class (i.e. construct via ctor, not maybe via GetSSRCDatabase( + release via ReturnSSRCDatabase())).  If we ever have parallel tests running in the same process, they won't have the problem of using the same ssrc database.

* Made RtpSender a more const.  Also added some todos for myself and holmer to look into clarifying the threading model.

* Switched from CriticalSectionWrapper to rtc::CriticalSection

* Changed the random seeding to use TickTime::Now().Ticks() since TimeInMicroseconds() could return 0 when the process was starting.  This is what TimeInMicroseconds() does anyway but now we don't need to access a global clock object.

BUG=webrtc:3062

Review URL: https://codereview.webrtc.org/1623543002

Cr-Commit-Position: refs/heads/master@{#11462}
2016-02-02 16:34:16 +00:00
Peter Boström
ed3277bf14 Deprecate VideoDecoder::Reset() and remove calls.
Removes calls to decoder reset and instead drops delta frames and
requests keyframes until one arrives.

BUG=webrtc:5475
R=stefan@webrtc.org
TBR=mflodman@webrtc.org

Review URL: https://codereview.webrtc.org/1647163002 .

Cr-Commit-Position: refs/heads/master@{#11460}
2016-02-02 14:40:13 +00:00
danilchap
44efbece68 Converting picture_id to bitstring pushed from WithPictureId to Create function.
Added Parse and accessor functions.

BUG=webrtc:5260
R=åsapersson

Review URL: https://codereview.webrtc.org/1550293003

Cr-Commit-Position: refs/heads/master@{#11439}
2016-02-01 09:36:44 +00:00
danilchap
de13882d94 rtcp::ExtenededReports packet class got Parse function
BUG=webrtc:5260
R=åsapersson

Review URL: https://codereview.webrtc.org/1557593002

Cr-Commit-Position: refs/heads/master@{#11428}
2016-01-29 19:26:20 +00:00
Stefan Holmer
f5dca48dc0 Add transport sequence number on the non-pacer path of the rtp sender.
BUG=4173
R=sprang@webrtc.org

Review URL: https://codereview.webrtc.org/1635093002 .

Cr-Commit-Position: refs/heads/master@{#11395}
2016-01-27 11:59:05 +00:00
Danil Chapovalov
d673b0fa5d [rtp_rtcp] Fix potentional time difference between rtp and rtcp packets.
SetRtpState function was updating only rtp_sender start timestamp.
Now it updates both rtp_sender and rtcp_sender start timestamps.

BUG=webrtc:5433
R=stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1628323003 .

Cr-Commit-Position: refs/heads/master@{#11393}
2016-01-27 11:55:06 +00:00
Danil Chapovalov
d0c7bba4f4 [rtp_rtcp] Dlrr::SubBlock struct renamed to ReceiveTimeInfo
This structure is used outside Dlrr creating/parsing.
but RTCPReceiveTimeInfo structure doesn't follow naming style.

rtcp::ReceiveTimeInfo added to replace both Dlrr::SubBlock (when creating/parsing packets)
and RTCPReceiveTimeInfo (for other uses).

this CL is a split of https://codereview.webrtc.org/1557593002/

BUG=webrtc:5260
R=asapersson@webrtc.org, åsapersson

Review URL: https://codereview.webrtc.org/1631683002 .

Cr-Commit-Position: refs/heads/master@{#11380}
2016-01-26 13:12:57 +00:00
henrik.lundin
7a83951b27 Fix a bug in webrtc::ByteReader
The specializations for 4-byte reading did not return correct
values. This has to do with the order of casting and shifting. Also
adding a test to expose the bug (and verify the other byte sizes).

Review URL: https://codereview.webrtc.org/1615653011

Cr-Commit-Position: refs/heads/master@{#11364}
2016-01-25 07:47:59 +00:00
Danil Chapovalov
32e590ec13 class doesn't rely on structures in RTCPUtility to store data.
supports several fci items in same packet.
got accessors to read data

BUG=webrtc:5260
R=asapersson@webrtc.org, åsapersson

Review URL: https://codereview.webrtc.org/1544403002 .

Cr-Commit-Position: refs/heads/master@{#11354}
2016-01-22 10:05:10 +00:00
terelius
429c345b02 Fixes a bug which incorrectly logs incoming RTCP as outgoing.
Adds logging to RTPSender and RTCPSender, pushing an event log pointer from Channel through ModuleRtpRtcpImpl to the Sender objects.

BUG=webrtc:4741

Review URL: https://codereview.webrtc.org/1571283002

Cr-Commit-Position: refs/heads/master@{#11336}
2016-01-21 13:42:10 +00:00
danilchap
d8dccd57ea uses standard types instead of RTCPUtility type to store data.
got member read accessors, got Parse function.

BUG=webrtc:5260
R=åsapersson

Review URL: https://codereview.webrtc.org/1552773002

Cr-Commit-Position: refs/heads/master@{#11324}
2016-01-20 20:08:58 +00:00
Peter Boström
8d6fab8fac Remove two dead 'using' instances.
BUG=
TBR=pthatcher@webrtc.org, stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1609563003 .

Cr-Commit-Position: refs/heads/master@{#11296}
2016-01-18 23:24:36 +00:00
danilchap
34ed2b95a5 [rtp_rtcp] rtcp::SenderReport moved into own file and got Parse function
BUG=webrtc:5260
R=åsapersson

Review URL: https://codereview.webrtc.org/1544983002

Cr-Commit-Position: refs/heads/master@{#11288}
2016-01-18 10:43:38 +00:00
Danil Chapovalov
1567d0bd98 [rtp_rtcp] rtcp::Sdes moved into own file
Cleaning/Parsing will be done in the https://codereview.webrtc.org/1439553003/

BUG=webrtc:5260
R=asapersson@webrtc.org, åsapersson

Review URL: https://codereview.webrtc.org/1592763002 .

Cr-Commit-Position: refs/heads/master@{#11274}
2016-01-15 16:34:32 +00:00
Danil Chapovalov
2c13297bf5 [rtp_rtcp] rtcp::Rpsi moved into own file
Cleaning/Parsing will be done in the https://codereview.webrtc.org/1550293003/

BUG=webrtc:5260
R=asapersson@webrtc.org, åsapersson

Review URL: https://codereview.webrtc.org/1583233007 .

Cr-Commit-Position: refs/heads/master@{#11272}
2016-01-15 14:21:34 +00:00
Danil Chapovalov
256e5b23f8 Cleaning/Parsing will be done in the https://codereview.webrtc.org/1557593002/
BUG=webrtc:5260
R=asapersson@webrtc.org, åsapersson

Review URL: https://codereview.webrtc.org/1579213005 .

Cr-Commit-Position: refs/heads/master@{#11271}
2016-01-15 13:16:36 +00:00
Danil Chapovalov
5679da1291 [rtp_rtcp] rtcp::Fir moved into own file
Cleaning/Parsing will be done in the https://codereview.webrtc.org/1544403002

BUG=webrtc:5260
R=asapersson@webrtc.org, åsapersson

Review URL: https://codereview.webrtc.org/1581983003 .

Cr-Commit-Position: refs/heads/master@{#11269}
2016-01-15 12:19:59 +00:00
Danil Chapovalov
a5eba6c98b [rtp_rtcp] rtcp::Remb moved into own file
Cleaning/Parsing will be done in the https://codereview.webrtc.org/1552773002/

BUG=webrtc:5260
R=asapersson@webrtc.org, åsapersson

Review URL: https://codereview.webrtc.org/1590883002 .

Cr-Commit-Position: refs/heads/master@{#11268}
2016-01-15 11:40:27 +00:00
danilchap
d9e62f5837 Fixed sending Rtp packets with non zero csrcs and certain extensions.
Added test that fails because of given issue.

BUG=webrtc:5413
R=stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1586523003

Cr-Commit-Position: refs/heads/master@{#11258}
2016-01-14 22:55:23 +00:00
terelius
5d332ac8ff Fix expectation bug in the RTPSender unit test.
The current expectation for InsertPacket(...) uses WillRepeatedly, which accepts if the function is called zero or more times. This CL changes this to either a fixed number of calls, or at least a positive number of calls.

Review URL: https://codereview.webrtc.org/1585783003

Cr-Commit-Position: refs/heads/master@{#11256}
2016-01-14 22:37:43 +00:00
danilchap
2f7dea164d [rtp_rtcp] rtcp::Empty moved into own file and renamed to CompoundPacket on the way
Class renamed to indicated use of the rtcp::Empty class: it can only be used as container for other rtcp packets.
All tests that use Append function moved from rtcp_packet_unittest, even if they did not use Empty class.
This is because there is plan to make RtcpPacket class lighter by moving Append functionality to CompoundPacket class.

BUG=webrtc:5260
R=åsapersson

Review URL: https://codereview.webrtc.org/1582503002

Cr-Commit-Position: refs/heads/master@{#11234}
2016-01-13 10:03:09 +00:00
Peter Kasting
6955870806 Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.

BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org

Review URL: https://codereview.webrtc.org/1316523002 .

Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-13 00:26:55 +00:00
danilchap
92e677a1f8 [rtp_rtcp] rtcp::Sli packet moved into own file and got Parse function
BUG=webrtc:5260
R=åsapersson

Review URL: https://codereview.webrtc.org/1551893002

Cr-Commit-Position: refs/heads/master@{#11228}
2016-01-12 18:05:00 +00:00
Stefan Holmer
3842c5c7f7 Wire-up BWE feedback for audio receive streams.
Also wires up receiving transport sequence numbers.

BUG=webrtc:5263
R=mflodman@webrtc.org, pbos@webrtc.org, solenberg@webrtc.org

Review URL: https://codereview.webrtc.org/1535963002 .

Cr-Commit-Position: refs/heads/master@{#11220}
2016-01-12 12:55:11 +00:00
danilchap
7e8145f05d [rtp_rtcp] rtcp::Tmmbr moved into own file
BUG=webrtc:5260
R=åsapersson

Review URL: https://codereview.webrtc.org/1575023002

Cr-Commit-Position: refs/heads/master@{#11206}
2016-01-11 19:49:24 +00:00
danilchap
ef3d805f6e [rtp_rtcp] rtcp::Tmmbn moved into own file
explicetly unchanged.

BUG=webrtc:5260
R=åsapersson

Review URL: https://codereview.webrtc.org/1578713002

Cr-Commit-Position: refs/heads/master@{#11201}
2016-01-11 11:31:17 +00:00
Peter Boström
3886fc8f57 Use pointer to generated FEC packet.
Removes multiple index lookups to generated_fec_packets_ speeding up
FecTest.FecTest with >2x in both Debug and Release, improving
performance but also readability.

On Debug this means that the slowest test in modules_tests now takes
~15-20 seconds instead of 50+ seconds, reducing the overall bottleneck.

BUG=webrtc:4712
R=stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1552563003 .

Cr-Commit-Position: refs/heads/master@{#11166}
2016-01-07 14:33:57 +00:00
danilchap
2df2ba7ae1 [rtp_rtcp] Fix CL#1539423003
public function RtpHeaderParser::Parse with old signature restored as deprecated.

BUG=webrtc:5277
TBR=åsapersson
NOTRY=True

Review URL: https://codereview.webrtc.org/1550283002

Cr-Commit-Position: refs/heads/master@{#11135}
2015-12-29 09:12:15 +00:00
danilchap
f6975f4613 [rtp_rtcp] Lint errors cleaned from rtp_utility
R=åsapersson
BUG=webrtc:5277

Review URL: https://codereview.webrtc.org/1539423003

Cr-Commit-Position: refs/heads/master@{#11131}
2015-12-28 18:18:52 +00:00
danilchap
a72e7349d5 [rtp_rtcp] cleanup in RTCPSender class internals.
PrepareReportBlock and AddReportBlock private functions merged:
  PrepareReportBlock moved report block from statistic to temporary structure
  AddReportBlock copied that temporary structure into temporary map right after.
  Thanks to rtcp packet classes that temporary structure is now unneccesary.

BUG=webrtc:5260
R=åsapersson

Review URL: https://codereview.webrtc.org/1538833002

Cr-Commit-Position: refs/heads/master@{#11112}
2015-12-22 16:07:48 +00:00
danilchap
a8890a57a5 rtcp::Nack packet moved into own file and got Parse function
Review URL: https://codereview.webrtc.org/1461623003

Cr-Commit-Position: refs/heads/master@{#11111}
2015-12-22 11:43:10 +00:00
danilchap
1227e8b345 [rtp_rtcp] time helper functions
RTP timestams helper functions moved from rtp_utility
  added functions to deal with CompactNtp timestamps

R=åsapersson
BUG=webrtc:5260

Review URL: https://codereview.webrtc.org/1535113002

Cr-Commit-Position: refs/heads/master@{#11106}
2015-12-21 19:06:56 +00:00
kwiberg
0eb15ed7b8 Don't call the Pass methods of rtc::Buffer, rtc::scoped_ptr, and rtc::ScopedVector
We can now use std::move instead!

This CL leaves the Pass methods in place; a follow-up CL will add deprecation annotations to them.

Review URL: https://codereview.webrtc.org/1460043002

Cr-Commit-Position: refs/heads/master@{#11064}
2015-12-17 11:04:24 +00:00