OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 156 } |
157 | 157 |
158 bool Codec::HasFeedbackParam(const FeedbackParam& param) const { | 158 bool Codec::HasFeedbackParam(const FeedbackParam& param) const { |
159 return feedback_params.Has(param); | 159 return feedback_params.Has(param); |
160 } | 160 } |
161 | 161 |
162 void Codec::IntersectFeedbackParams(const Codec& other) { | 162 void Codec::IntersectFeedbackParams(const Codec& other) { |
163 feedback_params.Intersect(other.feedback_params); | 163 feedback_params.Intersect(other.feedback_params); |
164 } | 164 } |
165 | 165 |
166 AudioCodec::AudioCodec(int pt, | 166 AudioCodec::AudioCodec(int id, |
167 const std::string& nm, | 167 const std::string& name, |
168 int cr, | 168 int clockrate, |
169 int br, | 169 int bitrate, |
170 int cs, | 170 int channels, |
171 int pr) | 171 int preference) |
172 : Codec(pt, nm, cr, pr), bitrate(br), channels(cs) { | 172 : Codec(id, name, clockrate, preference), |
| 173 bitrate(bitrate), |
| 174 channels(channels) { |
173 } | 175 } |
174 | 176 |
175 AudioCodec::AudioCodec() : Codec(), bitrate(0), channels(0) { | 177 AudioCodec::AudioCodec() : Codec(), bitrate(0), channels(0) { |
176 } | 178 } |
177 | 179 |
178 AudioCodec::AudioCodec(const AudioCodec& c) = default; | 180 AudioCodec::AudioCodec(const AudioCodec& c) = default; |
179 | 181 |
180 AudioCodec& AudioCodec::operator=(const AudioCodec& c) { | 182 AudioCodec& AudioCodec::operator=(const AudioCodec& c) { |
181 Codec::operator=(c); | 183 Codec::operator=(c); |
182 bitrate = c.bitrate; | 184 bitrate = c.bitrate; |
(...skipping 29 matching lines...) Expand all Loading... |
212 return os.str(); | 214 return os.str(); |
213 } | 215 } |
214 | 216 |
215 std::string VideoCodec::ToString() const { | 217 std::string VideoCodec::ToString() const { |
216 std::ostringstream os; | 218 std::ostringstream os; |
217 os << "VideoCodec[" << id << ":" << name << ":" << width << ":" << height | 219 os << "VideoCodec[" << id << ":" << name << ":" << width << ":" << height |
218 << ":" << framerate << ":" << preference << "]"; | 220 << ":" << framerate << ":" << preference << "]"; |
219 return os.str(); | 221 return os.str(); |
220 } | 222 } |
221 | 223 |
222 VideoCodec::VideoCodec(int pt, | 224 VideoCodec::VideoCodec(int id, |
223 const std::string& nm, | 225 const std::string& name, |
224 int w, | 226 int width, |
225 int h, | 227 int height, |
226 int fr, | 228 int framerate, |
227 int pr) | 229 int preference) |
228 : Codec(pt, nm, kVideoCodecClockrate, pr), | 230 : Codec(id, name, kVideoCodecClockrate, preference), |
229 width(w), | 231 width(width), |
230 height(h), | 232 height(height), |
231 framerate(fr) { | 233 framerate(framerate) { |
232 } | 234 } |
233 | 235 |
234 VideoCodec::VideoCodec(int pt, const std::string& nm) | 236 VideoCodec::VideoCodec(int id, const std::string& name) |
235 : Codec(pt, nm, kVideoCodecClockrate, 0), | 237 : Codec(id, name, kVideoCodecClockrate, 0), |
236 width(0), | 238 width(0), |
237 height(0), | 239 height(0), |
238 framerate(0) { | 240 framerate(0) { |
239 } | 241 } |
240 | 242 |
241 VideoCodec::VideoCodec() : Codec(), width(0), height(0), framerate(0) { | 243 VideoCodec::VideoCodec() : Codec(), width(0), height(0), framerate(0) { |
242 clockrate = kVideoCodecClockrate; | 244 clockrate = kVideoCodecClockrate; |
243 } | 245 } |
244 | 246 |
245 VideoCodec::VideoCodec(const VideoCodec& c) = default; | 247 VideoCodec::VideoCodec(const VideoCodec& c) = default; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 bool HasTransportCc(const VideoCodec& codec) { | 339 bool HasTransportCc(const VideoCodec& codec) { |
338 return codec.HasFeedbackParam( | 340 return codec.HasFeedbackParam( |
339 FeedbackParam(kRtcpFbParamTransportCc, kParamValueEmpty)); | 341 FeedbackParam(kRtcpFbParamTransportCc, kParamValueEmpty)); |
340 } | 342 } |
341 | 343 |
342 bool CodecNamesEq(const std::string& name1, const std::string& name2) { | 344 bool CodecNamesEq(const std::string& name1, const std::string& name2) { |
343 return _stricmp(name1.c_str(), name2.c_str()) == 0; | 345 return _stricmp(name1.c_str(), name2.c_str()) == 0; |
344 } | 346 } |
345 | 347 |
346 } // namespace cricket | 348 } // namespace cricket |
OLD | NEW |