Chromium Code Reviews| 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 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1556 const std::string& parameter_value, | 1556 const std::string& parameter_value, |
| 1557 std::ostringstream* os) { | 1557 std::ostringstream* os) { |
| 1558 // fmtp parameters: |parameter_name|=|parameter_value| | 1558 // fmtp parameters: |parameter_name|=|parameter_value| |
| 1559 *os << parameter_name << kSdpDelimiterEqual << parameter_value; | 1559 *os << parameter_name << kSdpDelimiterEqual << parameter_value; |
| 1560 } | 1560 } |
| 1561 | 1561 |
| 1562 void WriteFmtpParameters(const cricket::CodecParameterMap& parameters, | 1562 void WriteFmtpParameters(const cricket::CodecParameterMap& parameters, |
| 1563 std::ostringstream* os) { | 1563 std::ostringstream* os) { |
| 1564 for (cricket::CodecParameterMap::const_iterator fmtp = parameters.begin(); | 1564 for (cricket::CodecParameterMap::const_iterator fmtp = parameters.begin(); |
| 1565 fmtp != parameters.end(); ++fmtp) { | 1565 fmtp != parameters.end(); ++fmtp) { |
| 1566 // Each new parameter, except the first one starts with ";" and " ". | 1566 // Parameters are a semicolon-separated list, no spaces. |
| 1567 if (fmtp != parameters.begin()) { | 1567 // The list is separated from the header by a space. |
| 1568 if (fmtp == parameters.begin()) { | |
| 1569 *os << kSdpDelimiterSpace; | |
| 1570 } else { | |
| 1568 *os << kSdpDelimiterSemicolon; | 1571 *os << kSdpDelimiterSemicolon; |
| 1569 } | 1572 } |
| 1570 *os << kSdpDelimiterSpace; | |
| 1571 WriteFmtpParameter(fmtp->first, fmtp->second, os); | 1573 WriteFmtpParameter(fmtp->first, fmtp->second, os); |
| 1572 } | 1574 } |
| 1573 } | 1575 } |
| 1574 | 1576 |
| 1575 bool IsFmtpParam(const std::string& name) { | 1577 bool IsFmtpParam(const std::string& name) { |
| 1576 const char* kFmtpParams[] = { | 1578 const char* kFmtpParams[] = { |
| 1577 kCodecParamMinPTime, kCodecParamSPropStereo, | 1579 // TODO(hta): Split FMTP parameters apart from parameters in general. |
| 1578 kCodecParamStereo, kCodecParamUseInbandFec, kCodecParamUseDtx, | 1580 // FMTP parameters are codec specific, not generic. |
| 1579 kCodecParamStartBitrate, kCodecParamMaxBitrate, kCodecParamMinBitrate, | 1581 kCodecParamMinPTime, |
| 1580 kCodecParamMaxQuantization, kCodecParamSctpProtocol, kCodecParamSctpStreams, | 1582 kCodecParamSPropStereo, |
| 1581 kCodecParamMaxAverageBitrate, kCodecParamMaxPlaybackRate, | 1583 kCodecParamStereo, |
| 1582 kCodecParamAssociatedPayloadType | 1584 kCodecParamUseInbandFec, |
| 1583 }; | 1585 kCodecParamUseDtx, |
| 1586 kCodecParamStartBitrate, | |
| 1587 kCodecParamMaxBitrate, | |
| 1588 kCodecParamMinBitrate, | |
| 1589 kCodecParamMaxQuantization, | |
| 1590 kCodecParamSctpProtocol, | |
| 1591 kCodecParamSctpStreams, | |
| 1592 kCodecParamMaxAverageBitrate, | |
| 1593 kCodecParamMaxPlaybackRate, | |
| 1594 kCodecParamAssociatedPayloadType, | |
| 1595 cricket::kH264FmtpPacketizationMode, | |
| 1596 cricket::kH264FmtpLevelAsymmetryAllowed, | |
| 1597 cricket::kH264FmtpProfileLevelId}; | |
| 1584 for (size_t i = 0; i < arraysize(kFmtpParams); ++i) { | 1598 for (size_t i = 0; i < arraysize(kFmtpParams); ++i) { |
| 1585 if (_stricmp(name.c_str(), kFmtpParams[i]) == 0) { | 1599 if (name.compare(kFmtpParams[i]) == 0) { |
|
tommi
2016/04/19 08:51:58
did we end up deciding on using compare() after al
| |
| 1586 return true; | 1600 return true; |
| 1587 } | 1601 } |
| 1588 } | 1602 } |
| 1589 return false; | 1603 return false; |
| 1590 } | 1604 } |
| 1591 | 1605 |
| 1592 // Retreives fmtp parameters from |params|, which may contain other parameters | 1606 // Retreives fmtp parameters from |params|, which may contain other parameters |
| 1593 // as well, and puts them in |fmtp_parameters|. | 1607 // as well, and puts them in |fmtp_parameters|. |
| 1594 void GetFmtpParams(const cricket::CodecParameterMap& params, | 1608 void GetFmtpParams(const cricket::CodecParameterMap& params, |
| 1595 cricket::CodecParameterMap* fmtp_parameters) { | 1609 cricket::CodecParameterMap* fmtp_parameters) { |
| (...skipping 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3156 UpdateCodec<AudioContentDescription, cricket::AudioCodec>( | 3170 UpdateCodec<AudioContentDescription, cricket::AudioCodec>( |
| 3157 media_desc, payload_type, feedback_param); | 3171 media_desc, payload_type, feedback_param); |
| 3158 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { | 3172 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { |
| 3159 UpdateCodec<VideoContentDescription, cricket::VideoCodec>( | 3173 UpdateCodec<VideoContentDescription, cricket::VideoCodec>( |
| 3160 media_desc, payload_type, feedback_param); | 3174 media_desc, payload_type, feedback_param); |
| 3161 } | 3175 } |
| 3162 return true; | 3176 return true; |
| 3163 } | 3177 } |
| 3164 | 3178 |
| 3165 } // namespace webrtc | 3179 } // namespace webrtc |
| OLD | NEW |