Commit Graph

80 Commits

Author SHA1 Message Date
6038e97e04 Adding RTCErrorOr class to be used by ORTC APIs.
This utility class can be used to represent either an error or a
successful return value. Follows the pattern of StatusOr in the protobuf
library.

This will be used by ORTC factory methods; for instance, CreateRtpSender
will either return an RtpSender or an error if the parameters are
invalid or some other failure occurs.

This CL also moves RTCError classes to a separate file, and adds tests
that were missing before.

BUG=webrtc:7013

Review-Url: https://codereview.webrtc.org/2692723002
Cr-Commit-Position: refs/heads/master@{#16659}
2017-02-17 07:31:33 +00:00
39e14da919 Changing some PeerConnection-related comments.
As recommended by nisse@ in comments on this CL:
https://codereview.webrtc.org/2685093002/

BUG=None
NOTRY=True
TBR=nisse@webrtc.org

Review-Url: https://codereview.webrtc.org/2692923002
Cr-Commit-Position: refs/heads/master@{#16589}
2017-02-13 17:49:58 +00:00
112b2e99d8 Switching some interfaces to use std::unique_ptr<>.
This helps show where ownership is transfered between objects.

Specifically, this CL wraps cricket::VideoCapturer, MediaEngineInterface
and DataEngineInterface in unique_ptr.

BUG=None
TBR=magjed@webrtc.org

Review-Url: https://codereview.webrtc.org/2685093002
Cr-Commit-Position: refs/heads/master@{#16548}
2017-02-11 04:13:37 +00:00
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
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
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
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
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
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
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
1d3c7e0b16 Move MetricsObserverInterface out of peerconnectioninterface.h
This change moves the definition of the UMA MetricsObserverInterface from api/peerconnectioninterface.h into api/umametrics.h. This allows us to remove the unwanted dependency on peerconnectioninterface.h from files in webrtc/p2p.

This is a simple refactoring with no functional changes.

BUG=None

Review-Url: https://codereview.webrtc.org/2627093005
Cr-Commit-Position: refs/heads/master@{#16020}
2017-01-12 01:50:30 +00:00
293e926362 Reland of: Adding error output param to SetConfiguration, using new RTCError type.
Most notably, will return "INVALID_MODIFICATION" if a field in the
configuration was modified and modification of that field isn't supported.

Also changing RTCError to a class that wraps an enum type, because it will
eventually need to hold other information (like SDP line number), to match
the RTCError that was recently added to the spec:
https://github.com/w3c/webrtc-pc/pull/850

BUG=webrtc:6916

Review-Url: https://codereview.webrtc.org/2587133004
Cr-Original-Commit-Position: refs/heads/master@{#15777}
Committed: 7a5fa6cd61
Review-Url: https://codereview.webrtc.org/2587133004
Cr-Commit-Position: refs/heads/master@{#16016}
2017-01-11 20:28:30 +00:00
0483362377 Add disabled certificate check support to IceServer PeerConnection API.
Refactor "OPT_SSLTCP" renaming it to "OPT_TLS_FAKE", making it clear
that it's not actually some kind of SSL over TCP. Also making it clear
that it's mutually exclusive with OPT_TLS. Maintaining deprecated
backwards compatible support for "OPT_SSLTCP".

Add "OPT_TLS_INSECURE" that implements the new certificate-check
disabled TLS mode, which is also mutually exclusive with the other
TLS options.

PortAllocator: Add a new TLS policy enum TlsCertPolicy which defines
the new insecure mode and added it as a RelayCredentials member.

TurnPort: Add new TLS policy member with appropriate getter and setter
to avoid constructor bloat. Initialize it from the RelayCredentials
after the TurnPort is created.

Expose the new feature in the PeerConnection API via
IceServer.tls_certificate_policy as well as via the Android JNI
PeerConnection API.

For security reasons we ensure that:

	1) The policy is always explicitly initialized to secure.
        2) API users have to explicitly integrate with the feature to
           use it, and will otherwise get no change in behavior.
	3) The feature is not immediately exposed in non-native
	   contexts. For example, disabling of certificate validation
           is not implemented via URI parsing since this would
           immediately allow it to be used from a web page.

This is a second attempt of https://codereview.webrtc.org/2557803002/
which was rolled back in https://codereview.webrtc.org/2590153002/

BUG=webrtc:6840

Review-Url: https://codereview.webrtc.org/2594623002
Cr-Commit-Position: refs/heads/master@{#15967}
2017-01-09 16:35:45 +00:00
1e23461d5e Revert of Adding error output param to SetConfiguration, using new RTCError type. (patchset #4 id:60001 of https://codereview.webrtc.org/2587133004/ )
Reason for revert:
Broke chromium FYI bot because the chromium mock PC overrides the method whose signature is changing.

Also broke a downstream internal test, which I need to investigate further.

Original issue's description:
> Adding error output param to SetConfiguration, using new RTCError type.
>
> Most notably, will return "INVALID_MODIFICATION" if a field in the
> configuration was modified and modification of that field isn't supported.
>
> Also changing RTCError to a class that wraps an enum type, because it will
> eventually need to hold other information (like SDP line number), to match
> the RTCError that was recently added to the spec:
> https://github.com/w3c/webrtc-pc/pull/850
>
> BUG=webrtc:6916
>
> Review-Url: https://codereview.webrtc.org/2587133004
> Cr-Commit-Position: refs/heads/master@{#15777}
> Committed: 7a5fa6cd61

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

Review-Url: https://codereview.webrtc.org/2600813002
Cr-Commit-Position: refs/heads/master@{#15778}
2016-12-24 09:43:32 +00:00
7a5fa6cd61 Adding error output param to SetConfiguration, using new RTCError type.
Most notably, will return "INVALID_MODIFICATION" if a field in the
configuration was modified and modification of that field isn't supported.

Also changing RTCError to a class that wraps an enum type, because it will
eventually need to hold other information (like SDP line number), to match
the RTCError that was recently added to the spec:
https://github.com/w3c/webrtc-pc/pull/850

BUG=webrtc:6916

Review-Url: https://codereview.webrtc.org/2587133004
Cr-Commit-Position: refs/heads/master@{#15777}
2016-12-24 08:47:59 +00:00
fe4a8a41ad Implement current/pending session description methods.
BUG=webrtc:6917

Review-Url: https://codereview.webrtc.org/2590753002
Cr-Commit-Position: refs/heads/master@{#15722}
2016-12-21 01:56:17 +00:00
b36ee8d498 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}
2016-12-20 11:30:00 +00:00
d5236e2948 Revert of Add disabled certificate check support to IceServer PeerConnection API. (patchset #8 id:140001 of https://codereview.webrtc.org/2557803002/ )
Reason for revert:
This CL broke all Chromium WebRTC FYI bots. A roll+fix was attempted here: https://codereview.chromium.org/2590783003/, but failed to land. I'm reverting this CL now to make the tree green again. Make the API change gradual when you reland so that we can update Chromium between.

Original issue's description:
> Add disabled certificate check support to IceServer PeerConnection API.
>
> Refactor "OPT_SSLTCP" renaming it to "OPT_TLS_FAKE", making it clear
> that it's not actually some kind of SSL over TCP. Also making it clear
> that it's mutually exclusive with OPT_TLS.
>
> Add "OPT_TLS_INSECURE" that implements the new certificate-check
> disabled TLS mode, which is also mutually exclusive with the other
> TLS options.
>
> PortAllocator: Add a new TLS policy enum TlsCertPolicy which defines
> the new insecure mode and added it as a RelayCredentials member.
>
> TurnPort: Add new TLS policy member with appropriate getter and setter
> to avoid constructor bloat. Initialize it from the RelayCredentials
> after the TurnPort is created.
>
> Expose the new feature in the PeerConnection API via
> IceServer.tls_certificate_policy as well as via the Android JNI
> PeerConnection API.
>
> For security reasons we ensure that:
>
> 	1) The policy is always explicitly initialized to secure.
>         2) API users have to explicitly integrate with the feature to
>            use it, and will otherwise get no change in behavior.
> 	3) The feature is not immediately exposed in non-native
> 	   contexts. For example, disabling of certificate validation
>            is not implemented via URI parsing since this would
>            immediately allow it to be used from a web page.
>
> BUG=webrtc:6840
>
> Review-Url: https://codereview.webrtc.org/2557803002
> Cr-Commit-Position: refs/heads/master@{#15670}
> Committed: b0f04fdb9e

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

Review-Url: https://codereview.webrtc.org/2590153002
Cr-Commit-Position: refs/heads/master@{#15703}
2016-12-20 10:22:06 +00:00
b0f04fdb9e Add disabled certificate check support to IceServer PeerConnection API.
Refactor "OPT_SSLTCP" renaming it to "OPT_TLS_FAKE", making it clear
that it's not actually some kind of SSL over TCP. Also making it clear
that it's mutually exclusive with OPT_TLS.

Add "OPT_TLS_INSECURE" that implements the new certificate-check
disabled TLS mode, which is also mutually exclusive with the other
TLS options.

PortAllocator: Add a new TLS policy enum TlsCertPolicy which defines
the new insecure mode and added it as a RelayCredentials member.

TurnPort: Add new TLS policy member with appropriate getter and setter
to avoid constructor bloat. Initialize it from the RelayCredentials
after the TurnPort is created.

Expose the new feature in the PeerConnection API via
IceServer.tls_certificate_policy as well as via the Android JNI
PeerConnection API.

For security reasons we ensure that:

	1) The policy is always explicitly initialized to secure.
        2) API users have to explicitly integrate with the feature to
           use it, and will otherwise get no change in behavior.
	3) The feature is not immediately exposed in non-native
	   contexts. For example, disabling of certificate validation
           is not implemented via URI parsing since this would
           immediately allow it to be used from a web page.

BUG=webrtc:6840

Review-Url: https://codereview.webrtc.org/2557803002
Cr-Commit-Position: refs/heads/master@{#15670}
2016-12-19 12:10:30 +00:00
95aa96465d Support external audio mixer in webrtc 2.
An external audio mixer will be passed from PeerConnectionFactory to
AudioTransportProxy.

This CL has rewritten based on reverted CL
https://codereview.chromium.org/2539213003/
The only difference is that
  static MediaEngineInterface* Create(
      webrtc::AudioDeviceModule* adm,
      const rtc::scoped_refptr<webrtc::AudioDecoderFactory>&
          audio_decoder_factory,
      WebRtcVideoEncoderFactory* video_encoder_factory,
      WebRtcVideoDecoderFactory* video_decoder_factory);
in media/engine/webrtcmediaengine.h is kept in this CL instead of
replaced for backward compatibility.

BUG=webrtc:6457

Review-Url: https://codereview.webrtc.org/2570993002
Cr-Commit-Position: refs/heads/master@{#15580}
2016-12-13 22:06:35 +00:00
e381015ca0 Revert of New PeerConnectionInterface::GetStats: No bogus default implementation. (patchset #1 id:1 of https://codereview.webrtc.org/2566143002/ )
Reason for revert:
Breaks google3 importer:
http://webrtc-buildbot-master.mtv.corp.google.com:21000/builders/WebRTC%20google3%20Importer/builds/11260

Original issue's description:
> New PeerConnectionInterface::GetStats: No bogus default implementation.
>
> The Chromium mock implementation implements the new GetStats API, so we
> can remove this default implementation.
>
> BUG=chromium:627816
>
> Committed: https://crrev.com/8f2309478da41cd8b829d022874dfd5ddc58551c
> Cr-Commit-Position: refs/heads/master@{#15563}

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

Review-Url: https://codereview.webrtc.org/2575493002
Cr-Commit-Position: refs/heads/master@{#15567}
2016-12-13 10:35:24 +00:00
8f2309478d New PeerConnectionInterface::GetStats: No bogus default implementation.
The Chromium mock implementation implements the new GetStats API, so we
can remove this default implementation.

BUG=chromium:627816

Review-Url: https://codereview.webrtc.org/2566143002
Cr-Commit-Position: refs/heads/master@{#15563}
2016-12-13 09:45:15 +00:00
39ce11f7f6 Revert of Support external audio mixer. (patchset #5 id:140001 of https://codereview.webrtc.org/2539213003/ )
Reason for revert:
A interface change broke some downstream code in google3.

Original issue's description:
> Support external audio mixer in webrtc.
>
> An external audio mixer will be passed from PeerConnectionFactory to
> AudioTransportProxy.
>
> BUG=webrtc:6457
>
> Committed: https://crrev.com/f6bcac59e88c3be5ffd73bbb1098f2d82ee316a1
> Cr-Commit-Position: refs/heads/master@{#15556}

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

Review-Url: https://codereview.webrtc.org/2562333003
Cr-Commit-Position: refs/heads/master@{#15557}
2016-12-13 01:07:00 +00:00
f6bcac59e8 Support external audio mixer in webrtc.
An external audio mixer will be passed from PeerConnectionFactory to
AudioTransportProxy.

BUG=webrtc:6457

Review-Url: https://codereview.webrtc.org/2539213003
Cr-Commit-Position: refs/heads/master@{#15556}
2016-12-13 00:25:16 +00:00
d1a38b591d Implement the "needs-ice-restart" logic for SetConfiguration.
Changing the configuration will cause subsequently generated offers to change
the ufrag/pwd as necessary, so that a new round of gathering is started that
uses the new configuration.

This CL also makes some minor unrelated changes: changing the reference SDP in
the PC tests to more match what we generate, and relaxing the network thread
requirement for JsepTransport (since there's no reason the "needs-ice-restart"
flag can't be accessed from the signaling thread).

BUG=webrtc:6714

Review-Url: https://codereview.webrtc.org/2563153002
Cr-Commit-Position: refs/heads/master@{#15527}
2016-12-10 21:15:39 +00:00
3edec7cf1b Adding error enum to be used by PeerConnectionInterface methods.
The enum is at about the same level of detail as DOMExceptions, and I
looked through the spec making sure that chromium will be able to perform
the DOMException mapping for each one.

The new enum is called RtcError and is outside the PeerConnectionInterface
scope, because we may want to use this for things not associated with a
PeerConnection in the future.

This CL doesn't yet use the error enum anywhere; that will probably happen
in follow-up CLs for the individual methods.

BUG=webrtc:6855

Review-Url: https://codereview.webrtc.org/2564683002
Cr-Commit-Position: refs/heads/master@{#15526}
2016-12-10 19:44:35 +00:00
c63b894686 Modify the parameter type of PeerConnectionObserver callback OnAddTrack.
Change the second parameter type to a const reference of vector so that
the vector will not be copied.

BUG=none

Review-Url: https://codereview.webrtc.org/2551603003
Cr-Commit-Position: refs/heads/master@{#15396}
2016-12-02 23:41:15 +00:00
4dfb8cef51 Make the default value of rtcp-mux policy to required.
Change the default value of rtcp-mux policy in RTCConfiguration.
Refactor the peerconnectioninterface and webrtcsession unit tests.

BUG=webrtc:6030

Review-Url: https://codereview.webrtc.org/2043193003
Cr-Commit-Position: refs/heads/master@{#15217}
2016-11-23 18:30:21 +00:00
81c3a03004 Added a callback function OnAddTrack to PeerConnectionObserver
Added the callback in native c++ API.
The callback function is called when a track is added and a new RtpReceiver is created.
The application can tell when tracks are added to the streams by listening to this callback.

BUG=webrtc:6112

Review-Url: https://codereview.webrtc.org/2505173002
Cr-Commit-Position: refs/heads/master@{#15142}
2016-11-17 20:06:37 +00:00
46c7389a63 Adding GetConfiguration to PeerConnection.
Just returns the configuration the PC was constructed with, or the last
one passed into SetConfiguration.

BUG=chromium:587453

Review-Url: https://codereview.webrtc.org/2504103002
Cr-Commit-Position: refs/heads/master@{#15111}
2016-11-17 03:42:09 +00:00
e7c338fed4 Reland of "Remove the obsolete enum webrtc::PeerConnectionInterface::IceState." (patchset #1 id:1 of https://codereview.webrtc.org/2402993002/ )
Reason for revert:
Upstream fixes landed.

Original issue's description:
> Revert of "Remove the obsolete enum webrtc::PeerConnectionInterface::IceState." (patchset #1 id:1 of https://codereview.webrtc.org/2361053003/ )
>
> Reason for revert:
> Breaks upstream code.
>
> Original issue's description:
> > Reland of "Remove the obsolete enum webrtc::PeerConnectionInterface::IceState."
> >
> > Original commit https://codereview.webrtc.org/2256663002
> > was reverted by https://codereview.webrtc.org/2290963002 .
> >
> > BUG=webrtc:6299
> > TBR=pthatcher@webrtc.org
> >
> > Committed: https://crrev.com/fc9414ab513941028309d15a2baf711ef38f93a7
> > Cr-Commit-Position: refs/heads/master@{#14584}
>
> TBR=pthatcher@webrtc.org,johan@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6299
>
> Committed: https://crrev.com/57cb873707fbcc4864f0ee98129f73e7bef26c1a
> Cr-Commit-Position: refs/heads/master@{#14586}

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

Review-Url: https://codereview.webrtc.org/2411673005
Cr-Commit-Position: refs/heads/master@{#14602}
2016-10-11 16:04:48 +00:00
57cb873707 Revert of "Remove the obsolete enum webrtc::PeerConnectionInterface::IceState." (patchset #1 id:1 of https://codereview.webrtc.org/2361053003/ )
Reason for revert:
Breaks upstream code.

Original issue's description:
> Reland of "Remove the obsolete enum webrtc::PeerConnectionInterface::IceState."
>
> Original commit https://codereview.webrtc.org/2256663002
> was reverted by https://codereview.webrtc.org/2290963002 .
>
> BUG=webrtc:6299
> TBR=pthatcher@webrtc.org
>
> Committed: https://crrev.com/fc9414ab513941028309d15a2baf711ef38f93a7
> Cr-Commit-Position: refs/heads/master@{#14584}

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

Review-Url: https://codereview.webrtc.org/2402993002
Cr-Commit-Position: refs/heads/master@{#14586}
2016-10-10 12:59:14 +00:00
fc9414ab51 Reland of "Remove the obsolete enum webrtc::PeerConnectionInterface::IceState."
Original commit https://codereview.webrtc.org/2256663002
was reverted by https://codereview.webrtc.org/2290963002 .

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

Review-Url: https://codereview.webrtc.org/2361053003
Cr-Commit-Position: refs/heads/master@{#14584}
2016-10-10 10:26:03 +00:00
74e1a4f96a PeerConnection[Interface]::GetStats(RTCStatsCollectorCallback*) added.
New file structure and targets:

rtc_stats_api
  webrtc/api/stats/rtcstats.h
  webrtc/api/stats/rtcstats_objects.h
  webrtc/api/stats/rtcstatsreport.h

rtc_stats (dep on rtc_stats_api)
  webrtc/stats/rtcstats.cc
  webrtc/stats/rtcstats_objects.cc
  webrtc/stats/rtcstatsreport.cc

libjingle_peerconnection (dep on rtc_stats)
  webrtc/api/rtcstatscollector.cc
  webrtc/api/rtcstatscollector.h

Placing rtc_stats_api headers in this separate target instead of
libjingle_peerconnection avoids a circular dependency
libjingle_peerconnection -> rtc_stats -> libjingle_peerconnection

Code changes:

PeerConnectionInterface::GetStats(RTCStatsCollectorCallback*) added for
the new stats collection API. Implemented by PeerConnection.

BUG=chromium:627816

Review-Url: https://codereview.webrtc.org/2331373004
Cr-Commit-Position: refs/heads/master@{#14246}
2016-09-16 06:33:04 +00:00
aecd982a6f Change a few configurations in AggressiveConfiguration
Set bundle policy to max bundle.
Set rtcp mux policy to required.
Set enable ice renomination to true.
This configuration is used by native applications.

R=pthatcher@webrtc.org, skvlad@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#14057}
2016-09-02 23:58:28 +00:00
79c6458575 Provide a default implementation for PeerConnectionInterface::ice_state().
Default implementation is necessary to remove implementations in
downstream unit test mocks. Method will be entirely removed in upcomming
reland of https://codereview.webrtc.org/2256663002/ .

BUG=webrtc:6299

Review-Url: https://codereview.webrtc.org/2306833003
Cr-Commit-Position: refs/heads/master@{#14053}
2016-09-02 19:07:43 +00:00
f7ddc06a43 Use AggressiveConfiguration as the default configuration in IOS
R=haysc@webrtc.org, pthatcher@webrtc.org, tkchin@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#14030}
2016-09-01 22:34:12 +00:00
4cedf2b78c Add signaling to support ICE renomination.
By default, this will tell the remote side that I am supporting ICE renomination.
It does not use ICE renomination yet even if the remote side supports it.

R=deadbeef@webrtc.org, pthatcher@webrtc.org, skvlad@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13998}
2016-08-31 15:18:22 +00:00
bfd398ccda Add a switch to redetermine role when ICE restarts.
R=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13982}
2016-08-31 05:07:56 +00:00
68343a8f67 Revert of Remove the obsolete enum webrtc::PeerConnectionInterface::IceState. (patchset #1 id:1 of https://codereview.webrtc.org/2256663002/ )
Reason for revert:
This breaks Chromes build.
You will need to update tests in Chrome first.

[1874/1925] CXX obj/content/test/test_support/mock_peer_connection_impl.o
FAILED: obj/content/test/test_support/mock_peer_connection_impl.o
/b/c/cipd/goma/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/content/test/test_support/mock_peer_connection_impl.o.d -DV8_DEPRECATION_WARNINGS -DENABLE_NOTIFICATIONS -DENABLE_PEPPER_CDMS -DENABLE_PLUGINS=1 -DENABLE_PDF=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DUSE_BROWSER_SPELLCHECKER=1 -DDCHECK_ALWAYS_ON=1 -DNO_TCMALLOC -DUSE_EXTERNAL_POPUP_MENU=1 -DENABLE_WEBRTC=1 -DENABLE_EXTENSIONS=1 -DENABLE_TASK_MANAGER=1 -DENABLE_THEMES=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_PLUGIN_INSTALLATION=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_SERVICE_DISCOVERY=1 -DUSE_PROPRIETARY_CODECS -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DENABLE_MEDIA_ROUTER=1 -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=278861-1 -DCR_XCODE_VERSION=0511 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DV8_USE_EXTERNAL_STARTUP_DATA -DGTEST_HAS_POSIX_RE=0 -DGTEST_LANG_CXX11=1 -DENABLE_IPC_FUZZER -DSK_IGNORE_DW_GRAY_FIX -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DSK_SUPPORT_GPU=1 -DSK_BUILD_FOR_MAC -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_NOEXCEPT= -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DENABLE_WEBSOCKETS -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -DUSE_LIBJPEG_TURBO=1 -DENABLE_LAYOUT_UNIT_IN_INLINE_BOXES=0 -DENABLE_OILPAN=1 -DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1 -DWTF_USE_ICCJPEG=1 -DWTF_USE_QCMSLIB=1 -DLOG_DISABLED=0 -DMESA_EGL_NO_X11_HEADERS -DUNIT_TEST -DLEVELDB_PLATFORM_CHROMIUM=1 -DFEATURE_ENABLE_SSL -DFEATURE_ENABLE_VOICEMAIL -DEXPAT_RELATIVE_PATH -DGTEST_RELATIVE_PATH -DNO_MAIN_THREAD_WRAPPING -DNO_SOUND_SYSTEM -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DWEBRTC_MAC -DSSL_USE_OPENSSL -DHAVE_OPENSSL_SSL_H -DFEATURE_ENABLE_SSL -DLOGGING=1 -DNO_MAIN_THREAD_WRAPPING -I../.. -Igen -I../../third_party/khronos -I../../gpu -I../../third_party/libwebp -I../../testing/gtest/include -I../../skia/config -I../../skia/ext -I../../third_party/skia/include/c -I../../third_party/skia/include/config -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/images -I../../third_party/skia/include/lazy -I../../third_party/skia/include/pathops -I../../third_party/skia/include/pdf -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/skia/include/gpu -I../../third_party/skia/src/gpu -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -I../../third_party/WebKit -Igen/third_party/WebKit -I../../v8/include -Igen -I../../third_party/ced/src -I../../third_party/protobuf/src -Igen/protoc_out -I../../third_party/protobuf/src -I../../third_party/boringssl/src/include -I../../third_party/libjpeg_turbo -I../../third_party/WebKit/Source -I../../third_party/WebKit -Igen/blink -Igen/third_party/WebKit -I../../third_party/iccjpeg -I../../third_party/libpng -I../../third_party/zlib -I../../third_party/ots/include -I../../third_party/qcms/src -I../../v8/include -I../../third_party/mesa/src/include -I../../testing/gmock_custom -I../../testing/gmock/include -I../../third_party/leveldatabase -I../../third_party/leveldatabase/src -I../../third_party/leveldatabase/src/include -I../../third_party/libwebm/source -I../../third_party/opus/src/include -Igen/ui/resources -Igen/ui/resources -I../../third_party/webrtc_overrides -I../../testing/gtest/include -I../../third_party -I../../third_party/webrtc_overrides -I../../third_party -I../../third_party/jsoncpp/overrides/include -I../../third_party/jsoncpp/source/include -I../../third_party/libyuv -I../../third_party/libyuv/include -I../../third_party/libvpx/source/libvpx -fno-strict-aliasing -fstack-protector -fcolor-diagnostics -arch x86_64 -Wall -Werror -Wextra -Wpartial-availability -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-deprecated-register -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -O2 -g1 -isysroot /Applications/Xcode5.1.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -mmacosx-version-min=10.7 -fvisibility=hidden -Xclang -load -Xclang ../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-templates -Xclang -plugin-arg-find-bad-constructs -Xclang follow-macro-expansion -Xclang -plugin-arg-find-bad-constructs -Xclang enforce-in-pdf -Wheader-hygiene -Wstring-conversion -Wno-unused-function -Xclang -load -Xclang ../../third_party/llvm-build/Release+Asserts/lib/libBlinkGCPlugin.dylib -Xclang -add-plugin -Xclang blink-gc-plugin -fno-threadsafe-statics -fvisibility-inlines-hidden -std=c++11 -stdlib=libc++ -fno-rtti -fno-exceptions -c ../../content/renderer/media/mock_peer_connection_impl.cc -o obj/content/test/test_support/mock_peer_connection_impl.o
In file included from ../../content/renderer/media/mock_peer_connection_impl.cc:5:
../../content/renderer/media/mock_peer_connection_impl.h:52:3: error: unknown type name 'IceState'
  IceState ice_state() override {
  ^
../../content/renderer/media/mock_peer_connection_impl.h:54:37: error: no member named 'kIceNew' in 'webrtc::PeerConnectionInterface'
    return PeerConnectionInterface::kIceNew;

See for example https://build.chromium.org/p/chromium.webrtc.fyi/builders/Mac%20Builder/builds/16680
           ~~~~~~~~~~~~~~~~~~~~~~~~~^

Original issue's description:
> Remove the obsolete enum webrtc::PeerConnectionInterface::IceState.
>
> Was replaced by IceConnectionState + IceGatheringState.
>
> BUG=
>
> Committed: https://crrev.com/31dea98e9c87e640e185fd86fe63d952b5402e05
> Cr-Commit-Position: refs/heads/master@{#13963}

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

Review-Url: https://codereview.webrtc.org/2290963002
Cr-Commit-Position: refs/heads/master@{#13966}
2016-08-30 06:51:20 +00:00
31dea98e9c Remove the obsolete enum webrtc::PeerConnectionInterface::IceState.
Was replaced by IceConnectionState + IceGatheringState.

BUG=

Review-Url: https://codereview.webrtc.org/2256663002
Cr-Commit-Position: refs/heads/master@{#13963}
2016-08-29 21:11:37 +00:00
9763d56464 Modified PeerConnection and WebRtcSession for end-to-end QuicDataChannel usage.
To allow end-to-end QuicDataChannel usage with a
PeerConnection, RTCConfiguration has been modified to
include a boolean for whether to do QUIC, since negotiation of
QUIC is not implemented. If one peer does QUIC, then it will be
assumed that the other peer must do QUIC or the connection
will fail.

PeerConnection has been modified to create data channels of type
QuicDataChannel when the peer wants to do QUIC.

WebRtcSession has ben modified to use a QuicDataTransport
instead of a DtlsTransportChannelWrapper/DataChannel
when QUIC should be used

QuicDataTransport implements the generic functions of
BaseChannel to manage the QuicTransportChannel.

Committed: https://crrev.com/34b54c36a533dadb6ceb70795119194e6f530ef5
Review-Url: https://codereview.webrtc.org/2166873002
Cr-Original-Commit-Position: refs/heads/master@{#13645}
Cr-Commit-Position: refs/heads/master@{#13657}
2016-08-05 18:14:54 +00:00
907abe4411 Revert of Modified PeerConnection and WebRtcSession for end-to-end QuicDataChannel usage. (patchset #8 id:280001 of https://codereview.webrtc.org/2166873002/ )
Reason for revert:
Reverting because it broke an RTP data channel test on the FYI bots.

Original issue's description:
> Modified PeerConnection and WebRtcSession for end-to-end QuicDataChannel usage.
>
> To allow end-to-end QuicDataChannel usage with a
> PeerConnection, RTCConfiguration has been modified to
> include a boolean for whether to do QUIC, since negotiation of
> QUIC is not implemented. If one peer does QUIC, then it will be
> assumed that the other peer must do QUIC or the connection
> will fail.
>
> PeerConnection has been modified to create data channels of type
> QuicDataChannel when the peer wants to do QUIC.
>
> WebRtcSession has ben modified to use a QuicDataTransport
> instead of a DtlsTransportChannelWrapper/DataChannel
> when QUIC should be used
>
> QuicDataTransport implements the generic functions of
> BaseChannel to manage the QuicTransportChannel.
>
> Committed: https://crrev.com/34b54c36a533dadb6ceb70795119194e6f530ef5
> Cr-Commit-Position: refs/heads/master@{#13645}

TBR=pthatcher@webrtc.org,zhihuang@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/2206793007
Cr-Commit-Position: refs/heads/master@{#13647}
2016-08-04 19:22:22 +00:00
34b54c36a5 Modified PeerConnection and WebRtcSession for end-to-end QuicDataChannel usage.
To allow end-to-end QuicDataChannel usage with a
PeerConnection, RTCConfiguration has been modified to
include a boolean for whether to do QUIC, since negotiation of
QUIC is not implemented. If one peer does QUIC, then it will be
assumed that the other peer must do QUIC or the connection
will fail.

PeerConnection has been modified to create data channels of type
QuicDataChannel when the peer wants to do QUIC.

WebRtcSession has ben modified to use a QuicDataTransport
instead of a DtlsTransportChannelWrapper/DataChannel
when QUIC should be used

QuicDataTransport implements the generic functions of
BaseChannel to manage the QuicTransportChannel.

Review-Url: https://codereview.webrtc.org/2166873002
Cr-Commit-Position: refs/heads/master@{#13645}
2016-08-04 18:06:58 +00:00
cb56065c62 Add support for GCM cipher suites from RFC 7714.
GCM cipher suites are optional (disabled by default) and can be enabled
through "PeerConnectionFactoryInterface::Options".

If compiled with Chromium (i.e. "ENABLE_EXTERNAL_AUTH" is defined), no
GCM ciphers can be used yet (see https://crbug.com/628400).

BUG=webrtc:5222, 628400

Review-Url: https://codereview.webrtc.org/1528843005
Cr-Commit-Position: refs/heads/master@{#13635}
2016-08-04 12:20:38 +00:00
14d5dbe5b3 Reland of "Move RtcEventLog object from inside VoiceEngine to Call.", "Fix to make the start/stop functions for the Rtc Eventlog non-virtual." and "Fix for RtcEventLog ObjC interface"
The breaking tests in Chromium have been temporarily disabled, they will be fixed and reenabled soon.

Original CLs: https://codereview.webrtc.org/1748403002/, https://codereview.webrtc.org/2107253002/ and https://codereview.webrtc.org/2106103003/.

TBR=solenberg@webrtc.org,tommi@webrtc.org,stefan@webrtc.org,terelius@webrtc.org,tkchin@webrtc.org
BUG=webrtc:4741, webrtc:5603, chromium:609749

Review-Url: https://codereview.webrtc.org/2110113003
Cr-Commit-Position: refs/heads/master@{#13379}
2016-07-04 14:07:03 +00:00
e9851116e2 Adding API for "presume writable when fully relayed" ICE option.
For explanation of what this is, see:
https://codereview.webrtc.org/2063823008/

R=glaznev@webrtc.org, pthatcher@webrtc.org
TBR=tkchin@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13366}
2016-07-01 18:11:22 +00:00
b9e7b4ad66 Add config to prune low-priority TURN ports for creating connections
When the flag prune_turn_ports is set, When a high-priority turn port becomes available, it will prune low-priority ones. The pruned port will not be used for creating connections locally and its candidates will not be sent over to the remove side (unless they have been sent before being pruned).

This effectively reduces the number of TURN candidates and connections created by TURN ports.

BUG=
R=deadbeef@webrtc.org, pthatcher@webrtc.org

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

Committed: https://crrev.com/17aac053f585e892114974d2eb248e05ad37f973
Cr-Original-Commit-Position: refs/heads/master@{#13335}
Cr-Commit-Position: refs/heads/master@{#13354}
2016-07-01 03:52:16 +00:00
f4e8cf0d5b Revert of Add config to prune TURN ports (patchset #12 id:360001 of https://codereview.webrtc.org/2093623004/ )
Reason for revert:
Breaks Win32/Win64 Debug bots in client.webrtc waterfall

Original issue's description:
> Add config to prune low-priority TURN ports for creating connections
> When the flag prune_turn_ports is set, When a high-priority turn port becomes available, it will prune low-priority ones. The pruned port will not be used for creating connections locally and its candidates will not be sent over to the remove side (unless they have been sent before being pruned).
>
> This effectively reduces the number of TURN candidates and connections created by TURN ports.
>
> BUG=
> R=deadbeef@webrtc.org, pthatcher@webrtc.org
>
> Committed: https://crrev.com/17aac053f585e892114974d2eb248e05ad37f973
> Cr-Commit-Position: refs/heads/master@{#13335}

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

Review-Url: https://codereview.webrtc.org/2111663003
Cr-Commit-Position: refs/heads/master@{#13342}
2016-06-30 08:55:10 +00:00