blob: 7dfecd15073be104a21b253bf1e3a3ee361dea81 [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()
Erik Språng143cec12015-04-28 10:01:41 +020066 : content_type(ContentType::kRealtimeVideo),
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000067 encoder_specific_settings(NULL),
Erik Språng143cec12015-04-28 10:01:41 +020068 min_transmit_bitrate_bps(0) {
69}
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000070
71VideoEncoderConfig::~VideoEncoderConfig() = default;
72
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +000073std::string VideoEncoderConfig::ToString() const {
74 std::stringstream ss;
75
pbos@webrtc.org931e3da2014-11-06 09:35:08 +000076 ss << "{streams: [";
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +000077 for (size_t i = 0; i < streams.size(); ++i) {
78 ss << streams[i].ToString();
79 if (i != streams.size() - 1)
pbos@webrtc.org931e3da2014-11-06 09:35:08 +000080 ss << ", ";
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +000081 }
pbos@webrtc.org931e3da2014-11-06 09:35:08 +000082 ss << ']';
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +000083 ss << ", content_type: ";
84 switch (content_type) {
Erik Språng143cec12015-04-28 10:01:41 +020085 case ContentType::kRealtimeVideo:
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +000086 ss << "kRealtimeVideo";
87 break;
Erik Språng143cec12015-04-28 10:01:41 +020088 case ContentType::kScreen:
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +000089 ss << "kScreenshare";
90 break;
91 }
92 ss << ", encoder_specific_settings: ";
93 ss << (encoder_specific_settings != NULL ? "(ptr)" : "NULL");
94
95 ss << ", min_transmit_bitrate_bps: " << min_transmit_bitrate_bps;
96 ss << '}';
97 return ss.str();
98}
99
pbos@webrtc.org1e92b0a2014-05-15 09:35:06 +0000100} // namespace webrtc