| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 bool operator==(const Codec& c) const; | 122 bool operator==(const Codec& c) const; |
| 123 | 123 |
| 124 bool operator!=(const Codec& c) const { | 124 bool operator!=(const Codec& c) const { |
| 125 return !(*this == c); | 125 return !(*this == c); |
| 126 } | 126 } |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 struct AudioCodec : public Codec { | 129 struct AudioCodec : public Codec { |
| 130 int bitrate; | 130 int bitrate; |
| 131 int channels; | 131 size_t channels; |
| 132 | 132 |
| 133 // Creates a codec with the given parameters. | 133 // Creates a codec with the given parameters. |
| 134 AudioCodec(int pt, const std::string& nm, int cr, int br, int cs, int pr); | 134 AudioCodec(int pt, const std::string& nm, int cr, int br, size_t cs, int pr); |
| 135 // Creates an empty codec. | 135 // Creates an empty codec. |
| 136 AudioCodec(); | 136 AudioCodec(); |
| 137 AudioCodec(const AudioCodec& c); | 137 AudioCodec(const AudioCodec& c); |
| 138 ~AudioCodec() = default; | 138 ~AudioCodec() = default; |
| 139 | 139 |
| 140 // Indicates if this codec is compatible with the specified codec. | 140 // Indicates if this codec is compatible with the specified codec. |
| 141 bool Matches(const AudioCodec& codec) const; | 141 bool Matches(const AudioCodec& codec) const; |
| 142 | 142 |
| 143 static bool Preferable(const AudioCodec& first, const AudioCodec& other) { | 143 static bool Preferable(const AudioCodec& first, const AudioCodec& other) { |
| 144 return first.preference > other.preference; | 144 return first.preference > other.preference; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 return false; | 268 return false; |
| 269 } | 269 } |
| 270 | 270 |
| 271 bool CodecNamesEq(const std::string& name1, const std::string& name2); | 271 bool CodecNamesEq(const std::string& name1, const std::string& name2); |
| 272 bool HasNack(const VideoCodec& codec); | 272 bool HasNack(const VideoCodec& codec); |
| 273 bool HasRemb(const VideoCodec& codec); | 273 bool HasRemb(const VideoCodec& codec); |
| 274 | 274 |
| 275 } // namespace cricket | 275 } // namespace cricket |
| 276 | 276 |
| 277 #endif // TALK_MEDIA_BASE_CODEC_H_ | 277 #endif // TALK_MEDIA_BASE_CODEC_H_ |
| OLD | NEW |