Commit Graph

197 Commits

Author SHA1 Message Date
5adfafdbf6 Make ContentInfo/ContentDescription slightly more ergonomic
This makes the following changes:
- Replaces ContentDescription with its only subclass,
    MediaContentDescription
- Adds helpers to cast a MediaContentDescription to its
    audio, video, and data subclasses.
- Changes ContentInfo.type to a new enum, MediaProtocolType.

Bug: webrtc:8620
Change-Id: I5eb0811cb16a51b0b9d73ecc4fe8edc7037f1aed
Reviewed-on: https://webrtc-review.googlesource.com/35100
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21401}
2017-12-21 01:35:57 +00:00
8b77aea2ac Revert "Wiring the RTCRtpEncodingParameters.priority down to the bitrate allocator."
This reverts commit d2b912aed132c751919ed286439fb39bbd714dda.

Reason for revert: broke internal tests

Original change's description:
> Wiring the RTCRtpEncodingParameters.priority down to the bitrate allocator.
> 
> I followed the wiring path for the max bitrate.
> Doc:
> https://docs.google.com/a/google.com/document/d/1sGT6y00prOIErFuGD44zWZacDpR6Rkjg_HXA_Z3Vw4Q/edit?usp=sharing
> 
> Bug: webrtc:8630
> Change-Id: I6b861816670442656721c20f81d035ee5eb6218c
> Reviewed-on: https://webrtc-review.googlesource.com/30380
> Commit-Queue: Seth Hampson <shampson@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Elad Alon <eladalon@webrtc.org>
> Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21397}

TBR=solenberg@webrtc.org,eladalon@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,pthatcher@webrtc.org,shampson@webrtc.org

Change-Id: If82810072e21818ae452a0fc3f984d44e5dac70c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8630
Reviewed-on: https://webrtc-review.googlesource.com/35540
Reviewed-by: Lu Liu <lliuu@webrtc.org>
Commit-Queue: Lu Liu <lliuu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21399}
2017-12-20 23:48:09 +00:00
d2b912aed1 Wiring the RTCRtpEncodingParameters.priority down to the bitrate allocator.
I followed the wiring path for the max bitrate.
Doc:
https://docs.google.com/a/google.com/document/d/1sGT6y00prOIErFuGD44zWZacDpR6Rkjg_HXA_Z3Vw4Q/edit?usp=sharing

Bug: webrtc:8630
Change-Id: I6b861816670442656721c20f81d035ee5eb6218c
Reviewed-on: https://webrtc-review.googlesource.com/30380
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21397}
2017-12-20 21:24:47 +00:00
afd8e8c304 Move MediaContentDescription into sessiondescription.h
Bug: webrtc:8620
Change-Id: I9b0b6d8dc9bda366e925dda9a5b92fc4e3fd9f43
Reviewed-on: https://webrtc-review.googlesource.com/35003
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21378}
2017-12-20 01:26:36 +00:00
4ab68eec96 Move sessiondescription.h/cc from p2p/base to pc/
SDP is a detail of PeerConnection and is not used by anything in p2p, so
it belongs in the pc/ directory. This also allows
MediaContentDescription to be inlined in the future.

Bug: webrtc:8620
Change-Id: I38b65ede9942e29eb15035ab29f2be988da1e5ce
Reviewed-on: https://webrtc-review.googlesource.com/33781
Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21376}
2017-12-20 00:21:52 +00:00
6e2e7ce419 Reland "Move JsepTransport from p2p/base to pc/."
This is a reland of 4770fd935ac92400487bddd3b755753572e6d692
Original change's description:
> Move JsepTransport from p2p/base to pc/.
> 
> The JsepTransport class is moved to pc/ and the utility methods and
> enums are moved to where they are used.
> 
> With JsepTransport moved to pc/, JsepTransport can depend on objects in
> pc/ including RtpTranport, SrtpTransport etc.
> 
> Forked from https://webrtc-review.googlesource.com/c/src/+/31762/7
> 
> Bug: webrtc:8636
> Change-Id: I4e8569fe3012946e87deb280f6139f0fd98de34d
> Reviewed-on: https://webrtc-review.googlesource.com/33701
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21333}

