aboutsummaryrefslogtreecommitdiff
path: root/pc/session_description.h
diff options
context:
space:
mode:
Diffstat (limited to 'pc/session_description.h')
-rw-r--r--pc/session_description.h44
1 files changed, 21 insertions, 23 deletions
diff --git a/pc/session_description.h b/pc/session_description.h
index 52e891e433..403e46529f 100644
--- a/pc/session_description.h
+++ b/pc/session_description.h
@@ -43,10 +43,8 @@
namespace cricket {
-typedef std::vector<AudioCodec> AudioCodecs;
-typedef std::vector<VideoCodec> VideoCodecs;
-typedef std::vector<CryptoParams> CryptoParamsVec;
-typedef std::vector<webrtc::RtpExtension> RtpHeaderExtensions;
+using CryptoParamsVec = std::vector<CryptoParams>;
+using RtpHeaderExtensions = std::vector<webrtc::RtpExtension>;
// Options to control how session descriptions are generated.
const int kAutoBandwidth = -1;
@@ -258,8 +256,9 @@ class MediaContentDescription {
}
protected:
- // TODO(bugs.webrtc.org/15214): move all RTP related things to a subclass that
- // the SCTP content description does not inherit from.
+ // TODO(bugs.webrtc.org/15214): move all RTP related things to
+ // RtpMediaDescription that the SCTP content description does
+ // not inherit from.
std::string protocol_;
private:
@@ -290,37 +289,36 @@ class MediaContentDescription {
std::vector<Codec> codecs_;
};
-template <class C>
-class MediaContentDescriptionImpl : public MediaContentDescription {
+class RtpMediaContentDescription : public MediaContentDescription {};
+
+class AudioContentDescription : public RtpMediaContentDescription {
public:
void set_protocol(absl::string_view protocol) override {
RTC_DCHECK(IsRtpProtocol(protocol));
protocol_ = std::string(protocol);
}
-};
-
-class AudioContentDescription : public MediaContentDescriptionImpl<Codec> {
- public:
- AudioContentDescription() {}
-
- virtual MediaType type() const { return MEDIA_TYPE_AUDIO; }
- virtual AudioContentDescription* as_audio() { return this; }
- virtual const AudioContentDescription* as_audio() const { return this; }
+ MediaType type() const override { return MEDIA_TYPE_AUDIO; }
+ AudioContentDescription* as_audio() override { return this; }
+ const AudioContentDescription* as_audio() const override { return this; }
private:
- virtual AudioContentDescription* CloneInternal() const {
+ AudioContentDescription* CloneInternal() const override {
return new AudioContentDescription(*this);
}
};
-class VideoContentDescription : public MediaContentDescriptionImpl<Codec> {
+class VideoContentDescription : public RtpMediaContentDescription {
public:
- virtual MediaType type() const { return MEDIA_TYPE_VIDEO; }
- virtual VideoContentDescription* as_video() { return this; }
- virtual const VideoContentDescription* as_video() const { return this; }
+ void set_protocol(absl::string_view protocol) override {
+ RTC_DCHECK(IsRtpProtocol(protocol));
+ protocol_ = std::string(protocol);
+ }
+ MediaType type() const override { return MEDIA_TYPE_VIDEO; }
+ VideoContentDescription* as_video() override { return this; }
+ const VideoContentDescription* as_video() const override { return this; }
private:
- virtual VideoContentDescription* CloneInternal() const {
+ VideoContentDescription* CloneInternal() const override {
return new VideoContentDescription(*this);
}
};