blob: 7b75a68de865148ed1444acb614b8702b45765b0 [file] [log] [blame]
pbos@webrtc.org1e92b0a2014-05-15 09:35:06 +00001/*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10#include "webrtc/config.h"
11
12#include <sstream>
13#include <string>
14
15namespace webrtc {
16std::string FecConfig::ToString() const {
17 std::stringstream ss;
18 ss << "{ulpfec_payload_type: " << ulpfec_payload_type;
19 ss << ", red_payload_type: " << red_payload_type;
20 ss << '}';
21 return ss.str();
22}
23
24std::string RtpExtension::ToString() const {
25 std::stringstream ss;
26 ss << "{name: " << name;
27 ss << ", id: " << id;
28 ss << '}';
29 return ss.str();
30}
31
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000032VideoStream::VideoStream()
33 : width(0),
34 height(0),
35 max_framerate(-1),
36 min_bitrate_bps(-1),
37 target_bitrate_bps(-1),
38 max_bitrate_bps(-1),
39 max_qp(-1) {}
40
41VideoStream::~VideoStream() = default;
42
pbos@webrtc.org1e92b0a2014-05-15 09:35:06 +000043std::string VideoStream::ToString() const {
44 std::stringstream ss;
45 ss << "{width: " << width;
46 ss << ", height: " << height;
47 ss << ", max_framerate: " << max_framerate;
48 ss << ", min_bitrate_bps:" << min_bitrate_bps;
49 ss << ", target_bitrate_bps:" << target_bitrate_bps;
50 ss << ", max_bitrate_bps:" << max_bitrate_bps;
51 ss << ", max_qp: " << max_qp;
52
pbos@webrtc.org931e3da2014-11-06 09:35:08 +000053 ss << ", temporal_layer_thresholds_bps: [";
pbos@webrtc.orgb7ed7792014-10-31 13:08:10 +000054 for (size_t i = 0; i < temporal_layer_thresholds_bps.size(); ++i) {
55 ss << temporal_layer_thresholds_bps[i];
56 if (i != temporal_layer_thresholds_bps.size() - 1)
pbos@webrtc.org931e3da2014-11-06 09:35:08 +000057 ss << ", ";
pbos@webrtc.org1e92b0a2014-05-15 09:35:06 +000058 }
pbos@webrtc.org931e3da2014-11-06 09:35:08 +000059 ss << ']';
pbos@webrtc.org1e92b0a2014-05-15 09:35:06 +000060
61 ss << '}';
62 return ss.str();
63}
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +000064
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000065VideoEncoderConfig::VideoEncoderConfig()
66 : content_type(kRealtimeVideo),
67 encoder_specific_settings(NULL),
68 min_transmit_bitrate_bps(0) {}
69
70VideoEncoderConfig::~VideoEncoderConfig() = default;
71
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +000072std::string VideoEncoderConfig::ToString() const {
73 std::stringstream ss;
74
pbos@webrtc.org931e3da2014-11-06 09:35:08 +000075 ss << "{streams: [";
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +000076 for (size_t i = 0; i < streams.size(); ++i) {
77 ss << streams[i].ToString();
78 if (i != streams.size() - 1)
pbos@webrtc.org931e3da2014-11-06 09:35:08 +000079 ss << ", ";
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +000080 }
pbos@webrtc.org931e3da2014-11-06 09:35:08 +000081 ss << ']';
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +000082 ss << ", content_type: ";
83 switch (content_type) {
84 case kRealtimeVideo:
85 ss << "kRealtimeVideo";
86 break;
87 case kScreenshare:
88 ss << "kScreenshare";
89 break;
90 }
91 ss << ", encoder_specific_settings: ";
92 ss << (encoder_specific_settings != NULL ? "(ptr)" : "NULL");
93
94 ss << ", min_transmit_bitrate_bps: " << min_transmit_bitrate_bps;
95 ss << '}';
96 return ss.str();
97}
98
pbos@webrtc.org1e92b0a2014-05-15 09:35:06 +000099} // namespace webrtc