Commit Graph

90 Commits

Author SHA1 Message Date
6488ea424a Remove temporary include of builtin_audio_encoder_factory.h.
Add the include to the files where it is actually used instead.

BUG=webrtc:5806

Review-Url: https://codereview.webrtc.org/2869863003
Cr-Commit-Position: refs/heads/master@{#18176}
2017-05-17 11:39:36 +00:00
eb1fde4a26 Injectable audio encoders: Moved audio encoder, factory and builtin factory to api/.
Plumbed AudioEncoderFactory up into CreatePeerConnectionFactory.

BUG=webrtc:5806

Review-Url: https://codereview.webrtc.org/2799033006
Cr-Commit-Position: refs/heads/master@{#17977}
2017-05-02 13:46:30 +00:00
7914b8cb41 Negotiate the same SRTP crypto suites for every DTLS association formed.
Before this CL, we would negotiate:
- No crypto suites for data m= sections.
- A full set for audio m= sections.
- The full set, minus SRTP_AES128_CM_SHA1_32 for video m= sections.

However, this doesn't make sense with BUNDLE, since any DTLS
association could end up being used for any type of media. If
video is "bundled on" the audio transport (which is typical), it
will actually end up using SRTP_AES128_CM_SHA1_32.

So, this CL moves the responsibility of deciding SRTP crypto suites out
of BaseChannel and into DtlsTransport. The only two possibilities are
now "normal set" or "normal set + GCM", if enabled by the PC factory
options.

This fixes an issue (see linked bug) that was occurring when audio/video
were "bundled onto" the data transport. Since the data transport
wasn't negotiating any SRTP crypto suites, none were available to use
for audio/video, so the application would get black video/no audio.

This CL doesn't affect the SDES SRTP crypto suite negotiation;
it only affects the negotiation in the DLTS handshake, through
the use_srtp extension.

BUG=chromium:711243

Review-Url: https://codereview.webrtc.org/2815513012
Cr-Commit-Position: refs/heads/master@{#17810}
2017-04-21 10:23:33 +00:00
d07061c9f3 Add comments about PeerConnection::Close and PeerConnectionObserver.
Documenting that the observer can safely be destroyed after Close has
been called, because it ensures no more callbacks will be invoked. Just
like in JavaScript land, where no more events will be fired after
"close" is called.

This is already covered by unit tests.

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

Review-Url: https://codereview.webrtc.org/2834543005
Cr-Commit-Position: refs/heads/master@{#17798}
2017-04-20 20:19:00 +00:00
a1a040a4a4 Injectable audio encoders: BuiltinAudioEncoderFactory
This CL contains all the changes made to audio_coding while making
audio encoders injectable. Apart from some small changes to
webrtcvoiceengine, nothing here is hooked up to the outside
world. Those changes will be added to a follow-up CL.

BUG=webrtc:5806

Review-Url: https://codereview.webrtc.org/2695243005
Cr-Commit-Position: refs/heads/master@{#17569}
2017-04-06 17:03:21 +00:00
1dcb16409a Rewrite PeerConnection integration tests using better testing practices.
Also renames "peerconnection_unittests" to "peerconnection_integrationtests",
and moves the ICE URL parsing code to separate files.

The main problem previously was that the test assertions
occurred in various places in the main test class, and this shared test
code was overly complex and stateful. As a result, it was difficult to
tell what a test even does, let alone what assertions it's meant to be
making. And writing a new test that does what you want can be a
frustrating ordeal.

The new code still uses helper methods, but they have intuitive names
and a smaller role; all of the important parts of the test's logic are
in the test case itself.

We're planning on merging PeerConnection and WebRtcSession at some point
soon, so it seemed valuable to do this, so that the WebRtcSession tests
can be rewritten as PeerConnection tests using better patterns.

BUG=None

Review-Url: https://codereview.webrtc.org/2738353003
Cr-Commit-Position: refs/heads/master@{#17458}
2017-03-30 04:08:16 +00:00
7f067663ac Delete deprecated PeerConnection methods, and corresponding using declarations.
BUG=None

Review-Url: https://codereview.webrtc.org/2632203003
Cr-Commit-Position: refs/heads/master@{#17120}
2017-03-08 14:59:45 +00:00
b09b3f9a62 Add the option to disable IPv6 ICE candidates on WiFi.
Add an attribute to the RTCConfiguration which can be used by specific
mobile devices so that the IPv6 ICE candidates on WiFi will not be collected.

BUG=b/35725283

Review-Url: https://codereview.webrtc.org/2731813002
Cr-Commit-Position: refs/heads/master@{#17100}
2017-03-07 22:40:51 +00:00
8d60a946ae Replace NULL with nullptr or null in webrtc/api/.
BUG=webrtc:7147

Review-Url: https://codereview.webrtc.org/2715103002
Cr-Commit-Position: refs/heads/master@{#16880}
2017-02-27 22:47:33 +00:00
e814a0dee0 Adding "adapter" ORTC objects on top of ChannelManager/BaseChannel/etc.
This CL adds the following interfaces:
* RtpTransportController
* RtpTransport
* RtpSender
* RtpReceiver

They're implemented on top of the "BaseChannel" object, which is normally used
in a PeerConnection, and roughly corresponds to an SDP "m=" section. As a result
of this, there are several limitations:

* You can only have one of each type of sender and receiver (audio/video) on top
  of the same transport controller.
* The sender/receiver with the same media type must use the same RTP transport.
* You can't change the transport after creating the sender or receiver.
* Some of the parameters aren't supported.

Later, these "adapter" objects will be gradually replaced by real objects that don't
have these limitations, as "BaseChannel", "MediaChannel" and related code is
restructured. In this CL, we essentially have:

ORTC adapter objects -> BaseChannel -> Media engine
PeerConnection -> BaseChannel -> Media engine

And later we hope to have simply:

PeerConnection -> "Real" ORTC objects -> Media engine

See the linked bug for more context.

BUG=webrtc:7013
TBR=stefan@webrtc.org

Review-Url: https://codereview.webrtc.org/2675173003
Cr-Commit-Position: refs/heads/master@{#16842}
2017-02-26 02:15:09 +00:00
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