Bug: webrtc:8636
Change-Id: Ibce42be898b96dd8e0266b595611d2ffc86581a8
Reviewed-on: https://webrtc-review.googlesource.com/34586
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21371}
2017-12-19 20:50:41 +00:00
4b9e6ba357 Add missing mock headers to api.
R=mbonadei@webrtc.org

Bug: webrtc:7618
Change-Id: Ia622a7623b2fa05ec14b52d5d31d158d1bd0ef6d
Reviewed-on: https://webrtc-review.googlesource.com/34644
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21364}
2017-12-19 14:58:45 +00:00
741164813a Remove SessionStats.proxy_to_transport
The stats collectors would only ever call this on the signaling
thread, so they might as well just ask the voice/video channel
their transport_name directly.

Bug: None
Change-Id: I8dd36210ff22d222b45b5f5e22c253f601cdc79e
Reviewed-on: https://webrtc-review.googlesource.com/34581
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21339}
2017-12-18 23:37:47 +00:00
8424acdde3 Revert "Move JsepTransport from p2p/base to pc/."
This reverts commit 4770fd935ac92400487bddd3b755753572e6d692.

Reason for revert: breaks downstream projects

Original change's description:
> Move JsepTransport from p2p/base to pc/.
> 
> The JsepTransport class is moved to pc/ and the utility methods and
> enums are moved to where they are used.
> 
> With JsepTransport moved to pc/, JsepTransport can depend on objects in
> pc/ including RtpTranport, SrtpTransport etc.
> 
> Forked from https://webrtc-review.googlesource.com/c/src/+/31762/7
> 
> Bug: webrtc:8636
> Change-Id: I4e8569fe3012946e87deb280f6139f0fd98de34d
> Reviewed-on: https://webrtc-review.googlesource.com/33701
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21333}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,pthatcher@webrtc.org

Change-Id: Ia72c6d7f185a95b21fd0aec90e7fdc00cb1fb423
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8636
Reviewed-on: https://webrtc-review.googlesource.com/34600
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21335}
2017-12-18 21:00:05 +00:00
4770fd935a Move JsepTransport from p2p/base to pc/.
The JsepTransport class is moved to pc/ and the utility methods and
enums are moved to where they are used.

With JsepTransport moved to pc/, JsepTransport can depend on objects in
pc/ including RtpTranport, SrtpTransport etc.

Forked from https://webrtc-review.googlesource.com/c/src/+/31762/7

Bug: webrtc:8636
Change-Id: I4e8569fe3012946e87deb280f6139f0fd98de34d
Reviewed-on: https://webrtc-review.googlesource.com/33701
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21333}
2017-12-18 18:59:43 +00:00
593e32551c Change RTCStatsCollector to only access channels from signaling thread
Previously, the RTCStatsCollector needed to ask the voice/video
channel for its transport name in order to generate transport
level stats. That would happen on the networking thread which was
unsafe because the voice/video channel could have disappeared in
the duration of the asynchronous thread hop from the signaling
thread to the networking thread. This changes the networking stats
code to check a saved map that tracks the transport name for each
voice/video channel.

Bug: None
Change-Id: I1f03ba8c0526eaa4419f660f18b8b9da62c3f932
Reviewed-on: https://webrtc-review.googlesource.com/33660
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21332}
2017-12-18 18:55:23 +00:00
88bc9d5e53 Stop using api/webrtcsdp.h.
Bug: None
Change-Id: Ia965ea3663306e53003efe8a072f7fb417235b3b
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/34480
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21326}
2017-12-18 15:54:53 +00:00
7c5597aff2 Remove unused enum (kStatsValueNameEchoCancellationQualityMin).
Removing enum that was left behind when the metric aec_quality_min was
removed.

