60 Commits

Author SHA1 Message Date
brandtr
1743a19183 Simplify SetFecParameters signature.
- Change const ptr to const ref in parameter list.
  Using nullptr as argument was invalid, so no need to send
  pointer instead of reference.
- Change return type to void or bool, where appropriate

BUG=webrtc:5654

Review-Url: https://codereview.webrtc.org/2455963003
Cr-Commit-Position: refs/heads/master@{#14945}
2016-11-07 11:36:14 +00:00
brandtr
554becd7bf Add fuzzer for FlexfecSender.
BUG=webrtc:5654
NOTRY=true

Review-Url: https://codereview.webrtc.org/2433373003
Cr-Commit-Position: refs/heads/master@{#14937}
2016-11-07 06:45:20 +00:00
pbos
c6b4e547a8 Add fuzzer for H264 bitstream parser.
BUG=webrtc:6454
R=kthelgason@webrtc.org

Review-Url: https://codereview.webrtc.org/2430703002
Cr-Commit-Position: refs/heads/master@{#14936}
2016-11-05 10:10:27 +00:00
brandtr
0a4c1616bf Make FlexfecReceiver a concrete class.
There is no need for it to be an interface.

In this CL, I also took the opportunity to make two small fixes:
- remove the 'flexfec_' prefix from some member variables
- remove unnecessary use of a stringstream object

BUG=webrtc:5654

Review-Url: https://codereview.webrtc.org/2471073003
Cr-Commit-Position: refs/heads/master@{#14919}
2016-11-03 15:18:33 +00:00
brandtr
869e7cd8e7 Rename ProducerFec to UlpfecGenerator.
BUG=webrtc:5654

Review-Url: https://codereview.webrtc.org/2449783002
Cr-Commit-Position: refs/heads/master@{#14847}
2016-10-31 12:27:10 +00:00
brandtr
e405d9b8df Add a fuzzer for FlexfecReceiver.
Specifically set max_len to 2000, to simulate multi-packet insertions.

BUG=webrtc:5654
NOTRY=true

Review-Url: https://codereview.webrtc.org/2391263002
Cr-Commit-Position: refs/heads/master@{#14656}
2016-10-18 08:18:12 +00:00
kjellander
e40a7ee007 GN: Exclude suppressions of Chromium Clang warnings for Chromium builds.
These suppressions are causing GN errors when Chromium targets are depending
directly on WebRTC targets (needed for https://codereview.chromium.org/2413103004)

BUG=webrtc:4256
NOTRY=True

Review-Url: https://codereview.webrtc.org/2408133008
Cr-Commit-Position: refs/heads/master@{#14644}
2016-10-17 06:56:20 +00:00
brandtr
b1fff92644 Harmonize using-declarations in FEC header formatter fuzzers.
This CL fixes a minor eyesore.

BUG=webrtc:5654
R=stefan@webrtc.org
NOTRY=true

Review-Url: https://codereview.webrtc.org/2398593002
Cr-Commit-Position: refs/heads/master@{#14528}
2016-10-05 14:35:01 +00:00
henrik.lundin
58466f6d97 Relanding "Setting up an RTP input fuzzer for NetEq"
The original CL (https://codereview.webrtc.org/2315633002) was
reverted since the fuzzer depended on gflags and files in the
resources folder; neither of this is allowed for a fuzzer test in
Chromium. This new version streamlines the dependencies, and changes
the test to generate a sinusoid input audio signal instead of reading
from a file.

Original commit message:
This CL introduces a new fuzzer target neteq_rtp_fuzzer that
manipulates the RTP header fields before inserting the packets into
NetEq. A few helper classes are also introduced.

BUG=webrtc:5447
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.win:win_chromium_rel_ng;master.tryserver.chromium.android:android_compile_dbg,linux_android_rel_ng;master.tryserver.chromium.linux:linux_chromium_rel_ng;master.tryserver.chromium.mac:mac_chromium_rel_ng,ios-device

Review-Url: https://codereview.webrtc.org/2384423002
Cr-Commit-Position: refs/heads/master@{#14523}
2016-10-05 09:27:48 +00:00
Rasmus Brandt
3821399075 Centralize deactivation of Unequal Protection.
This CL introduces changes that clearly demarcate
where we disable Unequal Protection in the FEC.

No functional changes are expected.

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

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

Cr-Commit-Position: refs/heads/master@{#14496}
2016-10-04 12:28:05 +00:00
Rasmus Brandt
c07ebb30c5 Simplify public interface of ProducerFec.
- Change some member functions to be private. These were only
  called by other private member functions.
- Replace DeleteMediaPackets() with direct calls to
  media_packets_.clear()
- Rename GetFecPacketsAsRed to GetUlpfecPacketsAsRed.

No functional changes are intended by this CL.

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

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

Cr-Commit-Position: refs/heads/master@{#14491}
2016-10-04 08:57:47 +00:00
skvlad
cc91d284e4 Moved RtcEventLog files from call/ to logging/
The RtcEventLog headers need to be accessible from any place which needs
logging, and the implementation needs access to data structures that are
logged.

After a discussion in the code review, we all agreed to move the RtcEventLog implementation into its own top level directory - which I called "logging/" in expectation that other types of logging may have similar requirements. The directory contains two main build targets - "rtc_event_log_api", which is just rtc_event_log.h, that has no external dependencies and can be used from anywhere, and "rtc_event_log_impl" which contains the rest of the implementation and has many dependencies (more in the future).

The "api" target can be referenced from anywhere, while the "impl" target is only needed at the place of instantiation (currently Call, soon to be moved to PeerConnection by https://codereview.webrtc.org/2353033005/).

This change allows using RtcEventLog in the p2p/ directory, so that we
can log STUN pings and ICE state transitions.

BUG=webrtc:6393
R=kjellander@webrtc.org, kwiberg@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, terelius@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#14485}
2016-10-04 01:31:32 +00:00
brandtr
cada34cd98 Fuzzer for FEC header readers.
BUG=webrtc:5654

Review-Url: https://codereview.webrtc.org/2265493002
Cr-Commit-Position: refs/heads/master@{#14470}
2016-10-03 09:02:53 +00:00
phoglund
590cf281fb Add autothread to pseudo-tcp fuzzer.
I think this will make a rtc::Thread object exist for the lifetime of
the environment, which will remove some uninteresting crashes.

BUG=chrome:648075

Review-Url: https://codereview.webrtc.org/2365373002
Cr-Commit-Position: refs/heads/master@{#14438}
2016-09-29 13:27:52 +00:00
charujain
89a3a1a363 Moved Gn target rtc_event_log to one directory above.
This is done to ensure GN targets are placed in the same directory as of the source files.

BUG=webrtc:6412
NOTRY=True

Review-Url: https://codereview.webrtc.org/2365383004
Cr-Commit-Position: refs/heads/master@{#14411}
2016-09-28 07:49:04 +00:00
kjellander
b62dbbe985 GN: Change rtc_source_set targets --> rtc_static_library
This changes most non-test related rtc_source_set targets to be
rtc_static_library instead. Targets without any .cc files are excluded.
This should bring back the build behavior we used to have with GYP
(i.e. same symbols exported in the libjingle_peerconnection.a file, which
are used by some downstream projects).

After doing an Android build with these changes:
$ nm --defined-only -g -C out/Release/lib.unstripped/libjingle_peerconnection_so.so | grep -i createpeerconnectionf
00077c51 T Java_org_webrtc_PeerConnectionFactory_nativeCreatePeerConnectionFactory
$ nm --defined-only -g -C out/Release/obj/webrtc/api/libjingle_peerconnection.a | grep -i createpeerconnectionf
00000001 T webrtc::CreatePeerConnectionFactory(rtc::Thread*, rtc::Thread*, rtc::Thread*, webrtc::AudioDeviceModule*, cricket::WebRtcVideoEncoderFactory*, cricket::WebRtcVideoDecoderFactory*)
00000001 T webrtc::CreatePeerConnectionFactory()

See https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/cookbook.md#Note-on-static-libraries
for more details on this.

NOTICE: This should be further cleaned up in the future, to reduce
binary bloat and unnecessary linking time. Right now it's more
important to restore the desired build output though.

BUG=webrtc:6410, chromium:630755

Review-Url: https://codereview.webrtc.org/2361623004
Cr-Commit-Position: refs/heads/master@{#14364}
2016-09-23 07:38:58 +00:00
brandtr
ece4aba64e Generalize FEC unit tests and rename GenerateFec.
- Rename GenerateFec -> EncodeFec in ForwardErrorCorrection. This naming
  is more consistent with DecodeFec.
- Add appropriate using directives, to reduce clutter in tests.
- Move ConstructMediaPackets to fec_test_helper.{h,cc}. This will help
  future tests of ULPFEC/FlexFEC header formatters.
- Generalize tests in rtp_fec_unittest.cc to typed tests. This will help
  testing ForwardErrorCorrection with both ULPFEC and FlexFEC.

This CL should not impact functionality or performance.

BUG=webrtc:5654

Review-Url: https://codereview.webrtc.org/2267393002
Cr-Commit-Position: refs/heads/master@{#14314}
2016-09-21 06:16:36 +00:00
phoglund
667bd07bd3 Enable turn, sdp, pseudotcp and stun parse/validator fuzzers.
These were blocked on GN work; should be good to go
now. If they break the WebRTC FYI bots, there's more
work to be done. Verified they build locally at least.

Setting no-try because all bots went green except broken android bots.

BUG=6368
NOTRY=true

Review-Url: https://codereview.webrtc.org/2342843002
Cr-Commit-Position: refs/heads/master@{#14256}
2016-09-16 12:05:44 +00:00
Danil Chapovalov
9708884c31 Update rtcp receiver fuzzer to use generic function
IncomingPacket(const uint8_t* packet, size_t size)
instead of implementation specific
IncomingRTCPPacket(PacketInfo* out, Parser* in)
This would allow switch parse implementation

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

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

Cr-Commit-Position: refs/heads/master@{#14195}
2016-09-13 10:41:53 +00:00
brandtr
6631e8a21b Minor fixes in FEC and RtpSender{,Video}
- Rename GetNumberOfFecPackets -> NumFecPackets and
  PacketOverhead -> MaxPacketOverhead in ForwardErrorCorrection.
- Rename FECPacketOverhead -> FecPacketOverhead in ProducerFec.
- Move ownership of ForwardErrorCorrection from RTPSenderVideo
  to ProducerFec.
- Make MaxPacketOverhead a member function of ForwardErrorCorrection.
  This will allow for changing it, based on FEC header types, later on.

BUG=webrtc:5654

Review-Url: https://codereview.webrtc.org/2275443002
Cr-Commit-Position: refs/heads/master@{#14194}
2016-09-13 10:23:34 +00:00
henrik.lundin
22c8d5a3e0 Revert of Setting up an RTP input fuzzer for NetEq (patchset #2 id:20001 of https://codereview.webrtc.org/2315633002/ )
Reason for revert:
Broke all Chromium libFuzzer builds
https://bugs.chromium.org/p/chromium/issues/detail?id=645069

Original issue's description:
> Setting up an RTP input fuzzer for NetEq
>
> This CL introduces a new fuzzer target neteq_rtp_fuzzer that
> manipulates the RTP header fields before inserting the packets into
> NetEq. A few helper classes are also introduced.
>
> BUG=webrtc:5447
> NOTRY=True
>
> Committed: https://crrev.com/2d273f1e97cd5030ed1686f27ce1118291b66395
> Cr-Commit-Position: refs/heads/master@{#14103}

TBR=ivoc@webrtc.org,kjellander@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5447

Review-Url: https://codereview.webrtc.org/2328483002
Cr-Commit-Position: refs/heads/master@{#14131}
2016-09-08 12:00:41 +00:00
ehmaldonado
4016a0b2e8 GN: Move variables from //build_overrides/webrtc.gni to //webrtc/build/webrtc.gni
There is no clear reason to have them in build_overrides, and
webrtc/build seems to be a better place.

Also, delete build_overrides/webrtc.gni

NOTRY=True
BUG=webrtc:5949

Review-Url: https://codereview.webrtc.org/2309253004
Cr-Commit-Position: refs/heads/master@{#14108}
2016-09-07 13:50:23 +00:00
Danil Chapovalov
08b0351ddd Implement PlayoutDelay extension as a trait
to be used with rtp::Packet class

BUG=webrtc:1994
R=isheriff@chromium.org, stefan@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#14105}
2016-09-07 13:08:20 +00:00
henrik.lundin
2d273f1e97 Setting up an RTP input fuzzer for NetEq
This CL introduces a new fuzzer target neteq_rtp_fuzzer that
manipulates the RTP header fields before inserting the packets into
NetEq. A few helper classes are also introduced.

BUG=webrtc:5447
NOTRY=True

Review-Url: https://codereview.webrtc.org/2315633002
Cr-Commit-Position: refs/heads/master@{#14103}
2016-09-07 12:57:34 +00:00
ehmaldonado
e9cc686293 GN Templates: Move common_inherited_config to the template.
Remove common_inherited_config from the targets and add it to the
template instead.

BUG=webrtc:6187
NOTRY=True

Review-Url: https://codereview.webrtc.org/2311843002
Cr-Commit-Position: refs/heads/master@{#14069}
2016-09-05 13:10:23 +00:00
ehmaldonado
38a2132b02 GN: Introduce templates.
Defines the rtc_executable, rtc_source_set, rtc_test and
rtc_static_library templates.

These templates provide no functionality yet, but will enable common
configuration to be introduced, avoiding repetition in every target

Changes summary:
- Prepend rtc_ to test, source_set, executable and static_library targets
- Change "configs -= [" to "suppressed_configs += ["
- Include webrtc/build/webrtc.gni where it wasn't included yet
- Delete import("//testing/test.gni"), since rtc_test makes it unnecessary.

BUG=webrtc:6187
TBR=henrik.lundin@webrtc.org,tommi@webrtc.org
NOTRY=True

Review-Url: https://codereview.webrtc.org/2301053002
Cr-Commit-Position: refs/heads/master@{#14043}
2016-09-02 11:10:41 +00:00
brandtr
74811e5fa3 Style updates to ProducerFec/FecReceiver.
- Make more use of std::unique_ptr.
- Auto type deduction for iterator type names.
- More extensive comments.
- Variable renaming.
- Make ProducerFec::BuildRedPacket() static.
- Avoid dynamic allocation of ProducerFec::fec_.

BUG=webrtc:5654

Review-Url: https://codereview.webrtc.org/2110763002
Cr-Commit-Position: refs/heads/master@{#13700}
2016-08-10 07:51:59 +00:00
Stefan Holmer
13181035bc Reland: Add BWE plot to event log analyzer.
The plot is constructed by actually running the congestion controller with
the logged rtp headers and rtcp feedback messages to reproduce the same behavior
as in the real call.

R=phoglund@webrtc.org, terelius@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13574}
2016-07-29 12:49:04 +00:00
terelius
59c1ad58e6 Revert of Add BWE plot to event log analyzer. (patchset #6 id:100001 of https://codereview.webrtc.org/2188033004/ )
Reason for revert:
Breaks downstream targets.

Original issue's description:
> Add BWE plot to event log analyzer.
>
> The plot is constructed by actually running the congestion controller with
> the logged rtp headers and rtcp feedback messages to reproduce the same behavior
> as in the real call.
>
> R=phoglund@webrtc.org, terelius@webrtc.org
>
> Committed: https://crrev.com/2beea2a8c920000ef19eea20cce397507fc3d5e7
> Cr-Commit-Position: refs/heads/master@{#13558}

TBR=phoglund@webrtc.org,stefan@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.webrtc.org/2190013002
Cr-Commit-Position: refs/heads/master@{#13559}
2016-07-28 16:21:32 +00:00
Stefan Holmer
2beea2a8c9 Add BWE plot to event log analyzer.
The plot is constructed by actually running the congestion controller with
the logged rtp headers and rtcp feedback messages to reproduce the same behavior
as in the real call.

R=phoglund@webrtc.org, terelius@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13558}
2016-07-28 15:42:31 +00:00
stefan
bded44b79b Add a CongestionController fuzzer.
BUG=

Review-Url: https://codereview.webrtc.org/2157783002
Cr-Commit-Position: refs/heads/master@{#13497}
2016-07-18 16:26:15 +00:00
katrielc
44905cf49f Add a fuzzer for the pseudoTCP implementation used by chromoting. This
found chromium:620694.

Unfortunately it depends on unsafe GN targets, so do not build in
Chromium.

NOTRY=true

Review-Url: https://codereview.webrtc.org/2129603003
Cr-Commit-Position: refs/heads/master@{#13407}
2016-07-07 12:52:29 +00:00
katrielc
1d4fefbbaf Reland of https://codereview.webrtc.org/2044523002.
Landing these in WebRTC under a guard so they don't build in
Chromium. The guard can be removed once Chromium has migrated to use the
new GN targets.

BUG=webrtc:6081
NOTRY=true

Review-Url: https://codereview.webrtc.org/2117183005
Cr-Commit-Position: refs/heads/master@{#13397}
2016-07-06 15:02:09 +00:00
katrielc
262ba77d78 Add fuzzer for TURN unwrap.
This is called on received network packets if dump_rtp_packets_ is on.

NOTRY=true

Review-Url: https://codereview.webrtc.org/2126463002
Cr-Commit-Position: refs/heads/master@{#13394}
2016-07-06 12:59:34 +00:00
katrielc
36a321d2e3 Update the current RTP parser fuzzer to handle header extensions.
This changes the corpus semantics, but libfuzzer should be smart enough to figure it out, and if not then we can add a seed_corpus to help.

BUG=webrtc:4771
NOTRY=true

Review-Url: https://codereview.webrtc.org/2072473002
Cr-Commit-Position: refs/heads/master@{#13384}
2016-07-05 14:20:30 +00:00
katrielc
d4bcdad263 Add a libfuzzer for RtpHeaderParser.
NOTRY=true

Review-Url: https://codereview.webrtc.org/2062103002
Cr-Commit-Position: refs/heads/master@{#13271}
2016-06-23 10:50:43 +00:00
katrielc
bddc94bca2 Add fuzzer corpora.
- RTP and RTCP corpora for existing fuzzers
  - STUN/SDP/pseudotcp for upcoming ones
  - STUN/SDP tokens as well

NOTRY=true

Review-Url: https://codereview.webrtc.org/2082943002
Cr-Commit-Position: refs/heads/master@{#13253}
2016-06-22 13:43:30 +00:00
katrielc
839315beca Use the Chromium libfuzzer template instead of rolling our own.
This lets us use their fancy features, including seed_corpus which is
super handy.

NOTRY=true

Review-Url: https://codereview.webrtc.org/2081683002
Cr-Commit-Position: refs/heads/master@{#13216}
2016-06-20 13:04:01 +00:00
katrielc
81ca73586e Remove new fuzzers until their GN targets work properly in Chromium.
Chromium uses gn gen --check, which doesn't like some of the includes
used in the new gn targets the fuzzers use. This breaks Chromium
libfuzzer compiles, for which there isn't yet a webrtc FYI bot.

I'm working on fixing the includes, at which point these can come back.

BUG=chromium:618901
NOTRY=true

Review-Url: https://codereview.webrtc.org/2053293002
Cr-Commit-Position: refs/heads/master@{#13098}
2016-06-10 09:59:46 +00:00
Peter Boström
555cfe9e6e Use relative paths for api/p2p fuzzers.
BUG=
R=aizatsky@chromium.org
TBR=katrielc@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13095}
2016-06-09 21:25:25 +00:00
katrielc
7b496e026b Add fuzzers for SDP and STUN parsing.
The STUN fuzzer is split into two parts: validation and parsing. The
latter should be able to handle invalid packets instead of assuming
the validation deals with them, since an adversary could set a valid
HMAC on an invalid packet.

NOTRY=true

Review-Url: https://codereview.webrtc.org/2044523002
Cr-Commit-Position: refs/heads/master@{#13050}
2016-06-06 16:45:32 +00:00
katrielc
e1e951f965 Allow fuzzers to depend on anything, since they want access to as many targets as possible.
NOTRY=true

Review-Url: https://codereview.webrtc.org/2046493002
Cr-Commit-Position: refs/heads/master@{#13048}
2016-06-06 15:05:03 +00:00
kwiberg
abe95ba323 AudioDecoderIsacT: Require caller to always specify sample rate
This gets rid of the complex & icky state where the sample rate is not
yet determined.

BUG=webrtc:5801

Review-Url: https://codereview.webrtc.org/2020353003
Cr-Commit-Position: refs/heads/master@{#13011}
2016-06-02 09:59:02 +00:00
kwiberg
bfefb03ec1 Replace scoped_ptr with unique_ptr everywhere
But keep #including scoped_ptr.h in .h files, so as not to break
WebRTC users who expect those .h files to give them rtc::scoped_ptr.

BUG=webrtc:5520

Review-Url: https://codereview.webrtc.org/1937693002
Cr-Commit-Position: refs/heads/master@{#12581}
2016-05-01 21:53:55 +00:00
Peter Boström
d6b9d772c2 Fix producer_fec_fuzzer.
A field was removed from FecProtectionParams in
https://codereview.webrtc.org/1917083003.

BUG=webrtc:5066
R=turaj@webrtc.org, turajs@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#12518}
2016-04-26 22:18:52 +00:00
danilchap
1edb7ab7bd RtpPacket class introduced.
BUG=webrtc:1994, webrtc:5261

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

Cr-Commit-Position: refs/heads/master@{#12444}
2016-04-20 12:25:19 +00:00
Peter Boström
ba3e25e502 Simple RTCP receiver fuzzer.
Doesn't utilize the clock or any callbacks out of the receiver but
should still be useful to test input packet parsing.

BUG=webrtc:4771
R=danilchap@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#11717}
2016-02-23 10:35:41 +00:00
henrik.lundin
fd2be2718d Fuzzer tests for AudioDecoder's DecodeRedundant and IncomingPacket
This CL adds new fuzzer tests for the DecodeRedundant and
IncomingPacket methods of AudioDecoder. In practice, only Opus has
DecodeRedundant, and only iSAC has IncomingPacket. Did some minor work
to generalize the helper function reading values from the fuzzed
input.

BUG=webrtc:5306
R=pbos@webrtc.org
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#11533}
2016-02-09 08:00:32 +00:00
Peter Boström
2ab815779c Remove implicit downcast in producer_fec_fuzzer.cc.
Speculative fix for DrFuzz.

BUG=
TBR=stefan@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#11465}
2016-02-02 21:31:11 +00:00
Peter Boström
f5b804bb9c Fix implicit bool casts in producer_fec_fuzzer.cc.
Fixes DrFuzz breakage on Windows.

BUG=webrtc:5473
TBR=zhaoqin@google.com

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

Cr-Commit-Position: refs/heads/master@{#11426}
2016-01-29 15:26:52 +00:00