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

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

Issue 2661453003: Simplify IsFmtpParam according to RFC 4855. (Closed)
Patch Set: Removed case-insensitive comparison. Added tests. Created 3 years, 10 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 | webrtc/pc/webrtcsdp_unittest.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 * 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 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 if (fmtp == parameters.begin()) { 1590 if (fmtp == parameters.begin()) {
1591 *os << kSdpDelimiterSpace; 1591 *os << kSdpDelimiterSpace;
1592 } else { 1592 } else {
1593 *os << kSdpDelimiterSemicolon; 1593 *os << kSdpDelimiterSemicolon;
1594 } 1594 }
1595 WriteFmtpParameter(fmtp->first, fmtp->second, os); 1595 WriteFmtpParameter(fmtp->first, fmtp->second, os);
1596 } 1596 }
1597 } 1597 }
1598 1598
1599 bool IsFmtpParam(const std::string& name) { 1599 bool IsFmtpParam(const std::string& name) {
1600 const char* kFmtpParams[] = { 1600 // RFC 4855, section 3 specifies the mapping of media format parameters to SDP
1601 // TODO(hta): Split FMTP parameters apart from parameters in general. 1601 // parameters. Only ptime, maxptime, channels and rate are placed outside of
1602 // FMTP parameters are codec specific, not generic. 1602 // the fmtp line. In WebRTC, channels and rate are already handled separately
1603 kCodecParamMinPTime, 1603 // and thus not included in the CodecParameterMap.
1604 kCodecParamSPropStereo, 1604 return name != kCodecParamPTime && name != kCodecParamMaxPTime;
1605 kCodecParamStereo,
1606 kCodecParamUseInbandFec,
1607 kCodecParamUseDtx,
1608 kCodecParamStartBitrate,
1609 kCodecParamMaxBitrate,
1610 kCodecParamMinBitrate,
1611 kCodecParamMaxQuantization,
1612 kCodecParamSctpProtocol,
1613 kCodecParamSctpStreams,
1614 kCodecParamMaxAverageBitrate,
1615 kCodecParamMaxPlaybackRate,
1616 kCodecParamAssociatedPayloadType,
1617 cricket::kH264FmtpPacketizationMode,
1618 cricket::kH264FmtpLevelAsymmetryAllowed,
1619 cricket::kH264FmtpProfileLevelId,
1620 cricket::kFlexfecFmtpRepairWindow};
1621 for (size_t i = 0; i < arraysize(kFmtpParams); ++i) {
1622 if (name.compare(kFmtpParams[i]) == 0) {
1623 return true;
1624 }
1625 }
1626 return false;
1627 } 1605 }
1628 1606
1629 // Retreives fmtp parameters from |params|, which may contain other parameters 1607 // Retreives fmtp parameters from |params|, which may contain other parameters
1630 // as well, and puts them in |fmtp_parameters|. 1608 // as well, and puts them in |fmtp_parameters|.
1631 void GetFmtpParams(const cricket::CodecParameterMap& params, 1609 void GetFmtpParams(const cricket::CodecParameterMap& params,
1632 cricket::CodecParameterMap* fmtp_parameters) { 1610 cricket::CodecParameterMap* fmtp_parameters) {
1633 for (cricket::CodecParameterMap::const_iterator iter = params.begin(); 1611 for (cricket::CodecParameterMap::const_iterator iter = params.begin();
1634 iter != params.end(); ++iter) { 1612 iter != params.end(); ++iter) {
1635 if (IsFmtpParam(iter->first)) { 1613 if (IsFmtpParam(iter->first)) {
1636 (*fmtp_parameters)[iter->first] = iter->second; 1614 (*fmtp_parameters)[iter->first] = iter->second;
(...skipping 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after
3213 UpdateCodec<AudioContentDescription, cricket::AudioCodec>( 3191 UpdateCodec<AudioContentDescription, cricket::AudioCodec>(
3214 media_desc, payload_type, feedback_param); 3192 media_desc, payload_type, feedback_param);
3215 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { 3193 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) {
3216 UpdateCodec<VideoContentDescription, cricket::VideoCodec>( 3194 UpdateCodec<VideoContentDescription, cricket::VideoCodec>(
3217 media_desc, payload_type, feedback_param); 3195 media_desc, payload_type, feedback_param);
3218 } 3196 }
3219 return true; 3197 return true;
3220 } 3198 }
3221 3199
3222 } // namespace webrtc 3200 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/pc/webrtcsdp_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698