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}
This commit is contained in:
@ -590,10 +590,24 @@ class PeerConnectionInterface : public rtc::RefCountInterface {
|
||||
virtual void RemoveStream(MediaStreamInterface* stream) = 0;
|
||||
|
||||
// Add a new MediaStreamTrack to be sent on this PeerConnection, and return
|
||||
// the newly created RtpSender.
|
||||
// the newly created RtpSender. The RtpSender will be associated with the
|
||||
// streams specified in the |stream_labels| list.
|
||||
//
|
||||
// Errors:
|
||||
// - INVALID_PARAMETER: |track| is null, has a kind other than audio or video,
|
||||
// or a sender already exists for the track.
|
||||
// - INVALID_STATE: The PeerConnection is closed.
|
||||
// TODO(steveanton): Remove default implementation once downstream
|
||||
// implementations have been updated.
|
||||
virtual RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>
|
||||
AddTrackWithStreamLabels(rtc::scoped_refptr<MediaStreamTrackInterface> track,
|
||||
const std::vector<std::string>& stream_labels) {
|
||||
return RTCError(RTCErrorType::UNSUPPORTED_OPERATION, "Not implemented");
|
||||
}
|
||||
// |streams| indicates which stream labels the track should be associated
|
||||
// with.
|
||||
// TODO(steveanton): Remove this overload once callers have moved to the
|
||||
// signature with stream labels.
|
||||
virtual rtc::scoped_refptr<RtpSenderInterface> AddTrack(
|
||||
MediaStreamTrackInterface* track,
|
||||
std::vector<MediaStreamInterface*> streams) = 0;
|
||||
|
||||
@ -28,6 +28,10 @@ BEGIN_SIGNALING_PROXY_MAP(PeerConnection)
|
||||
PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>, remote_streams)
|
||||
PROXY_METHOD1(bool, AddStream, MediaStreamInterface*)
|
||||
PROXY_METHOD1(void, RemoveStream, MediaStreamInterface*)
|
||||
PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>,
|
||||
AddTrackWithStreamLabels,
|
||||
rtc::scoped_refptr<MediaStreamTrackInterface>,
|
||||
const std::vector<std::string>&);
|
||||
PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>,
|
||||
AddTrack,
|
||||
MediaStreamTrackInterface*,
|
||||
|
||||
@ -38,7 +38,7 @@ struct RtpTransceiverInit final {
|
||||
|
||||
// The added RtpTransceiver will be added to these streams.
|
||||
// TODO(bugs.webrtc.org/7600): Not implemented.
|
||||
std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams;
|
||||
std::vector<std::string> stream_labels;
|
||||
|
||||
// TODO(bugs.webrtc.org/7600): Not implemented.
|
||||
std::vector<RtpEncodingParameters> send_encodings;
|
||||
|
||||
Reference in New Issue
Block a user