Bug: webrtc:8563
Change-Id: I8a8c68659abc6465ef42f002f73bd2607e953ac5
Reviewed-on: https://webrtc-review.googlesource.com/33004
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21321}
2017-12-18 11:56:48 +00:00
74cefe195e Removing dependency on JsepTransport from DtlsTransport tests.
The DtlsTransport tests worked by relying on JsepTransport (a helper
class used by higher layers to set everything up in response to SDP).
dtlstransport_unittest has been switched to just calling SetSslRole and
SetRemoteFingerprint directly instead, which were really the only parts
that were necessary.

Some refactoring was also done, and some test coverage was moved to
jseptransport_unittest. jseptransport_unittests has more coverage to
ensure that negotiated parameters are propagated to the DtlsTransport
underneath, which were previously covered by the tests in
dtlstransport_unittest. It also has a test that covers RTP/RTCP not
being multiplexed, which dtlstransport_unittests really doesn't need
to be concerned about.

BUG=NONE

Change-Id: I1d67e9a06486ade39a255555af4052d76191d238
Reviewed-on: https://webrtc-review.googlesource.com/32941
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21309}
2017-12-15 21:06:17 +00:00
8af2186ad5 Destroy stats collectors before destroying BaseChannels
Bug: None
Change-Id: I4b54cc0a3cf694f536ba1775d55dab58fd0df536
Reviewed-on: https://webrtc-review.googlesource.com/33561
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21308}
2017-12-15 21:01:07 +00:00
f9381f0e73 Implement PeerConnection::AddTrack/RemoveTrack for Unified Plan
Bug: webrtc:7600
Change-Id: I2a48426a29ac67b6bdbd7817fe07273cdd5fd980
Reviewed-on: https://webrtc-review.googlesource.com/31647
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21305}
2017-12-15 18:54:37 +00:00
3e113438b1 Fix circular dependencies in webrtc_common.
One reason for the circular deps is that common_types.h is a
historical dumping ground for various structs and defines that
are believed to be generally useful. I tried moving things out
that did not appear to be used downstream (StreamCounters,
RtpCounters etc) and moved the things that seemed used
(RtpHeader + supporting structs) to a new file api/rtp_headers.h.
This makes their place in the api more clear while moving out
the things that don't belong in the API in the first place.

I had to extract out typedefs.h from webrtc_common to resolve
another circular dependency. I believe checks includes typedefs,
but common depends on checks.

Bug: webrtc:7745
Change-Id: I725d49616b1ec0cdc8b74be7c078f7a4d46f084b
Reviewed-on: https://webrtc-review.googlesource.com/33001
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21295}
2017-12-15 14:33:26 +00:00
a8005cfd8b Fix circular dependencies between optional, array_view, and rtc_base.
This splits things out of rtc_base and makes dependencies explicit.

Bug: webrtc:6828
Change-Id: Id521896c3c43595349021c857bec216e429a0c8d
Reviewed-on: https://webrtc-review.googlesource.com/32780
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21264}
2017-12-14 06:49:11 +00:00
e26456a4ed Removes usage of AGC APIs in the ADM.
Bug: webrtc:8598
Change-Id: I5ebc2e3549eba039797e40d2f8aea48341f3fe46
Reviewed-on: https://webrtc-review.googlesource.com/31520
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21254}
2017-12-13 16:32:21 +00:00
d37709b659 Revert "Fix circular dependencies between optional, array_view, and rtc_base."
This reverts commit a9e0924fa7688c4e4558e179c6608ce1093e15f8.

Reason for revert: Breaks because of RTC_LAST_SYSTEM_ERROR

Original change's description:
> Fix circular dependencies between optional, array_view, and rtc_base.
> 
> This splits things out of rtc_base and makes dependencies explicit.
> 
> Bug: webrtc:6828
> Change-Id: Ib813c7bd9e4de7ab015acb917bc09ee7204ba7bd
> Reviewed-on: https://webrtc-review.googlesource.com/31940
> Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21245}

