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 19 matching lines...) Expand all Loading... |
30 ss << '}'; | 30 ss << '}'; |
31 return ss.str(); | 31 return ss.str(); |
32 } | 32 } |
33 | 33 |
34 bool UlpfecConfig::operator==(const UlpfecConfig& other) const { | 34 bool UlpfecConfig::operator==(const UlpfecConfig& other) const { |
35 return ulpfec_payload_type == other.ulpfec_payload_type && | 35 return ulpfec_payload_type == other.ulpfec_payload_type && |
36 red_payload_type == other.red_payload_type && | 36 red_payload_type == other.red_payload_type && |
37 red_rtx_payload_type == other.red_rtx_payload_type; | 37 red_rtx_payload_type == other.red_rtx_payload_type; |
38 } | 38 } |
39 | 39 |
40 FlexfecConfig::FlexfecConfig() | |
41 : flexfec_payload_type(-1), flexfec_ssrc(0), protected_media_ssrcs() {} | |
42 | |
43 FlexfecConfig::~FlexfecConfig() = default; | |
44 | |
45 std::string FlexfecConfig::ToString() const { | |
46 std::stringstream ss; | |
47 ss << "{flexfec_payload_type: " << flexfec_payload_type; | |
48 ss << ", flexfec_ssrc: " << flexfec_ssrc; | |
49 ss << ", protected_media_ssrcs: ["; | |
50 size_t i = 0; | |
51 for (; i + 1 < protected_media_ssrcs.size(); ++i) | |
52 ss << protected_media_ssrcs[i] << ", "; | |
53 if (!protected_media_ssrcs.empty()) | |
54 ss << protected_media_ssrcs[i]; | |
55 ss << "]}"; | |
56 return ss.str(); | |
57 } | |
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 | |
78 std::string RtpExtension::ToString() const { | 40 std::string RtpExtension::ToString() const { |
79 std::stringstream ss; | 41 std::stringstream ss; |
80 ss << "{uri: " << uri; | 42 ss << "{uri: " << uri; |
81 ss << ", id: " << id; | 43 ss << ", id: " << id; |
82 ss << '}'; | 44 ss << '}'; |
83 return ss.str(); | 45 return ss.str(); |
84 } | 46 } |
85 | 47 |
86 const char* RtpExtension::kAudioLevelUri = | 48 const char* RtpExtension::kAudioLevelUri = |
87 "urn:ietf:params:rtp-hdrext:ssrc-audio-level"; | 49 "urn:ietf:params:rtp-hdrext:ssrc-audio-level"; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 VideoEncoderConfig::Vp9EncoderSpecificSettings::Vp9EncoderSpecificSettings( | 199 VideoEncoderConfig::Vp9EncoderSpecificSettings::Vp9EncoderSpecificSettings( |
238 const VideoCodecVP9& specifics) | 200 const VideoCodecVP9& specifics) |
239 : specifics_(specifics) {} | 201 : specifics_(specifics) {} |
240 | 202 |
241 void VideoEncoderConfig::Vp9EncoderSpecificSettings::FillVideoCodecVp9( | 203 void VideoEncoderConfig::Vp9EncoderSpecificSettings::FillVideoCodecVp9( |
242 VideoCodecVP9* vp9_settings) const { | 204 VideoCodecVP9* vp9_settings) const { |
243 *vp9_settings = specifics_; | 205 *vp9_settings = specifics_; |
244 } | 206 } |
245 | 207 |
246 } // namespace webrtc | 208 } // namespace webrtc |
OLD | NEW |