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 FlexfecConfig::FlexfecConfig() | |
35 : flexfec_payload_type(-1), flexfec_ssrc(0), protected_media_ssrcs() {} | |
36 | |
37 FlexfecConfig::~FlexfecConfig() = default; | |
38 | |
39 std::string FlexfecConfig::ToString() const { | 34 std::string FlexfecConfig::ToString() const { |
40 std::stringstream ss; | 35 std::stringstream ss; |
41 ss << "{flexfec_payload_type: " << flexfec_payload_type; | 36 ss << "{flexfec_payload_type: " << flexfec_payload_type; |
42 ss << ", flexfec_ssrc: " << flexfec_ssrc; | 37 ss << ", flexfec_ssrc: " << flexfec_ssrc; |
43 ss << ", protected_media_ssrcs: ["; | 38 ss << ", protected_media_ssrcs: ["; |
44 size_t i = 0; | 39 size_t i = 0; |
45 for (; i + 1 < protected_media_ssrcs.size(); ++i) | 40 for (; i + 1 < protected_media_ssrcs.size(); ++i) |
46 ss << protected_media_ssrcs[i] << ", "; | 41 ss << protected_media_ssrcs[i] << ", "; |
47 if (!protected_media_ssrcs.empty()) | 42 if (!protected_media_ssrcs.empty()) |
48 ss << protected_media_ssrcs[i]; | 43 ss << protected_media_ssrcs[i]; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 return ss.str(); | 127 return ss.str(); |
133 } | 128 } |
134 | 129 |
135 VideoEncoderConfig::VideoEncoderConfig() | 130 VideoEncoderConfig::VideoEncoderConfig() |
136 : content_type(ContentType::kRealtimeVideo), | 131 : content_type(ContentType::kRealtimeVideo), |
137 encoder_specific_settings(nullptr), | 132 encoder_specific_settings(nullptr), |
138 min_transmit_bitrate_bps(0), | 133 min_transmit_bitrate_bps(0), |
139 max_bitrate_bps(0), | 134 max_bitrate_bps(0), |
140 number_of_streams(0) {} | 135 number_of_streams(0) {} |
141 | 136 |
142 VideoEncoderConfig::VideoEncoderConfig(VideoEncoderConfig&&) = default; | |
143 | |
144 VideoEncoderConfig::~VideoEncoderConfig() = default; | 137 VideoEncoderConfig::~VideoEncoderConfig() = default; |
145 | 138 |
146 std::string VideoEncoderConfig::ToString() const { | 139 std::string VideoEncoderConfig::ToString() const { |
147 std::stringstream ss; | 140 std::stringstream ss; |
148 ss << "{content_type: "; | 141 ss << "{content_type: "; |
149 switch (content_type) { | 142 switch (content_type) { |
150 case ContentType::kRealtimeVideo: | 143 case ContentType::kRealtimeVideo: |
151 ss << "kRealtimeVideo"; | 144 ss << "kRealtimeVideo"; |
152 break; | 145 break; |
153 case ContentType::kScreen: | 146 case ContentType::kScreen: |
154 ss << "kScreenshare"; | 147 ss << "kScreenshare"; |
155 break; | 148 break; |
156 } | 149 } |
157 ss << ", encoder_specific_settings: "; | 150 ss << ", encoder_specific_settings: "; |
158 ss << (encoder_specific_settings != NULL ? "(ptr)" : "NULL"); | 151 ss << (encoder_specific_settings != NULL ? "(ptr)" : "NULL"); |
159 | 152 |
160 ss << ", min_transmit_bitrate_bps: " << min_transmit_bitrate_bps; | 153 ss << ", min_transmit_bitrate_bps: " << min_transmit_bitrate_bps; |
161 ss << '}'; | 154 ss << '}'; |
162 return ss.str(); | 155 return ss.str(); |
163 } | 156 } |
164 | 157 |
165 VideoEncoderConfig::VideoEncoderConfig(const VideoEncoderConfig&) = default; | |
166 | |
167 void VideoEncoderConfig::EncoderSpecificSettings::FillEncoderSpecificSettings( | 158 void VideoEncoderConfig::EncoderSpecificSettings::FillEncoderSpecificSettings( |
168 VideoCodec* codec) const { | 159 VideoCodec* codec) const { |
169 if (codec->codecType == kVideoCodecH264) { | 160 if (codec->codecType == kVideoCodecH264) { |
170 FillVideoCodecH264(&codec->codecSpecific.H264); | 161 FillVideoCodecH264(&codec->codecSpecific.H264); |
171 } else if (codec->codecType == kVideoCodecVP8) { | 162 } else if (codec->codecType == kVideoCodecVP8) { |
172 FillVideoCodecVp8(&codec->codecSpecific.VP8); | 163 FillVideoCodecVp8(&codec->codecSpecific.VP8); |
173 } else if (codec->codecType == kVideoCodecVP9) { | 164 } else if (codec->codecType == kVideoCodecVP9) { |
174 FillVideoCodecVp9(&codec->codecSpecific.VP9); | 165 FillVideoCodecVp9(&codec->codecSpecific.VP9); |
175 } else { | 166 } else { |
176 RTC_NOTREACHED() << "Encoder specifics set/used for unknown codec type."; | 167 RTC_NOTREACHED() << "Encoder specifics set/used for unknown codec type."; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 203 |
213 VideoEncoderConfig::Vp9EncoderSpecificSettings::Vp9EncoderSpecificSettings( | 204 VideoEncoderConfig::Vp9EncoderSpecificSettings::Vp9EncoderSpecificSettings( |
214 const VideoCodecVP9& specifics) | 205 const VideoCodecVP9& specifics) |
215 : specifics_(specifics) {} | 206 : specifics_(specifics) {} |
216 | 207 |
217 void VideoEncoderConfig::Vp9EncoderSpecificSettings::FillVideoCodecVp9( | 208 void VideoEncoderConfig::Vp9EncoderSpecificSettings::FillVideoCodecVp9( |
218 VideoCodecVP9* vp9_settings) const { | 209 VideoCodecVP9* vp9_settings) const { |
219 *vp9_settings = specifics_; | 210 *vp9_settings = specifics_; |
220 } | 211 } |
221 | 212 |
222 DecoderSpecificSettings::DecoderSpecificSettings() = default; | |
223 | |
224 DecoderSpecificSettings::~DecoderSpecificSettings() = default; | |
225 | |
226 } // namespace webrtc | 213 } // namespace webrtc |
OLD | NEW |