TBR=phoglund@webrtc.org,kwiberg@webrtc.org

Change-Id: I1a5dcf2223f00ae7c46f9f2a12b990ab3a84397d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:6828
Reviewed-on: https://webrtc-review.googlesource.com/32760
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21251}
2017-12-13 14:56:33 +00:00
a9e0924fa7 Fix circular dependencies between optional, array_view, and rtc_base.
This splits things out of rtc_base and makes dependencies explicit.

Bug: webrtc:6828
Change-Id: Ib813c7bd9e4de7ab015acb917bc09ee7204ba7bd
Reviewed-on: https://webrtc-review.googlesource.com/31940
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21245}
2017-12-13 13:44:21 +00:00
719487ec7a Generate signed packets_lost in WebRTC-stats
Bug: webrtc:8626
Change-Id: Ibeca29c5bb01e57c87fbf6a3c8589eb4e03089d5
Reviewed-on: https://webrtc-review.googlesource.com/32660
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21241}
2017-12-13 12:25:42 +00:00
e97de91d39 Use static_cast to get webrtc::Peerconnection in common workaround.
Bug: None
Change-Id: I523a22cfe69757e38922634d6054dca2d3bedb1a
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/32640
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21239}
2017-12-13 12:20:31 +00:00
3fe1b15413 Fix PeerConnection crashing on Close() when Unified Plan enabled
Bug: webrtc:8587
Change-Id: I283f6dbcf8ee7d0f99f528031137425afc35e4f4
Reviewed-on: https://webrtc-review.googlesource.com/31642
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21232}
2017-12-12 21:47:34 +00:00
e8e8ad8d19 [CFI] Fix cfi-icall failures
Control Flow Integrity [1] indirect call checking verifies that function
pointers only call valid functions with a matching type signature.
webrtc casts the function pointers for external_hmac causing a cfi-icall
failure when they are later called in libsrtp. Refactor the functions to
match the correct type signatures to avoid this failure.

[1] https://www.chromium.org/developers/testing/control-flow-integrity

Bug: chromium:776905
Change-Id: I419028be02e6c151c497e3ec64f10f35e07cdb0f
Reviewed-on: https://webrtc-review.googlesource.com/26721
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21220}
2017-12-12 09:27:07 +00:00
c08de0f4b7 Allow the TransportController to create RTP level transports.
Add methods to TransportController so that it can create RTP level transports
(RtpTransport, SrtpTransport and DtlsSrtpTransport.).

The RTP level transports are ref-counted since they could be shared by multiple
BaseChannels and TransportController manages the life time of the transports.

Bug: webrtc:7013
Change-Id: Ifd31062426e513d95473e257c9c9ff84a8c537fd
Reviewed-on: https://webrtc-review.googlesource.com/5080
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21196}
2017-12-11 09:19:25 +00:00
9a44f96ea7 Delete rtc_base/window.h.
Bug: webrtc:6424
Change-Id: Iaed83b07dd469a9990f48fe41fcdff5e7493eb31
Reviewed-on: https://webrtc-review.googlesource.com/31480
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21194}
2017-12-11 07:59:35 +00:00
5634427c09 Remove unused properties from MediaContentDescription
Bug: webrtc:8620
Change-Id: I0597495a93aa7507177cf7bcbb8c6d35ee90ae0d
Reviewed-on: https://webrtc-review.googlesource.com/30500
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21150}
2017-12-07 23:03:19 +00:00
a3a92c264b Replace string type with SdpType enum
This moves all WebRTC internal code from using
SessionDescriptionInterface::type() which returns a string and
from using CreateSessionDescription with a string type parameter.

