28 Commits

Author SHA1 Message Date
hbos
df6075a77f RTCStatsCollector: Utilize network thread to minimize thread hops.
(This is a re-upload of https://codereview.webrtc.org/2567243003/, the
CQ stopped working there.)

The previously used WebRtcSession::GetTransportStats did a synchronous
invoke per channel (voice, video, data) on the signaling thread to the
network thread - e.g. 3 blocking invokes.

It is replaced by WebRtcSession::GetStats[_s] which can be invoked on
the signaling thread or on any thread if a ChannelNamePairs argument is
present (provided by WebRtcSession::GetChannelNamePairs on the signaling
thread).

With these changes, and changes allowing the getting of certificates
from any thread, the RTCStatsCollector can turn the 3 blocking thread
invokes into 1 non-blocking invoke.

BUG=webrtc:6875, chromium:627816

Review-Url: https://codereview.webrtc.org/2583883002
Cr-Commit-Position: refs/heads/master@{#15672}
2016-12-19 12:58:02 +00:00
deadbeef
7af91ddd6b Removing "crypto_required" from MediaContentDescription.
"Crypto required" is a property of the PeerConnection of construction
time; it has nothing to do with SDP. So I'm moving it out of
MediaContentDescription and putting it in the BaseChannel constructor
instead. This is more intuitive, and provides the added assurance that
"secure_required_" can't be flipped from "true" to "false".

BUG=None

Review-Url: https://codereview.webrtc.org/2537343003
Cr-Commit-Position: refs/heads/master@{#15579}
2016-12-13 19:29:16 +00:00
deadbeef
49f34fdd23 Relanding: Refactoring that removes P2PTransport and DtlsTransport classes.
Their base class, Transport, still exists, but it now has a more specific
role: a helper class that applies TransportDescriptions. And is renamed
to JsepTransport as a result.

TransportController is now the entity primarily responsible for managing
TransportChannels. It also starts storing pointers to the DTLS and ICE
chanels separately, which will make it easier to remove
TransportChannel/TransportChannelImpl in a subsequent CL.

BUG=None

Review-Url: https://codereview.webrtc.org/2517883002
Cr-Commit-Position: refs/heads/master@{#15453}
2016-12-07 00:22:11 +00:00
deadbeef
57fd7263d1 Revert of Refactoring that removes P2PTransport and DtlsTransport classes. (patchset #9 id:150001 of https://codereview.webrtc.org/2517883002/ )
Reason for revert:
Deletion of transport.h broke downstream builds.

Going to reland with transport.h containing enums/etc.

Original issue's description:
> Refactoring that removes P2PTransport and DtlsTransport classes.
>
> Their base class, Transport, still exists, but it now has a more specific
> role: a helper class that applies TransportDescriptions. And is renamed
> to JsepTransport as a result.
>
> TransportController is now the entity primarily responsible for managing
> TransportChannels. It also starts storing pointers to the DTLS and ICE
> chanels separately, which will make it easier to remove
> TransportChannel/TransportChannelImpl in a subsequent CL.
>
> BUG=None
>
> Committed: https://crrev.com/bd28681d02dee8c185aeb39207e8154f0ad14a37
> Cr-Commit-Position: refs/heads/master@{#15450}

TBR=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/2553043004
Cr-Commit-Position: refs/heads/master@{#15452}
2016-12-06 23:29:07 +00:00
deadbeef
bd28681d02 Refactoring that removes P2PTransport and DtlsTransport classes.
Their base class, Transport, still exists, but it now has a more specific
role: a helper class that applies TransportDescriptions. And is renamed
to JsepTransport as a result.

TransportController is now the entity primarily responsible for managing
TransportChannels. It also starts storing pointers to the DTLS and ICE
chanels separately, which will make it easier to remove
TransportChannel/TransportChannelImpl in a subsequent CL.

BUG=None

Review-Url: https://codereview.webrtc.org/2517883002
Cr-Commit-Position: refs/heads/master@{#15450}
2016-12-06 22:56:26 +00:00
sakal
87da404883 Implement qpSum stat for video send ssrc stats.
Implemented as defined by this pull request: https://github.com/w3c/webrtc-stats/pull/70

BUG=webrtc:6541

Review-Url: https://codereview.webrtc.org/2430603003
Cr-Commit-Position: refs/heads/master@{#14851}
2016-10-31 13:53:51 +00:00
sakal
e5ba44eab1 Implement framesDecoded stat in video receive ssrc stats.
Implemented as defined by this pull request: https://github.com/w3c/webrtc-stats/pull/70

BUG=webrtc:6541

Review-Url: https://codereview.webrtc.org/2423823003
Cr-Commit-Position: refs/heads/master@{#14789}
2016-10-26 14:09:29 +00:00
sakal
43536c3d6a Implement framesEncoded stat in video send ssrc stats.
Implemented as defined by this pull request: https://github.com/w3c/webrtc-stats/pull/70

BUG=webrtc:6541

Review-Url: https://codereview.webrtc.org/2421193003
Cr-Commit-Position: refs/heads/master@{#14734}
2016-10-24 09:09:39 +00:00
ivoc
8c63a82bf5 Add a placeholder stat for logging the estimated residual echo likelihood.
The stat is currently always set to zero until the residual echo detector has landed.

BUG=webrtc:6525

Review-Url: https://codereview.webrtc.org/2431443003
Cr-Commit-Position: refs/heads/master@{#14721}
2016-10-21 11:10:08 +00:00
skvlad
11a9cbfa50 Refactoring: move ownership of RtcEventLog from Call to PeerConnection
This CL is a pure refactoring which should not result in any functinal
changes. It moves ownership of the RtcEventLog from webrtc::Call to the
webrtc::PeerConnection object.

This is done so that we can add RtcEventLog support for ICE events -
which will require the TransportController to have a pointer to the
RtcEventLog. PeerConnection is the closest common owner of both Call and
TransportController (through WebRtcSession).

BUG=webrtc:6393

Review-Url: https://codereview.webrtc.org/2353033005
Cr-Commit-Position: refs/heads/master@{#14578}
2016-10-07 18:53:15 +00:00
kwiberg
ac9f876bc0 Sort #includes that got unsorted when gmock.h and gtest.h moved to webrtc/test/
gmock.h and gtest.h were moved (or rather, got wrappers so that we
could put some icky compatibility hacks in one place instead of 500)
in this CL: https://codereview.webrtc.org/2358993004/

NOPRESUBMIT=true
BUG=webrtc:6398

Review-Url: https://codereview.webrtc.org/2381013002
Cr-Commit-Position: refs/heads/master@{#14464}
2016-10-01 05:29:53 +00:00
kwiberg
77eab70470 Enable the -Wundef warning for clang
NOPRESUBMIT=true
BUG=webrtc:6398

Review-Url: https://codereview.webrtc.org/2358993004
Cr-Commit-Position: refs/heads/master@{#14425}
2016-09-29 00:42:08 +00:00
henrik.lundin
63489787a0 Add new decoding statistics for muted output
This change adds a new statistic for logging how many calls to
NetEq::GetAudio resulted in a "muted output". A muted output happens
if the packet stream has been dead for some time (and the last decoded
packet was not comfort noise).

BUG=webrtc:5606
BUG=b/31256483

Review-Url: https://codereview.webrtc.org/2341293002
Cr-Commit-Position: refs/heads/master@{#14302}
2016-09-20 08:47:19 +00:00
hbos
b24b1ceb48 Moving mock classes around so that they may be reused in other unittests
New files, classes moved from statscollector_unittest.cc:
+webrtc/api/test/mock_peerconnection.h
 for MockPeerConnectionFactory and MockPeerConnection
+webrtc/api/test/mock_webrtcsession.h
 for MockWebRtcSession
+webrtc/media/base/test/mock_mediachannel.h
 for MockVideoMediaChannel and MockVoiceMediaChannel

The webrtc/media/base/test folder is new.

BUG=chromium:627816

Review-Url: https://codereview.webrtc.org/2238933002
Cr-Commit-Position: refs/heads/master@{#13769}
2016-08-16 08:19:48 +00:00
zhihuang
29ff8446c0 Add PeerConnection IsClosed check.
Add IsClosed check when excuting some functions so that they can return early if the PeerConnection is closed.
The observer will not be called after the PeerConnection is closed.

BUG=webrtc:5861

Review-Url: https://codereview.webrtc.org/1975453002
Cr-Commit-Position: refs/heads/master@{#13544}
2016-07-27 18:07:32 +00:00
danilchap
e9021a3601 Propogate network-worker thread split to api
BUG=webrtc:5645

Review-Url: https://codereview.webrtc.org/1968393002
Cr-Commit-Position: refs/heads/master@{#12767}
2016-05-17 08:52:06 +00:00
zhihuang
6ba3b1976f Filter out some variables with initial -1 in the stats report.
If we call GetStats in PeerConnection before receiving the remote answer, we will get some variables in the StatsReports which are initially set to be -1.

Several conditions are added when extracting the info for the report in StatsCollector.

Those variables include:
gooRtt,
dataChannelId,
googEchoCancellationEchoDelayMedian,
googEchoCancellationEchoQualityMin,
googEchoCancellationEchoDelayStdDev,
googJitterReceived,
audioInputLevel,
googCaptureStartNtpTimeMs
packetsLost.

BUG=webrtc:3377

Review-Url: https://codereview.webrtc.org/1875873002
Cr-Commit-Position: refs/heads/master@{#12735}
2016-05-13 18:46:53 +00:00
Danil Chapovalov
33b01f2162 Adds network thread to rtc::BaseChannel
BaseChannel do calls to transport_channel on network_thread,
while keep calls to media_engine on worker_thread.
It still works when network_thread == worker_thread.

BUG=webrtc:5645
R=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#12690}
2016-05-11 17:55:41 +00:00
nisse
ef8b61e110 Enable -Winconsistent-missing-override flag.
The problem with gmock is worked around by commenting out any other override declarations in classes using gmock.

NOPRESUBMIT=True
BUG=webrtc:3970

Review-Url: https://codereview.webrtc.org/1921653002
Cr-Commit-Position: refs/heads/master@{#12563}
2016-04-29 13:09:23 +00:00
kwiberg
d1fe281e12 Replace scoped_ptr with unique_ptr in webrtc/api/
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/1930463002

Cr-Commit-Position: refs/heads/master@{#12530}
2016-04-27 13:47:40 +00:00
jbauch
555604a746 Replace scoped_ptr with unique_ptr in webrtc/base/
This propagated into various other places. Also had to #include headers that
were implicitly pulled by "scoped_ptr.h".

BUG=webrtc:5520

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

Cr-Commit-Position: refs/heads/master@{#12501}
2016-04-26 10:13:28 +00:00
kwiberg
b4d01c4ded A bunch of interfaces: Return scoped_ptr<SSLCertificate>
Instead of using a raw pointer output parameter. This affects

  SSLStreamAdapter::GetPeerCertificate
  Transport::GetRemoteSSLCertificate
  TransportChannel::GetRemoteSSLCertificate
  TransportController::GetRemoteSSLCertificate
  WebRtcSession::GetRemoteSSLCertificate

This is a good idea in general, but will also be very convenient when
scoped_ptr is gone, since unique_ptr doesn't have an .accept() method.

BUG=webrtc:5520

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

Cr-Commit-Position: refs/heads/master@{#12262}
2016-04-06 12:15:11 +00:00
tkchin
7d06a8cfe4 Add CoreVideoFrameBuffer.
- Makes vt h264 decoder output CoreVideoFrameBuffer
- Makes iOS renderer convert frame buffer if it is not i420

BUG=

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

Cr-Commit-Position: refs/heads/master@{#12224}
2016-04-04 21:10:47 +00:00
nisse
af510afc91 Use a FakeVideoTrackSource instead of nullptr in all VideoTrack tests.
Extracted from cl 1790633002.

BUG=webrtc:5426

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

Cr-Commit-Position: refs/heads/master@{#12074}
2016-03-21 15:20:47 +00:00
nisse
51542be8ce Introduce struct MediaConfig, with construction-time settings.
Pass it to MediaController constructor and down to WebRtcVideoEngine2
and WebRtcVoiceEngine.

Follows discussion on https://codereview.webrtc.org/1646253004/

TBR=pthatcher@webrtc.org
BUG=webrtc:5438

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

Cr-Commit-Position: refs/heads/master@{#11595}
2016-02-12 10:27:12 +00:00
kjellander@webrtc.org
9b8df25c73 Move talk/session/media -> webrtc/pc
The libjingle_p2p target is renamed to rtc_pc.
The libjingle_p2p_unittest test will be renamed in a
separate follow-up CL, to make it possible to run all
trybots successfully for this CL.

BUG=webrtc:5419
R=deadbeef@webrtc.org, pthatcher@webrtc.org, tommi@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#11592}
2016-02-12 05:48:10 +00:00
kjellander
b24317bfda Fix license headers in webrtc/api.
In addition to the code moved from talk/app/webrtc
there were some files in webrtc/api/objctests that still
had the libjingle license header.

BUG=webrtc:5418
TBR=tkchin@webrtc.org
NOTRY=True

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

Cr-Commit-Position: refs/heads/master@{#11552}
2016-02-10 15:54:53 +00:00
Henrik Kjellander
15583c19d7 Move talk/app/webrtc to webrtc/api
The previously disabled warnings that were inherited from
talk/build/common.gypi are now replaced by target-specific disabling
of only the failing warnings. Additional disabling was needed since the stricter
compilation warnings that applies to code in webrtc/.

License headers will be updated in a follow-up CL.

Other modifications:
* Updated the header guards.
* Sorted the includes using chromium/src/tools/sort-headers.py
  except for these files:
  talk/app/webrtc/peerconnectionendtoend_unittest.cc
  talk/app/webrtc/java/jni/androidmediadecoder_jni.cc
  talk/app/webrtc/java/jni/androidmediaencoder_jni.cc
  webrtc/media/devices/win32devicemanager.cc

The HAVE_SCTP define was added for the peerconnection_unittests target
in api_tests.gyp.

I also checked that none of
SRTP_RELATIVE_PATH
HAVE_SRTP
HAVE_WEBRTC_VIDEO
HAVE_WEBRTC_VOICE
were used by the talk/app/webrtc code.

For Chromium, the following changes will need to be applied to the roll CL that updates the
DEPS for WebRTC and libjingle:
https://codereview.chromium.org/1615433002

BUG=webrtc:5418
NOPRESUBMIT=True
R=deadbeef@webrtc.org, pthatcher@webrtc.org, tommi@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#11545}
2016-02-10 09:53:26 +00:00