Commit Graph

854 Commits

Author SHA1 Message Date
087bd34d23 Move AudioDecoder and related stuff to the api/ directory
BUG=webrtc:5805, webrtc:6725

Review-Url: https://codereview.webrtc.org/2668523004
Cr-Commit-Position: refs/heads/master@{#16534}
2017-02-10 16:15:44 +00:00
b10f32f9b2 Adding more comments to every header file in api/ subdirectory.
Many of these interfaces are not intuitive, or are the way they are for
complex historical reasons, so it would be nice to document these things
for future developers.

Also, many nonstandard things (such as RTCConfiguration options) were
not documented at all before this CL.

BUG=webrtc:7131
TBR=pthatcher@webrtc.org
NOTRY=True

Review-Url: https://codereview.webrtc.org/2680273002
Cr-Commit-Position: refs/heads/master@{#16485}
2017-02-08 09:38:21 +00:00
ed02c6d68f Revert of RTCInboundRTPStreamStats.qpSum collected. (patchset #4 id:80001 of https://codereview.webrtc.org/2675943002/ )
Reason for revert:
Breaks downstream build.

Original issue's description:
> RTCInboundRTPStreamStats.qpSum collected.
>
> This was previously only collected for local tracks
> (RTCOutboundRTPStreamStats.qpSum).
>
> Spec: https://w3c.github.io/webrtc-stats/#dom-rtcrtpstreamstats-qpsum
>
> This CL also improves some testing in rtcstatscollector_unittest.cc.
> Default and non-default values are tested in the same unittests,
> removing the test that was specific to default-values, which was
> otherwise code duplication.
>
> BUG=webrtc:7065
>
> Review-Url: https://codereview.webrtc.org/2675943002
> Cr-Commit-Position: refs/heads/master@{#16477}
> Committed: cd195bea5e

TBR=sakal@webrtc.org,hta@webrtc.org,hbos@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7065

Review-Url: https://codereview.webrtc.org/2687483002 .
Cr-Commit-Position: refs/heads/master@{#16479}
2017-02-07 18:45:31 +00:00
cd195bea5e RTCInboundRTPStreamStats.qpSum collected.
This was previously only collected for local tracks
(RTCOutboundRTPStreamStats.qpSum).

Spec: https://w3c.github.io/webrtc-stats/#dom-rtcrtpstreamstats-qpsum

This CL also improves some testing in rtcstatscollector_unittest.cc.
Default and non-default values are tested in the same unittests,
removing the test that was specific to default-values, which was
otherwise code duplication.

BUG=webrtc:7065

Review-Url: https://codereview.webrtc.org/2675943002
Cr-Commit-Position: refs/heads/master@{#16477}
2017-02-07 16:31:27 +00:00
2bc6864278 Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.

Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: 83399caec5
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: 35fc2aa82f

TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953

Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 15:02:22 +00:00
338f78ac95 RTCIceCandidatePairStats.available[Outgoing/Incoming]Bitrate collected.
Collected for current pairs, undefined for other pairs. This is the
same as the old stats' VideoBwe.googAvailable[Send/Receive]Bandwidth.

NOTE: The value this is based on for incoming bitrate is not set. This
CL wires it up but has a TODO that the incoming bitrate needs to be
collected properly. (Same problem for both old and new stats.)

Spec: https://w3c.github.io/webrtc-stats/#dom-rtcicecandidatepairstats-availableoutgoingbitrate
Discussion: https://github.com/w3c/webrtc-stats/issues/112#issuecomment-277167781

BUG=webrtc:7062

Review-Url: https://codereview.webrtc.org/2675923002
Cr-Commit-Position: refs/heads/master@{#16472}
2017-02-07 14:41:21 +00:00
3443bb75a0 RTCRTPStreamStats.ssrc changed type to uint32_t.
As per PR: https://github.com/w3c/webrtc-stats/pull/157

BUG=webrtc:7065, webrtc:7066

Review-Url: https://codereview.webrtc.org/2675583003
Cr-Commit-Position: refs/heads/master@{#16471}
2017-02-07 14:28:11 +00:00
585a9b191c Refactor and clean-up relating to RTCCodecStats.
Refactor how |codec_id| is set, remove outdated TODO, update comments
with new bugs IDs.

BUG=webrtc:7061

Review-Url: https://codereview.webrtc.org/2670343002
Cr-Commit-Position: refs/heads/master@{#16467}
2017-02-07 12:59:16 +00:00
e702b30fec Adding C++ versions of currently spec'd "RtpParameters" structs.
These structs will be used for ORTC objects (and their WebRTC
equivalents).

This CL also introduces some minor changes to the existing implemented
structs:

- max_bitrate_bps uses rtc::Optional instead of "-1 means unset"
- "mime_type" turned into "name"/"kind" (which can be used to form the
  MIME type string, if needed).
- clock_rate and channels changed to rtc::Optional, since they will
  need to be for RtpSender.send().
- Renamed "channels" to "num_channels" (the ORTC name, which I prefer).

BUG=webrtc:7013, webrtc:7112

Review-Url: https://codereview.webrtc.org/2651883010
Cr-Commit-Position: refs/heads/master@{#16437}
2017-02-04 20:09:01 +00:00
5107246d4b Allow applications to limit the ICE check rate through RTCConfiguration
If an application sets a non-null value in RTCConfiguration.iceCheckMinInterval, we do not sent STUN pings more often than that. This is useful for bandwidth constrained scenarios.

This CL also increases the maximum STUN ping timeout to 60 seconds up from its previous value of 5 (which meant that a ping response received 5 seconds later would not be counted), and allows the RTT estimate to go up to 60 seconds from its previous limit of 3. RTTs above 3 seconds are possible on mobile links. (webrtc:7109)

This CL was originally written by pthatcher@, I am just submitting it after a minor cleanup.

BUG=webrtc:7082, webrtc:7109

Review-Url: https://codereview.webrtc.org/2670053002
Cr-Commit-Position: refs/heads/master@{#16421}
2017-02-02 19:50:14 +00:00
20cb0c1c85 Move DTMF sender to RtpSender (as opposed to WebRtcSession).
Previously in the spec, there was a createDtmfSender method on
PeerConnection, but that's been replaced by a "dtmf" attribute
on RtpSender, which allows getting a DTMF sender without having
an audio track.

This also simplifies the code slightly, since tracks are now not
necessary for identification.

BUG=webrtc:4180

Review-Url: https://codereview.webrtc.org/2666853002
Cr-Commit-Position: refs/heads/master@{#16409}
2017-02-02 04:27:00 +00:00
35fc2aa82f Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
Reason for revert:
due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)

Original issue's description:
> Drop frames until specified bitrate is achieved.
>
> This CL fixes a regression introduced with the new quality scaler
> where the video would no longer start in a scaled mode. This CL adds
> code that compares incoming captured frames to the target bitrate,
> and if they are found to be too large, they are dropped and sinkWants
> set to a lower resolution. The number of dropped frames should be low
> (0-4 in most cases) and should not introduce a noticeable delay, or
> at least should be preferrable to having the first 2-4 seconds of video
> have very low quality.
>
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2630333002
> Cr-Commit-Position: refs/heads/master@{#16391}
> Committed: 83399caec5

TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6953

Review-Url: https://codereview.webrtc.org/2666303002
Cr-Commit-Position: refs/heads/master@{#16395}
2017-02-01 11:14:00 +00:00
803dc29bb6 Enable cpplint and fix cpplint errors in webrtc/api
Adding 'explicit' to these constructors has a low risk of causing
compatibility problems:
explicit RTCConfiguration(RTCConfigurationType type)
explicit IdBase(StatsType type)

BUG=webrtc:5267
TESTED=Fixed issues reported by:
find webrtc/api -type f -name *.cc -o -name *.h | xargs cpplint.py
followed by 'git cl presubmit'.

Review-Url: https://codereview.webrtc.org/2663063003
Cr-Commit-Position: refs/heads/master@{#16392}
2017-02-01 09:55:59 +00:00
83399caec5 Drop frames until specified bitrate is achieved.
This CL fixes a regression introduced with the new quality scaler
where the video would no longer start in a scaled mode. This CL adds
code that compares incoming captured frames to the target bitrate,
and if they are found to be too large, they are dropped and sinkWants
set to a lower resolution. The number of dropped frames should be low
(0-4 in most cases) and should not introduce a noticeable delay, or
at least should be preferrable to having the first 2-4 seconds of video
have very low quality.

BUG=webrtc:6953

Review-Url: https://codereview.webrtc.org/2630333002
Cr-Commit-Position: refs/heads/master@{#16391}
2017-02-01 09:31:52 +00:00
1e4e8cb43d Add CreatePeerConnectionFactory overloads that take audio codec factory args
BUG=5805

Review-Url: https://codereview.webrtc.org/2653343003
Cr-Commit-Position: refs/heads/master@{#16371}
2017-01-31 09:48:08 +00:00
1c0dea8675 Delete VideoFrame::set_render_time_ms.
Also mark the render_time_ms getter function and the ntp timestamp
as deprecated.

BUG=webrtc:6977

Review-Url: https://codereview.webrtc.org/2633493002
Cr-Commit-Position: refs/heads/master@{#16354}
2017-01-30 10:43:18 +00:00
b0ae920fad RTCRTPStreamStats.mediaTrackId renamed to trackId.
According to spec change:
https://github.com/w3c/webrtc-stats/pull/142

BUG=webrtc:7064, chromium:685655

Review-Url: https://codereview.webrtc.org/2619353007
Cr-Commit-Position: refs/heads/master@{#16326}
2017-01-27 14:35:16 +00:00
7d2542623a Delete unneeded includes of base/common.h.
Bulk of the changes were done using

   git grep -l '#include "webrtc/base/common.h"' | \
     xargs sed -i '\,^#include.*webrtc/base/common\.h,d'

followed by adding back the include in the few places where it is
still needed, and in one case (pseudotcp.cc) instead deleting its use
of RTC_UNUSED.

BUG=webrtc:6424

Review-Url: https://codereview.webrtc.org/2644103002
Cr-Commit-Position: refs/heads/master@{#16263}
2017-01-25 09:47:24 +00:00
a388310af2 Added api/webrtcsdp.h forwarding header to work around upstream projects.
NOTRY=true  # Small change, in a hurry and msan is being slow
TBR=tommi@webrtc.org
BUG=webrtc:5883

Review-Url: https://codereview.webrtc.org/2653703004
Cr-Commit-Position: refs/heads/master@{#16248}
2017-01-24 15:13:59 +00:00
9aa3f0a200 Reland of Moving webrtc.gni up one level from build/ (patchset #1 id:1 of https://codereview.webrtc.org/2657563002/ )
Reason for revert:
Starting to work on a fix (it seems that there are third_party dependencies that depends on the path to the webrtc.gni file)

Original issue's description:
> Revert of Moving webrtc.gni up one level from build/ (patchset #1 id:1 of https://codereview.webrtc.org/2651543003/ )
>
> Reason for revert:
> This was causing the following failure: https://build.chromium.org/p/chromium.webrtc.fyi/builders/Android%20Builder/builds/838/steps/generate_build_files/logs/stdio
>
> Original issue's description:
> > Moving webrtc.gni up one level from build/
> >
> > BUG=webrtc:7030
> >
> > Review-Url: https://codereview.webrtc.org/2651543003
> > Cr-Commit-Position: refs/heads/master@{#16241}
> > Committed: 35a32700fc
>
> TBR=kjellander@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7030
>
> Review-Url: https://codereview.webrtc.org/2657563002
> Cr-Commit-Position: refs/heads/master@{#16244}
> Committed: 69dc7dbe24

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

Review-Url: https://codereview.webrtc.org/2654773002
Cr-Commit-Position: refs/heads/master@{#16247}
2017-01-24 14:58:22 +00:00
69dc7dbe24 Revert of Moving webrtc.gni up one level from build/ (patchset #1 id:1 of https://codereview.webrtc.org/2651543003/ )
Reason for revert:
This was causing the following failure: https://build.chromium.org/p/chromium.webrtc.fyi/builders/Android%20Builder/builds/838/steps/generate_build_files/logs/stdio

Original issue's description:
> Moving webrtc.gni up one level from build/
>
> BUG=webrtc:7030
>
> Review-Url: https://codereview.webrtc.org/2651543003
> Cr-Commit-Position: refs/heads/master@{#16241}
> Committed: 35a32700fc

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

Review-Url: https://codereview.webrtc.org/2657563002
Cr-Commit-Position: refs/heads/master@{#16244}
2017-01-24 13:14:35 +00:00
35a32700fc Moving webrtc.gni up one level from build/
BUG=webrtc:7030

Review-Url: https://codereview.webrtc.org/2651543003
Cr-Commit-Position: refs/heads/master@{#16241}
2017-01-24 12:49:35 +00:00
da25006431 Fixed public_deps for libjingle_peerconnection{,_api}
https://codereview.webrtc.org/2514883002/ changed and moved these targets around but did not add public dependencies for the fallbacks, which causes gn gen --check a lot of anger.

NOTRY=true # Only build changes and windows bots are cranky atm.
BUG=webrtc:5806

Review-Url: https://codereview.webrtc.org/2651663002
Cr-Commit-Position: refs/heads/master@{#16214}
2017-01-23 15:37:43 +00:00
50cfe1fda7 RTCMediaStreamTrackStats.framesDropped collected by RTCStatsCollector.
Spec: https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamtrackstats-framesdropped
Implemented as frames_received - frames_rendered.

Part of this CL is adding frames_rendered to VideoReceiveStream::Stats
and updating it at ReceiveStatisticsProxy::OnRenderedFrame.

BUG=webrtc:6757, chromium:659137, chromium:627816
NOTRY=True

Review-Url: https://codereview.webrtc.org/2607933002
Cr-Commit-Position: refs/heads/master@{#16213}
2017-01-23 15:21:55 +00:00
7bb87ee4e8 Create //webrtc/api:libjingle_peerconnection_api + refactorings.
Create a new target //webrtc/api:libjingle_peerconnection_api and start moving
things into it. Move remaining parts of //webrtc/api:libjingle_peerconnection
to //webrtc/pc:libjingle_peerconnection.

Moved the RTCStatsCollectorCallback into its own header file, so that
PeerConnectionInterface can include that instead of pulling in
RTCStatsCollector and PeerConnection and everything.

Separated cricket::MediaType into its own header/source set, so that it
can be used in the api.

BUG=webrtc:5883

Review-Url: https://codereview.webrtc.org/2514883002
Cr-Commit-Position: refs/heads/master@{#16210}
2017-01-23 12:56:25 +00:00
8662f94023 Only set certificate on DTLS transport if fingerprint is found in SDP.
This is used for fallback from DTLS to SDES encryption, which we probably still
want to support. Setting a certificate puts the DTLS transport in a "DTLS
enabled" mode, so it should be delayed until SDP with "a=fingerprint" is set.

BUG=webrtc:6972

Review-Url: https://codereview.webrtc.org/2641633002
Cr-Commit-Position: refs/heads/master@{#16199}
2017-01-21 05:20:51 +00:00
f33491ebaf Revert of Removing #defines previously used for building without BoringSSL/OpenSSL. (patchset #2 id:20001 of https://codereview.webrtc.org/2640513002/ )
Reason for revert:
Broke chromium build, due to a config being removed. Will add it back and remove the dependency in a chromium CL.

Original issue's description:
> Removing #defines previously used for building without BoringSSL/OpenSSL.
>
> These defines don't work any more, so they only cause confusion:
>
> FEATURE_ENABLE_SSL
> HAVE_OPENSSL_SSL_H
> SSL_USE_OPENSSL
>
> BUG=webrtc:7025
>
> Review-Url: https://codereview.webrtc.org/2640513002
> Cr-Commit-Position: refs/heads/master@{#16196}
> Committed: eaa826c2ee

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

Review-Url: https://codereview.webrtc.org/2648003003
Cr-Commit-Position: refs/heads/master@{#16197}
2017-01-21 01:01:45 +00:00
eaa826c2ee Removing #defines previously used for building without BoringSSL/OpenSSL.
These defines don't work any more, so they only cause confusion:

FEATURE_ENABLE_SSL
HAVE_OPENSSL_SSL_H
SSL_USE_OPENSSL

BUG=webrtc:7025

Review-Url: https://codereview.webrtc.org/2640513002
Cr-Commit-Position: refs/heads/master@{#16196}
2017-01-20 23:15:58 +00:00
7bcdb69957 Ignore ufrag/password in "a=candidate" lines in SDP.
These attributes should be parsed in candidate trickling, but when
parsing a full session description, only "a=ice-ufrag"/"a=ice-pwd"
should be used to communicate the ufrag/password.

BUG=chromium:681286

Review-Url: https://codereview.webrtc.org/2639183002
Cr-Commit-Position: refs/heads/master@{#16194}
2017-01-20 20:43:58 +00:00
f64941f1a5 RTCMediaStreamTrackStats.framesDecoded collected.
According to spec:
https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamtrackstats-framesdecoded

BUG=webrtc:6757, chromium:659137, chromium:627816

Review-Url: https://codereview.webrtc.org/2642713004
Cr-Commit-Position: refs/heads/master@{#16192}
2017-01-20 15:39:09 +00:00
fefe076789 RTCMediaStreamTrackStats.framesSent collected by RTCStatsCollector.
BUG=webrtc:6757, chromium:659137, chromium:627816

Review-Url: https://codereview.webrtc.org/2606033002
Cr-Commit-Position: refs/heads/master@{#16188}
2017-01-20 14:14:25 +00:00
2d4d653e1f Fix msan flake in rtcstats_integrationtest.cc.
This CL https://codereview.webrtc.org/2641763003 changed echo return
loss /...enhancement stats from being optional to being undefined
because that was the observed behavior (and a TODO was added to
investigate why).

It turns out that these stats are sometimes available, e.g. if the test
runs for a while like MSAN bot does, so this turned the test flaky.
Example failure:
https://build.chromium.org/p/client.webrtc/builders/Linux%20MSan/builds/8242

This CL reverts that change without reverting the rest of the CL which
other CLs depend on, and updates the TODO.

BUG=chromium:627816
TBR=hta@webrtc.org
NOTRY=True
NOPRESUBMIT=True

Review-Url: https://codereview.webrtc.org/2640743007
Cr-Commit-Position: refs/heads/master@{#16187}
2017-01-20 12:16:41 +00:00
42f6d2fb6c RTCMediaStreamTrackStats.framesReceived collected by RTCStatsCollector.
VideoReceiverInfo::frames_received added based on
VideoReceiveStream::Stats::frame_counts (.key_frames + .delta_frames).

BUG=webrtc:6757, chromium:659137, chromium:627816

Review-Url: https://codereview.webrtc.org/2607913002
Cr-Commit-Position: refs/heads/master@{#16185}
2017-01-20 11:56:50 +00:00
9e30274c03 RTCMediaStreamTrackStats collected on a per-attachment basis.
According to recent spec change:
https://github.com/w3c/webrtc-stats/pull/138/files

This establishes the relationship between tracks and
[Voice/Video][Sender/Receiver]Info(s). Follow-up CLs will easily be able
to collect more stats from them.

BUG=webrtc:6757, chromium:659137, chromium:627816

Review-Url: https://codereview.webrtc.org/2641763003
Cr-Commit-Position: refs/heads/master@{#16181}
2017-01-20 10:47:10 +00:00
b2cdd93fd6 Remove the dependency of TransportChannel and TransportChannelImpl.
DtlsTransportChannelWrapper is renamed to be DtlsTransport which inherits from
DtlsTransportInternal. There will be no concept of "channel" in p2p level.
Both P2PTransportChannel and DtlsTransport don't depend on TransportChannel
and TransportChannelImpl any more and they are removed in this CL.

BUG=none

Review-Url: https://codereview.webrtc.org/2606123002
Cr-Commit-Position: refs/heads/master@{#16173}
2017-01-20 00:54:25 +00:00
6ce9259cb0 Revert of make the DtlsTransportWrapper inherit form DtlsTransportInternal (patchset #11 id:320001 of https://codereview.webrtc.org/2606123002/ )
Reason for revert:
Failed the memory check.
May need to fix the memory leak.

Original issue's description:
> make the DtlsTransportWrapper inherit form DtlsTransportInternal
>
> BUG=none
>
> Review-Url: https://codereview.webrtc.org/2606123002
> Cr-Commit-Position: refs/heads/master@{#16160}
> Committed: 5aed06c8d3

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

Review-Url: https://codereview.webrtc.org/2639203004
Cr-Commit-Position: refs/heads/master@{#16162}
2017-01-19 12:49:47 +00:00
5aed06c8d3 make the DtlsTransportWrapper inherit form DtlsTransportInternal
BUG=none

Review-Url: https://codereview.webrtc.org/2606123002
Cr-Commit-Position: refs/heads/master@{#16160}
2017-01-19 09:48:02 +00:00
d1c0998730 Adding OrtcFactory, and changing UdpTransport to match current plan.
The factory follows the same principles as PeerConnectionFactory;
various modules can be passed into its constructor but default
implementations are provided. Currently the only object the factory can
create is a UdpTransport (need to start somewhere).

UdpTransportChannel (renamed to UdpTransport)
will now accept a socket passed into its constructor,
relying on the factory to create the socket. This allows some
simplifications to be made, such as getting rid of "State" since the
only states are now "has destination set or doesn't".

BUG=webrtc:7013

Review-Url: https://codereview.webrtc.org/2632613002
Cr-Commit-Position: refs/heads/master@{#16154}
2017-01-18 23:16:37 +00:00
d99a200fad Adding some features to proxy.h, and restructuring the macros.
New features are:
- Invoke a destructor on the worker thread.
- Make proxy wrapper for a non-refcounted object.
- Ability to use unique_ptrs (as arguments or return values).

These features are needed by this CL:
https://codereview.webrtc.org/2632613002/

BUG=None

Review-Url: https://codereview.webrtc.org/2628343003
Cr-Commit-Position: refs/heads/master@{#16151}
2017-01-18 16:55:23 +00:00
c8ee882753 Replace use of ASSERT in test code.
In top level test functions, replaced with gtest ASSERT_*. In helper
methods in main test files, replaced with EXPECT_* or RTC_DCHECK on a
case-by-case basis.

In separate mock/fake classes used by tests (which might be of some
use also in tests of third-party applications), ASSERT was replaced
with RTC_CHECK, using

  git grep -l ' ASSERT(' | grep -v common.h | \
    xargs sed -i 's/ ASSERT(/ RTC_CHECK(/'

followed by additional includes of base/checks.h in affected files,
and git cl format.

BUG=webrtc:6424

Review-Url: https://codereview.webrtc.org/2622413005
Cr-Commit-Position: refs/heads/master@{#16150}
2017-01-18 15:20:55 +00:00
6da303db1d Reland of Delete rtc::linked_ptr. (patchset #1 id:1 of https://codereview.webrtc.org/2579753002/ )
Only use, in statstypes.h, replaced by rtc::scoped_refptr.

Reason for revert:
Intend to switch from unique_ptr to scoped_refptr,
and then reland.

Original issue's description:
> Revert of Delete rtc::linked_ptr. Only use, in statstypes.h, replaced bu std::unique_ptr. (patchset #1 id:1 of https://codereview.webrtc.org/2581663002/ )
>
> Reason for revert:
> This change broke Chrome too. It's stats processing wants to make a copy of webrtc's stats mapping, which is no longer possible with std::unique_ptr.
>
> Original issue's description:
> > Reland of Delete rtc::linked_ptr. Only use, in statstypes.h, replaced bu std::unique_ptr. (patchset #1 id:1 of https://codereview.webrtc.org/2576673002/ )
> >
> > Reason for revert:
> > Downstream project fixed to not make copies while iterating over the stats mapping.
> >
> > Original issue's description:
> > > Revert of Delete rtc::linked_ptr. Only use, in statstypes.h, replaced bu std::unique_ptr. (patchset #1 id:1 of https://codereview.webrtc.org/2567143003/ )
> > >
> > > Reason for revert:
> > > The change from rtc::linked_ptr to std::unique_ptr broke a downstream project.
> > >
> > > Original issue's description:
> > > > Delete rtc::linked_ptr. Only use, in statstypes.h, replaced with std::unique_ptr.
> > > >
> > > > BUG=webrtc:6424
> > > >
> > > > Committed: https://crrev.com/36f74e55792cae19db8b222c29aa38d6e0eb1225
> > > > Cr-Commit-Position: refs/heads/master@{#15588}
> > >
> > > TBR=solenberg@webrtc.org,pthatcher@webrtc.org,hta@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:6424
> > >
> > > Committed: https://crrev.com/8afbc8cba65d99bb7a0feece8fb3055b144106b1
> > > Cr-Commit-Position: refs/heads/master@{#15589}
> >
> > TBR=solenberg@webrtc.org,pthatcher@webrtc.org,hta@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:6424
> >
> > Committed: https://crrev.com/06035cf53abad80b0525f286a3b81e388cc7ee00
> > Cr-Commit-Position: refs/heads/master@{#15627}
>
> TBR=solenberg@webrtc.org,pthatcher@webrtc.org,hta@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6424
>
> Committed: https://crrev.com/6a58f33450a46370039cd82537612040a91165b3
> Cr-Commit-Position: refs/heads/master@{#15629}

TBR=solenberg@webrtc.org,pthatcher@webrtc.org,hta@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6424

Review-Url: https://codereview.webrtc.org/2641793002
Cr-Commit-Position: refs/heads/master@{#16148}
2017-01-18 14:10:54 +00:00
e8abe3ef1b Revert of New method StatsObserver::OnCompleteReports, passing ownership. (patchset #2 id:20001 of https://codereview.webrtc.org/2584553002/ )
Reason for revert:
The new method doesn't work as intended.

It can't pass ownership, because the StatsReports is a vector of raw pointers to StatReport objects owned by the StatsCollector.

Original issue's description:
> New method StatsObserver::OnCompleteReports, passing ownership.
>
> The new name, OnCompleteReports rather than OnComplete, is needed
> because in C++ method lookup, overriding a method hides all otherwise
> inherited methods with the same name, even if they have a different
> signature. And here, the intention is that each subclass should
> override one or the other of the two methods, and inherit the method it
> doesn't override.
>
> This cl is a prerequisite for
> https://codereview.webrtc.org/2567143003/, because the Chrome glue
> code needs to retain the stats report after the OnComplete method has
> returned.
>
> Currently, Chrome makes a copy of the stats mapping (which breaks when
> changing ValuePtr from an rtc::linked_ptr to an std::unique_ptr). After
> this cl, Chrome can be fixed to take ownership and no longer needs to
> copy anything, unblocking cl 2567143003.
>
> BUG=webrtc:6424
>
> Review-Url: https://codereview.webrtc.org/2584553002
> Cr-Commit-Position: refs/heads/master@{#15708}
> Committed: b36ee8d498

TBR=solenberg@webrtc.org,magjed@webrtc.org,tkchin@webrtc.org,hbos@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6424

Review-Url: https://codereview.webrtc.org/2641783002
Cr-Commit-Position: refs/heads/master@{#16144}
2017-01-18 13:00:34 +00:00
bad5dadef3 More minor improvements to BaseChannel/transport code.
Mostly from late comments on this CL:
https://codereview.webrtc.org/2614263002/

Changes SetTransport to DCHECK instead of returning false.
Renames it to SetTransports.
Fixes some possible transport resource leaks.

BUG=None

Review-Url: https://codereview.webrtc.org/2637503003
Cr-Commit-Position: refs/heads/master@{#16130}
2017-01-18 02:32:35 +00:00
160e4a78e3 RTCMediaStreamTrackStats.kind added and collected.
Implements recent spec change:
https://github.com/w3c/webrtc-stats/pull/127

BUG=chromium:659137, chromium:627816

Review-Url: https://codereview.webrtc.org/2623513006
Cr-Commit-Position: refs/heads/master@{#16111}
2017-01-17 10:53:23 +00:00
04a057b432 Add missing if-clause for residual_echo_likelihood_recent_max
This is a follow-up to https://codereview.webrtc.org/2629563003/.

BUG=webrtc:6797
TBR=solenberg@webrtc.org

Review-Url: https://codereview.webrtc.org/2632243002
Cr-Commit-Position: refs/heads/master@{#16103}
2017-01-17 07:53:59 +00:00
7064d5929a RTCTransportStats.dtlsState replaces .activeConnection
In accordance with recent spec change:
https://github.com/w3c/webrtc-stats/pull/122

BUG=chromium:653873, chromium:627816

Review-Url: https://codereview.webrtc.org/2625993002
Cr-Commit-Position: refs/heads/master@{#16098}
2017-01-16 15:38:02 +00:00
84abeb1d37 RTC[In/Out]boundRTPStreamStats.mediaTrackId collected.
Based on the mapping between [Audio/Video]TrackInterface and
[Voice/Video][Sender/Receiver]Info.

The IDs of RTCMediaStreamTrackStats are updated to distinguish between
local and remote cases. Previously, if local and remote cases had the
same label only one of them would be included in the report (bug).

BUG=webrtc:6758, chromium:657854, chromium:657855, chromium:657856, chromium:627816

Review-Url: https://codereview.webrtc.org/2610843003
Cr-Commit-Position: refs/heads/master@{#16095}
2017-01-16 14:16:44 +00:00
1f8239ca6f TrackMediaInfoMap added.
This maps, in both directions, [Audio/Video]TrackInterface with
[Voice/Video][Sender/Receiver]Info.

This mapping is necessary for RTCStatsCollector to know the relationship
between RTCMediaStreamTrackStats and RTC[In/Out]boundRTPStreamStats, and
to be able to collect several RTCMediaStreamTrackStats stats.

BUG=webrtc:6757, chromium:659137, chromium:657854, chromium:627816

Review-Url: https://codereview.webrtc.org/2611983002
Cr-Commit-Position: refs/heads/master@{#16090}
2017-01-16 12:24:10 +00:00
4e477a1d7b Added a new echo likelihood stat that reports the maximum value from a previous time period.
BUG=webrtc:6797

Review-Url: https://codereview.webrtc.org/2629563003
Cr-Commit-Position: refs/heads/master@{#16079}
2017-01-15 16:29:46 +00:00
fe0fd41bb9 Stop using deprecated constraints-based version of CreateAudioSource.
Also did some slight refactoring of the code that turns constraints
into rtc::Optionals. Used a template method to avoid code duplication,
and used the same pattern for "CopyConstraintsIntoAudioOptions" as was
being used for "CopyConstraintsIntoRtcConfiguration".

BUG=webrtc:6752

Review-Url: https://codereview.webrtc.org/2628523003
Cr-Commit-Position: refs/heads/master@{#16063}
2017-01-13 19:47:56 +00:00