Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: talk/media/base/codec.h

Issue 1534193008: Misc. small cleanups (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Unnecessary parens Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | talk/media/base/codec.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 int 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 id,
135 const std::string& name,
136 int clockrate,
137 int bitrate,
138 int channels,
139 int preference);
135 // Creates an empty codec. 140 // Creates an empty codec.
136 AudioCodec(); 141 AudioCodec();
137 AudioCodec(const AudioCodec& c); 142 AudioCodec(const AudioCodec& c);
138 ~AudioCodec() = default; 143 ~AudioCodec() = default;
139 144
140 // Indicates if this codec is compatible with the specified codec. 145 // Indicates if this codec is compatible with the specified codec.
141 bool Matches(const AudioCodec& codec) const; 146 bool Matches(const AudioCodec& codec) const;
142 147
143 static bool Preferable(const AudioCodec& first, const AudioCodec& other) { 148 static bool Preferable(const AudioCodec& first, const AudioCodec& other) {
144 return first.preference > other.preference; 149 return first.preference > other.preference;
145 } 150 }
146 151
147 std::string ToString() const; 152 std::string ToString() const;
148 153
149 AudioCodec& operator=(const AudioCodec& c); 154 AudioCodec& operator=(const AudioCodec& c);
150 155
151 bool operator==(const AudioCodec& c) const; 156 bool operator==(const AudioCodec& c) const;
152 157
153 bool operator!=(const AudioCodec& c) const { 158 bool operator!=(const AudioCodec& c) const {
154 return !(*this == c); 159 return !(*this == c);
155 } 160 }
156 }; 161 };
157 162
158 struct VideoCodec : public Codec { 163 struct VideoCodec : public Codec {
159 int width; 164 int width;
160 int height; 165 int height;
161 int framerate; 166 int framerate;
162 167
163 // Creates a codec with the given parameters. 168 // Creates a codec with the given parameters.
164 VideoCodec(int pt, const std::string& nm, int w, int h, int fr, int pr); 169 VideoCodec(int id,
165 VideoCodec(int pt, const std::string& nm); 170 const std::string& name,
171 int width,
172 int height,
173 int framerate,
174 int preference);
175 VideoCodec(int id, const std::string& name);
166 // Creates an empty codec. 176 // Creates an empty codec.
167 VideoCodec(); 177 VideoCodec();
168 VideoCodec(const VideoCodec& c); 178 VideoCodec(const VideoCodec& c);
169 ~VideoCodec() = default; 179 ~VideoCodec() = default;
170 180
171 static bool Preferable(const VideoCodec& first, const VideoCodec& other) { 181 static bool Preferable(const VideoCodec& first, const VideoCodec& other) {
172 return first.preference > other.preference; 182 return first.preference > other.preference;
173 } 183 }
174 184
175 std::string ToString() const; 185 std::string ToString() const;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } 235 }
226 236
227 bool CodecNamesEq(const std::string& name1, const std::string& name2); 237 bool CodecNamesEq(const std::string& name1, const std::string& name2);
228 bool HasNack(const VideoCodec& codec); 238 bool HasNack(const VideoCodec& codec);
229 bool HasRemb(const VideoCodec& codec); 239 bool HasRemb(const VideoCodec& codec);
230 bool HasTransportCc(const VideoCodec& codec); 240 bool HasTransportCc(const VideoCodec& codec);
231 241
232 } // namespace cricket 242 } // namespace cricket
233 243
234 #endif // TALK_MEDIA_BASE_CODEC_H_ 244 #endif // TALK_MEDIA_BASE_CODEC_H_
OLDNEW
« no previous file with comments | « no previous file | talk/media/base/codec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698