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

Side by Side Diff: webrtc/api/webrtcsdp.cc

Issue 2546363002: Refactoring: Declare cricket::Codec constructors protected. (Closed)
Patch Set: Created 4 years 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 | webrtc/media/base/codec.h » ('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 * Copyright 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2011 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
(...skipping 2367 matching lines...) Expand 10 before | Expand all | Expand 10 after
2378 ParseFailed(message, *pos, "Expects m line.", error); 2378 ParseFailed(message, *pos, "Expects m line.", error);
2379 return false; 2379 return false;
2380 } 2380 }
2381 return true; 2381 return true;
2382 } 2382 }
2383 2383
2384 bool VerifyCodec(const cricket::Codec& codec) { 2384 bool VerifyCodec(const cricket::Codec& codec) {
2385 // Codec has not been populated correctly unless the name has been set. This 2385 // Codec has not been populated correctly unless the name has been set. This
2386 // can happen if an SDP has an fmtp or rtcp-fb with a payload type but doesn't 2386 // can happen if an SDP has an fmtp or rtcp-fb with a payload type but doesn't
2387 // have a corresponding "rtpmap" line. 2387 // have a corresponding "rtpmap" line.
2388 cricket::Codec default_codec; 2388 return !codec.name.empty();
2389 return default_codec.name != codec.name;
2390 } 2389 }
2391 2390
2392 bool VerifyAudioCodecs(const AudioContentDescription* audio_desc) { 2391 bool VerifyAudioCodecs(const AudioContentDescription* audio_desc) {
2393 const std::vector<cricket::AudioCodec>& codecs = audio_desc->codecs(); 2392 const std::vector<cricket::AudioCodec>& codecs = audio_desc->codecs();
2394 for (std::vector<cricket::AudioCodec>::const_iterator iter = codecs.begin(); 2393 for (std::vector<cricket::AudioCodec>::const_iterator iter = codecs.begin();
2395 iter != codecs.end(); ++iter) { 2394 iter != codecs.end(); ++iter) {
2396 if (!VerifyCodec(*iter)) { 2395 if (!VerifyCodec(*iter)) {
2397 return false; 2396 return false;
2398 } 2397 }
2399 } 2398 }
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
3174 UpdateCodec<AudioContentDescription, cricket::AudioCodec>( 3173 UpdateCodec<AudioContentDescription, cricket::AudioCodec>(
3175 media_desc, payload_type, feedback_param); 3174 media_desc, payload_type, feedback_param);
3176 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { 3175 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) {
3177 UpdateCodec<VideoContentDescription, cricket::VideoCodec>( 3176 UpdateCodec<VideoContentDescription, cricket::VideoCodec>(
3178 media_desc, payload_type, feedback_param); 3177 media_desc, payload_type, feedback_param);
3179 } 3178 }
3180 return true; 3179 return true;
3181 } 3180 }
3182 3181
3183 } // namespace webrtc 3182 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/base/codec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698