Move DTMF sender to RtpSender (as opposed to WebRtcSession).

Previously in the spec, there was a createDtmfSender method on
PeerConnection, but that's been replaced by a "dtmf" attribute
on RtpSender, which allows getting a DTMF sender without having
an audio track.

This also simplifies the code slightly, since tracks are now not
necessary for identification.

BUG=webrtc:4180

Review-Url: https://codereview.webrtc.org/2666853002
Cr-Commit-Position: refs/heads/master@{#16409}
This commit is contained in:
deadbeef
2017-02-01 20:27:00 -08:00
committed by Commit bot
parent 2e03c66119
commit 20cb0c1c85
12 changed files with 198 additions and 191 deletions

View File

@ -17,6 +17,7 @@
#include <string>
#include <vector>
#include "webrtc/api/dtmfsenderinterface.h"
#include "webrtc/api/mediatypes.h"
#include "webrtc/api/mediastreaminterface.h"
#include "webrtc/api/proxy.h"
@ -51,6 +52,9 @@ class RtpSenderInterface : public rtc::RefCountInterface {
virtual RtpParameters GetParameters() const = 0;
virtual bool SetParameters(const RtpParameters& parameters) = 0;
// Returns null for a video sender.
virtual rtc::scoped_refptr<DtmfSenderInterface> GetDtmfSender() const = 0;
protected:
virtual ~RtpSenderInterface() {}
};
@ -66,6 +70,7 @@ BEGIN_SIGNALING_PROXY_MAP(RtpSender)
PROXY_CONSTMETHOD0(std::vector<std::string>, stream_ids)
PROXY_CONSTMETHOD0(RtpParameters, GetParameters);
PROXY_METHOD1(bool, SetParameters, const RtpParameters&)
PROXY_CONSTMETHOD0(rtc::scoped_refptr<DtmfSenderInterface>, GetDtmfSender);
END_PROXY_MAP()
} // namespace webrtc