| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 #include "webrtc/config.h" | 10 #include "webrtc/config.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 std::string UlpfecConfig::ToString() const { | 25 std::string UlpfecConfig::ToString() const { |
| 26 std::stringstream ss; | 26 std::stringstream ss; |
| 27 ss << "{ulpfec_payload_type: " << ulpfec_payload_type; | 27 ss << "{ulpfec_payload_type: " << ulpfec_payload_type; |
| 28 ss << ", red_payload_type: " << red_payload_type; | 28 ss << ", red_payload_type: " << red_payload_type; |
| 29 ss << ", red_rtx_payload_type: " << red_rtx_payload_type; | 29 ss << ", red_rtx_payload_type: " << red_rtx_payload_type; |
| 30 ss << '}'; | 30 ss << '}'; |
| 31 return ss.str(); | 31 return ss.str(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 bool UlpfecConfig::operator==(const UlpfecConfig& other) const { |
| 35 return ulpfec_payload_type == other.ulpfec_payload_type && |
| 36 red_payload_type == other.red_payload_type && |
| 37 red_rtx_payload_type == other.red_rtx_payload_type; |
| 38 } |
| 39 |
| 34 FlexfecConfig::FlexfecConfig() | 40 FlexfecConfig::FlexfecConfig() |
| 35 : flexfec_payload_type(-1), flexfec_ssrc(0), protected_media_ssrcs() {} | 41 : flexfec_payload_type(-1), flexfec_ssrc(0), protected_media_ssrcs() {} |
| 36 | 42 |
| 37 FlexfecConfig::~FlexfecConfig() = default; | 43 FlexfecConfig::~FlexfecConfig() = default; |
| 38 | 44 |
| 39 std::string FlexfecConfig::ToString() const { | 45 std::string FlexfecConfig::ToString() const { |
| 40 std::stringstream ss; | 46 std::stringstream ss; |
| 41 ss << "{flexfec_payload_type: " << flexfec_payload_type; | 47 ss << "{flexfec_payload_type: " << flexfec_payload_type; |
| 42 ss << ", flexfec_ssrc: " << flexfec_ssrc; | 48 ss << ", flexfec_ssrc: " << flexfec_ssrc; |
| 43 ss << ", protected_media_ssrcs: ["; | 49 ss << ", protected_media_ssrcs: ["; |
| 44 size_t i = 0; | 50 size_t i = 0; |
| 45 for (; i + 1 < protected_media_ssrcs.size(); ++i) | 51 for (; i + 1 < protected_media_ssrcs.size(); ++i) |
| 46 ss << protected_media_ssrcs[i] << ", "; | 52 ss << protected_media_ssrcs[i] << ", "; |
| 47 if (!protected_media_ssrcs.empty()) | 53 if (!protected_media_ssrcs.empty()) |
| 48 ss << protected_media_ssrcs[i]; | 54 ss << protected_media_ssrcs[i]; |
| 49 ss << "]}"; | 55 ss << "]}"; |
| 50 return ss.str(); | 56 return ss.str(); |
| 51 } | 57 } |
| 52 | 58 |
| 59 bool FlexfecConfig::IsCompleteAndEnabled() const { |
| 60 // Check if FlexFEC is enabled. |
| 61 if (flexfec_payload_type < 0) |
| 62 return false; |
| 63 // Do we have the necessary SSRC information? |
| 64 if (flexfec_ssrc == 0) |
| 65 return false; |
| 66 // TODO(brandtr): Update this check when we support multistream protection. |
| 67 if (protected_media_ssrcs.size() != 1u) |
| 68 return false; |
| 69 return true; |
| 70 } |
| 71 |
| 72 bool FlexfecConfig::operator==(const FlexfecConfig& other) const { |
| 73 return flexfec_payload_type == other.flexfec_payload_type && |
| 74 flexfec_ssrc == other.flexfec_ssrc && |
| 75 protected_media_ssrcs == other.protected_media_ssrcs; |
| 76 } |
| 77 |
| 53 std::string RtpExtension::ToString() const { | 78 std::string RtpExtension::ToString() const { |
| 54 std::stringstream ss; | 79 std::stringstream ss; |
| 55 ss << "{uri: " << uri; | 80 ss << "{uri: " << uri; |
| 56 ss << ", id: " << id; | 81 ss << ", id: " << id; |
| 57 ss << '}'; | 82 ss << '}'; |
| 58 return ss.str(); | 83 return ss.str(); |
| 59 } | 84 } |
| 60 | 85 |
| 61 const char* RtpExtension::kAudioLevelUri = | 86 const char* RtpExtension::kAudioLevelUri = |
| 62 "urn:ietf:params:rtp-hdrext:ssrc-audio-level"; | 87 "urn:ietf:params:rtp-hdrext:ssrc-audio-level"; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 void VideoEncoderConfig::Vp9EncoderSpecificSettings::FillVideoCodecVp9( | 241 void VideoEncoderConfig::Vp9EncoderSpecificSettings::FillVideoCodecVp9( |
| 217 VideoCodecVP9* vp9_settings) const { | 242 VideoCodecVP9* vp9_settings) const { |
| 218 *vp9_settings = specifics_; | 243 *vp9_settings = specifics_; |
| 219 } | 244 } |
| 220 | 245 |
| 221 DecoderSpecificSettings::DecoderSpecificSettings() = default; | 246 DecoderSpecificSettings::DecoderSpecificSettings() = default; |
| 222 | 247 |
| 223 DecoderSpecificSettings::~DecoderSpecificSettings() = default; | 248 DecoderSpecificSettings::~DecoderSpecificSettings() = default; |
| 224 | 249 |
| 225 } // namespace webrtc | 250 } // namespace webrtc |
| OLD | NEW |