Bug: webrtc:8613
Change-Id: I1cdd93dc4b26dec157e22476fdac569d5da2810a
Reviewed-on: https://webrtc-review.googlesource.com/29500
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21147}
2017-12-07 19:08:47 +00:00
e51f785043 Stop using public_deps in pc/.
TBR=phoglund@webrtc.org

Bug: webrtc:8603
Change-Id: If18e5a4d212392bbd9b4e1f9c2f00ee79a2ab348
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/29864
Reviewed-by: Edward Lemur <ehmaldonado@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21139}
2017-12-07 13:57:57 +00:00
3828c06a58 Replace cricket::ContentAction with webrtc::SdpType
Bug: webrtc:8613
Change-Id: I9bce2b9d8c8445d2fa1b9f60b06596a5621ebc2f
Reviewed-on: https://webrtc-review.googlesource.com/29460
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21130}
2017-12-06 19:40:16 +00:00
a498ae83ac Stop using public_deps in system_wrappers.
TBR=phoglund@webrtc.org

Bug: webrtc:8603
Change-Id: I5e515f0e4dc955a01460d69ba4e21bdfdf152d20
Reviewed-on: https://webrtc-review.googlesource.com/29104
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Edward Lemur <ehmaldonado@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21112}
2017-12-06 08:56:52 +00:00
88f2cb9479 Introduce webrtc::SdpType, the chosen enum for offer/pranswer/answer
This change introduces a new method |GetType()| in
SessionDescriptionInterface which returns an enum for the SDP type
rather than a string. Additionally, new overloads were added for
CreateSessionDescription to take SdpType instead of a type string.

Bug: webrtc:8613
Change-Id: I52b342f12155daf8d623646b0c21b7562f69d101
Reviewed-on: https://webrtc-review.googlesource.com/29380
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21100}
2017-12-06 02:27:32 +00:00
ed10bd9549 Modify SetLocalDescription helpers to work with RtpTransceivers
This change allows EnableBundle and PushdownMediaDescription to
work with RtpTransceivers, which means they can be reused in the
Unified Plan version of SetLocalDescription.

Bug: webrtc:8587
Change-Id: I4d862556879c14cea06fdf9d5c7c29cc32e1057a
Reviewed-on: https://webrtc-review.googlesource.com/27762
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21092}
2017-12-05 19:32:12 +00:00
6d6a2ae174 Refactor PeerConnection::UpdateSessionState
This rewrites UpdateSessionState to better show the logic common
to all description types and the logic specific to
offers/answers/etc. Separating these will allow more code to be
reused with the Unified Plan implementation.

Bug: webrtc:8587
Change-Id: I56e0370dcb8bb4b59af2a5209edcad4606480e1c
Reviewed-on: https://webrtc-review.googlesource.com/27322
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21065}
2017-12-05 02:11:51 +00:00
2039306d66 Replace PeerConnection::Action with cricket::ContentAction
PeerConnection had an Action enum as a holdover from the
WebRtcSession merge with the same members as
cricket::ContentAction. Since ContentAction is used in more places
outside of PeerConnection, this change removes the Action enum and
replaces its use with cricket::ContentAction.

Bug: webrtc:8587
Change-Id: I3e825fe285dbaf6b3f128eccde0f38864171af13
Reviewed-on: https://webrtc-review.googlesource.com/27321
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21063}
2017-12-05 00:53:19 +00:00
8a006916ce Use RTCError for internal PeerConnection methods
Calls to SetLocalDescription and SetRemoteDescription in
PeerConnection delegate to many different internal helper methods
which can fail. The error ultimately needs to propagate to the
caller and cause the SetXXXDescription to fail. Right now these
methods signal errors by returning false and copying the error
message into an out parameter. This changes these methods to
return RTCError instead and avoid the use of the out parameter.

Bug: webrtc:8587
Change-Id: Ib1d31622be742718b74780110c1bbe273d66444e
Reviewed-on: https://webrtc-review.googlesource.com/27241
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21061}
2017-12-05 00:04:39 +00:00
f847081c25 Rename PeerConnection::Error to PeerConnection::SessionError
Also renames methods for interacting with the session error. This
clarifies the scope of this error type and lets methods have a
local variable named |error| without confusing it with the
|error()| getter.

