Add AddTransceiver and GetTransceivers to PeerConnection

WebRTC 1.0 has added the transceiver API to PeerConnection. This
is the first step towards exposing this to WebRTC consumers. For
now, transceivers can be added and fetched but there is not yet
support for creating offers/answers or setting local/remote
descriptions. That support ("Unified Plan") will be added in
follow-up CLs.

The transceiver API is currently only available if the application
opts in by specifying the kUnifiedPlan SDP semantics when creating
the PeerConnection.

Bug: webrtc:7600
Change-Id: I0b8ee24b489b45bb4c5f60b699bd20c61af01d8e
Reviewed-on: https://webrtc-review.googlesource.com/23880
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20896}
This commit is contained in:
Steve Anton
2017-11-27 10:59:33 -08:00
committed by Commit Bot
parent 92016ce5a4
commit f93d2800d9
10 changed files with 487 additions and 42 deletions

View File

@ -12,6 +12,7 @@
#define API_RTPTRANSCEIVERINTERFACE_H_
#include <string>
#include <vector>
#include "api/optional.h"
#include "api/rtpreceiverinterface.h"
@ -20,6 +21,7 @@
namespace webrtc {
// https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiverdirection
enum class RtpTransceiverDirection {
kSendRecv,
kSendOnly,
@ -27,6 +29,21 @@ enum class RtpTransceiverDirection {
kInactive
};
// Structure for initializing an RtpTransceiver in a call to
// PeerConnectionInterface::AddTransceiver.
// https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiverinit
struct RtpTransceiverInit final {
// Direction of the RtpTransceiver. See RtpTransceiverInterface::direction().
RtpTransceiverDirection direction = RtpTransceiverDirection::kSendRecv;
// The added RtpTransceiver will be added to these streams.
// TODO(bugs.webrtc.org/7600): Not implemented.
std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams;
// TODO(bugs.webrtc.org/7600): Not implemented.
std::vector<RtpEncodingParameters> send_encodings;
};
// The RtpTransceiverInterface maps to the RTCRtpTransceiver defined by the
// WebRTC specification. A transceiver represents a combination of an RtpSender
// and an RtpReceiver than share a common mid. As defined in JSEP, an