OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MEDIA_BASE_CODEC_H_ | 11 #ifndef WEBRTC_MEDIA_BASE_CODEC_H_ |
12 #define WEBRTC_MEDIA_BASE_CODEC_H_ | 12 #define WEBRTC_MEDIA_BASE_CODEC_H_ |
13 | 13 |
14 #include <map> | 14 #include <map> |
15 #include <set> | 15 #include <set> |
16 #include <string> | 16 #include <string> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
| 19 #include "webrtc/api/rtpparameters.h" |
19 #include "webrtc/media/base/mediaconstants.h" | 20 #include "webrtc/media/base/mediaconstants.h" |
20 | 21 |
21 namespace cricket { | 22 namespace cricket { |
22 | 23 |
23 typedef std::map<std::string, std::string> CodecParameterMap; | 24 typedef std::map<std::string, std::string> CodecParameterMap; |
24 | 25 |
25 extern const int kMaxPayloadId; | 26 extern const int kMaxPayloadId; |
26 | 27 |
27 class FeedbackParam { | 28 class FeedbackParam { |
28 public: | 29 public: |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 void AddFeedbackParam(const FeedbackParam& param); | 94 void AddFeedbackParam(const FeedbackParam& param); |
94 | 95 |
95 static bool Preferable(const Codec& first, const Codec& other) { | 96 static bool Preferable(const Codec& first, const Codec& other) { |
96 return first.preference > other.preference; | 97 return first.preference > other.preference; |
97 } | 98 } |
98 | 99 |
99 // Filter |this| feedbacks params such that only those shared by both |this| | 100 // Filter |this| feedbacks params such that only those shared by both |this| |
100 // and |other| are kept. | 101 // and |other| are kept. |
101 void IntersectFeedbackParams(const Codec& other); | 102 void IntersectFeedbackParams(const Codec& other); |
102 | 103 |
| 104 virtual webrtc::RtpCodecParameters ToCodecParameters() const; |
| 105 |
103 Codec& operator=(const Codec& c); | 106 Codec& operator=(const Codec& c); |
104 | 107 |
105 bool operator==(const Codec& c) const; | 108 bool operator==(const Codec& c) const; |
106 | 109 |
107 bool operator!=(const Codec& c) const { | 110 bool operator!=(const Codec& c) const { |
108 return !(*this == c); | 111 return !(*this == c); |
109 } | 112 } |
110 }; | 113 }; |
111 | 114 |
112 struct AudioCodec : public Codec { | 115 struct AudioCodec : public Codec { |
(...skipping 14 matching lines...) Expand all Loading... |
127 | 130 |
128 // Indicates if this codec is compatible with the specified codec. | 131 // Indicates if this codec is compatible with the specified codec. |
129 bool Matches(const AudioCodec& codec) const; | 132 bool Matches(const AudioCodec& codec) const; |
130 | 133 |
131 static bool Preferable(const AudioCodec& first, const AudioCodec& other) { | 134 static bool Preferable(const AudioCodec& first, const AudioCodec& other) { |
132 return first.preference > other.preference; | 135 return first.preference > other.preference; |
133 } | 136 } |
134 | 137 |
135 std::string ToString() const; | 138 std::string ToString() const; |
136 | 139 |
| 140 webrtc::RtpCodecParameters ToCodecParameters() const override; |
| 141 |
137 AudioCodec& operator=(const AudioCodec& c); | 142 AudioCodec& operator=(const AudioCodec& c); |
138 | 143 |
139 bool operator==(const AudioCodec& c) const; | 144 bool operator==(const AudioCodec& c) const; |
140 | 145 |
141 bool operator!=(const AudioCodec& c) const { | 146 bool operator!=(const AudioCodec& c) const { |
142 return !(*this == c); | 147 return !(*this == c); |
143 } | 148 } |
144 }; | 149 }; |
145 | 150 |
146 struct VideoCodec : public Codec { | 151 struct VideoCodec : public Codec { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 } | 223 } |
219 | 224 |
220 bool CodecNamesEq(const std::string& name1, const std::string& name2); | 225 bool CodecNamesEq(const std::string& name1, const std::string& name2); |
221 bool HasNack(const Codec& codec); | 226 bool HasNack(const Codec& codec); |
222 bool HasRemb(const Codec& codec); | 227 bool HasRemb(const Codec& codec); |
223 bool HasTransportCc(const Codec& codec); | 228 bool HasTransportCc(const Codec& codec); |
224 | 229 |
225 } // namespace cricket | 230 } // namespace cricket |
226 | 231 |
227 #endif // WEBRTC_MEDIA_BASE_CODEC_H_ | 232 #endif // WEBRTC_MEDIA_BASE_CODEC_H_ |
OLD | NEW |