Bug: webrtc:8587
Change-Id: I90e6eed24d961abbce15e56a76a8793ff1a806ea
Reviewed-on: https://webrtc-review.googlesource.com/27124
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21060}
2017-12-04 23:21:29 +00:00
2dfc42d7b6 Prepare to make BaseChannel depend on RtpTransportInternal only.
Eventually we want BaseChannel to depend on the RtpTransportInternal
instead of DtlsTransportInternal and share RtpTransport when bundling.
This CL is the first step.

Add SetRtpTransport and Init_w(RtptransportInternal*) to BaseChannel.
These two methods would replace the existing SetTransports and Init_w
methods.

Add new CreateVoice/VideoChannel methods to the ChannelManager which
 take RtpTransportInternal instead of Dtls/PacketTransportInternal.

|cotnent_name| is removed from the SrtpTransport to simplify to code
since it is only used for debugging.

InitNetwork_n is removed from BaseChannel in CL as well.

Bug: webrtc:7013
Change-Id: I35b1565958548bd4896854c49e61d3ee160b7634
Reviewed-on: https://webrtc-review.googlesource.com/27840
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21057}
2017-12-04 22:27:39 +00:00
e169272507 Fixed a bug in determining ICE roles.
When the initial offer side uses the ICE lite implementation, and
initiates a peer connection with an endpoint with the full
implementation, the offer side assumes the controlled ICE role per
RFC5245 and the remote endpoint MUST take the controlling role.

This logic was partially implemented in SetRemoteTransportDescription in
reflection where the endpoint switches its role to the controlling after
receiving the offer. The bug was caused by the following
SetLocalDescription at the remote endpoint after creating the answer,
which overrides the role to the controlled since it has no initial offer
and the role is not reflected in SetLocalTransportDescription. This
results in no nomination of candidate pairs and timeout of establishing
the peer connection.

The fix adds reflection on one's ICE role in SetLocalTransportDescription.
This fix also takes into account the case when both sides use the lite
implementation of ICE and the initial offer side MUST take the controlling
role per RFC5245 in this case, which is the default behavior in the
current implementation.

Bug: webrtc:8531
Change-Id: I65edd296c155bff51fcdb28709975e6837f302d5
Reviewed-on: https://webrtc-review.googlesource.com/26780
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#21053}
2017-12-04 20:08:28 +00:00
6fec880dd1 Unify and de-duplicate BaseChannel deletion in PeerConnection
This refactoring reduces code duplication in PeerConnection and
will make it easier to use these methods with the Unified Plan
implementation.

Bug: webrtc:8587
Change-Id: I6afd44fff702290903555cbe7703198b6b091da6
Reviewed-on: https://webrtc-review.googlesource.com/26822
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21052}
2017-12-04 19:49:38 +00:00
eda6ccd0c2 Refactor BaseChannel creation in PeerConnection
This changes the CreateVoiceChannel/CreateVideoChannel helper
methods in PeerConnection to return the created channel instead of
setting it directly. That allows the Unified Plan version of
SetLocalDescription to use the same factory methods without the
assumption that there is at most one voice and one video channel.

Also simplifies and deduplicates the logic for determining the
transport name for a given channel in the presence of BUNDLE.

Bug: webrtc:8587
Change-Id: I1f156f45309ce2d08d6d5d5ed3c6e01fbf094b36
Reviewed-on: https://webrtc-review.googlesource.com/26821
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21050}
2017-12-04 18:55:38 +00:00
d745578229 Call SrtpTransport::EnableExternalAuth when enabling SDES.
When enabling SDES in BaseChannel, SrtpTransport::EnableExternalAuth
should be called if the external authenication is enabled which is
not covered by the current test set.

