OLD | NEW |
---|---|
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 Loading... | |
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 formats 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 stricmp(name.c_str(), kCodecParamPTime) != 0 && |
1605 kCodecParamStereo, | 1605 stricmp(name.c_str(), kCodecParamMaxPTime) != 0; |
hta-webrtc
2017/01/27 13:59:30
There's a functional change here. You're switching
ossu
2017/01/27 15:13:25
Yes, the parameter names are case insensitive and
| |
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; | |
ossu
2017/01/27 13:00:42
I added a debug printout here and ran through our
| |
1627 } | 1606 } |
1628 | 1607 |
1629 // Retreives fmtp parameters from |params|, which may contain other parameters | 1608 // Retreives fmtp parameters from |params|, which may contain other parameters |
1630 // as well, and puts them in |fmtp_parameters|. | 1609 // as well, and puts them in |fmtp_parameters|. |
1631 void GetFmtpParams(const cricket::CodecParameterMap& params, | 1610 void GetFmtpParams(const cricket::CodecParameterMap& params, |
1632 cricket::CodecParameterMap* fmtp_parameters) { | 1611 cricket::CodecParameterMap* fmtp_parameters) { |
1633 for (cricket::CodecParameterMap::const_iterator iter = params.begin(); | 1612 for (cricket::CodecParameterMap::const_iterator iter = params.begin(); |
1634 iter != params.end(); ++iter) { | 1613 iter != params.end(); ++iter) { |
1635 if (IsFmtpParam(iter->first)) { | 1614 if (IsFmtpParam(iter->first)) { |
1636 (*fmtp_parameters)[iter->first] = iter->second; | 1615 (*fmtp_parameters)[iter->first] = iter->second; |
(...skipping 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3213 UpdateCodec<AudioContentDescription, cricket::AudioCodec>( | 3192 UpdateCodec<AudioContentDescription, cricket::AudioCodec>( |
3214 media_desc, payload_type, feedback_param); | 3193 media_desc, payload_type, feedback_param); |
3215 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { | 3194 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { |
3216 UpdateCodec<VideoContentDescription, cricket::VideoCodec>( | 3195 UpdateCodec<VideoContentDescription, cricket::VideoCodec>( |
3217 media_desc, payload_type, feedback_param); | 3196 media_desc, payload_type, feedback_param); |
3218 } | 3197 } |
3219 return true; | 3198 return true; |
3220 } | 3199 } |
3221 | 3200 |
3222 } // namespace webrtc | 3201 } // namespace webrtc |
OLD | NEW |