TBR=pthatcher@webrtc.org

Bug: webrtc:7013
Change-Id: Ibbf458516a521a488e8e3bb4a5a29fca70a627f5
Reviewed-on: https://webrtc-review.googlesource.com/27761
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20960}
2017-11-30 23:47:30 +00:00
2a4d70cc93 Make the DtlsSrtpTransport cache the RtpAbsSendTimeHeaderExtension.
Add a method to DtlsSrtpTransport to cache the RTP Absolute Send Time
extension id. The method would be called when using DTLS-SRTP with
external authentication.

TBR=pthatcher@webrtc.org

Bug: webrtc:7013
Change-Id: Ie9edb9382cbb4cf43eea5da3030991a0d20293a5
Reviewed-on: https://webrtc-review.googlesource.com/27260
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20947}
2017-11-30 02:17:09 +00:00
f72ab8395a Remove transceiver direction getter/setter
This was only used to ensure compatibility with external projects.
Now that everyone has moved to RtpTransceiverDirection, these
methods are redundant.

Bug: webrtc:8558
Change-Id: Iff5a8d13f9a4300d06902fa0441ceaeebf6809a2
Reviewed-on: https://webrtc-review.googlesource.com/24746
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20945}
2017-11-29 23:18:19 +00:00
cd3fc5d90c Use the DtlsSrtpTransport in BaseChannel.
The DtlsSrtpTransport takes the reponsiblity of setting up DTLS-SRTP from
the BaseChannel.

The BaseChannel doesn't handle the signals from the P2P layer transport anymore.
The RtpTransport handles the signals from the PacketTransportInternal and the
DtlsSrtpTransport handles the DTLS-specific signals and determines when to extract
the keys and setting the parameters.

In channel_unittests.cc, call from DTLS to SDES is expected to fail since the
fallback from DTLS to SDES is not supported.

Bug: webrtc:7013
Change-Id: I0a54e017986f5a8ae9710e79643a4651bef3c38f
Reviewed-on: https://webrtc-review.googlesource.com/24702
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20941}
2017-11-29 19:38:39 +00:00
4e70a72571 Replace MediaContentDirection with RtpTransceiverDirection
Bug: webrtc:8558
Change-Id: I410d17cce235e0b42038cf0b125fd916010f50ae
Reviewed-on: https://webrtc-review.googlesource.com/24745
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20922}
2017-11-28 23:44:28 +00:00
36207d600a Remove "using rtc::scoped_ptr" from audiotrack.cc.
This is causing compilation issues in a chromium cl because of type conflicts.

BUG=none
TBR=henrikg@webrtc.org

Tbr-ing to fix build issue upstream and because there's no code change.

Change-Id: Ia34ae3844fe3f57f047cb44422fa591f752b7bda
Reviewed-on: https://webrtc-review.googlesource.com/26680
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20921}
2017-11-28 21:29:18 +00:00
aba85d1f53 Resolve circular dependency in rtc_media_base.
This one was pretty straightforward fortunately.

Bug: webrtc:6828
Change-Id: Ie7b5e71f1298c409dbca2c74eaa09c0986e41d8f
Reviewed-on: https://webrtc-review.googlesource.com/25821
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20914}
2017-11-28 15:28:58 +00:00
73da79cf66 Step 1 to remove MediaContentDirection
This change adds |transceiver_direction()| and
|set_transceiver_direction()| to MediaContentDescription so that
external users can switch off of MediaContentDirection.

This deprecates the use of |direction()| and |set_direction()|
for external users. Once everyone has moved off of those methods,
the signiture will change to return/set RtpTransceiverDirection.
Then external users can move back to these methods with the new
signature.

Bug: webrtc:8558
Change-Id: I7e3ba289d3a0ac738b364b0388621cc3e7bcf5d3
Reviewed-on: https://webrtc-review.googlesource.com/24743
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20900}
2017-11-28 00:15:17 +00:00