blob: c5d29d480397eda61fe24e6968e7b1ed9a8ac1b7 [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
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020032const char* RtpExtension::kTOffset = "urn:ietf:params:rtp-hdrext:toffset";
33const char* RtpExtension::kAbsSendTime =
34 "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time";
35const char* RtpExtension::kVideoRotation = "urn:3gpp:video-orientation";
36const char* RtpExtension::kAudioLevel =
37 "urn:ietf:params:rtp-hdrext:ssrc-audio-level";
38
39bool RtpExtension::IsSupportedForAudio(const std::string& name) {
40 return name == webrtc::RtpExtension::kAbsSendTime ||
41 name == webrtc::RtpExtension::kAudioLevel;
42}
43
44bool RtpExtension::IsSupportedForVideo(const std::string& name) {
45 return name == webrtc::RtpExtension::kTOffset ||
46 name == webrtc::RtpExtension::kAbsSendTime ||
47 name == webrtc::RtpExtension::kVideoRotation;
48}
49
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000050VideoStream::VideoStream()
51 : width(0),
52 height(0),
53 max_framerate(-1),
54 min_bitrate_bps(-1),
55 target_bitrate_bps(-1),
56 max_bitrate_bps(-1),
57 max_qp(-1) {}
58
59VideoStream::~VideoStream() = default;
60
pbos@webrtc.org1e92b0a2014-05-15 09:35:06 +000061std::string VideoStream::ToString() const {
62 std::stringstream ss;
63 ss << "{width: " << width;
64 ss << ", height: " << height;
65 ss << ", max_framerate: " << max_framerate;
66 ss << ", min_bitrate_bps:" << min_bitrate_bps;
67 ss << ", target_bitrate_bps:" << target_bitrate_bps;
68 ss << ", max_bitrate_bps:" << max_bitrate_bps;
69 ss << ", max_qp: " << max_qp;
70
pbos@webrtc.org931e3da2014-11-06 09:35:08 +000071 ss << ", temporal_layer_thresholds_bps: [";
pbos@webrtc.orgb7ed7792014-10-31 13:08:10 +000072 for (size_t i = 0; i < temporal_layer_thresholds_bps.size(); ++i) {
73 ss << temporal_layer_thresholds_bps[i];
74 if (i != temporal_layer_thresholds_bps.size() - 1)
pbos@webrtc.org931e3da2014-11-06 09:35:08 +000075 ss << ", ";
pbos@webrtc.org1e92b0a2014-05-15 09:35:06 +000076 }
pbos@webrtc.org931e3da2014-11-06 09:35:08 +000077 ss << ']';
pbos@webrtc.org1e92b0a2014-05-15 09:35:06 +000078
79 ss << '}';
80 return ss.str();
81}
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +000082
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000083VideoEncoderConfig::VideoEncoderConfig()
Erik Språng143cec12015-04-28 10:01:41 +020084 : content_type(ContentType::kRealtimeVideo),
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000085 encoder_specific_settings(NULL),
Erik Språng143cec12015-04-28 10:01:41 +020086 min_transmit_bitrate_bps(0) {
87}
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000088
89VideoEncoderConfig::~VideoEncoderConfig() = default;
90
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +000091std::string VideoEncoderConfig::ToString() const {
92 std::stringstream ss;
93
pbos@webrtc.org931e3da2014-11-06 09:35:08 +000094 ss << "{streams: [";
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +000095 for (size_t i = 0; i < streams.size(); ++i) {
96 ss << streams[i].ToString();
97 if (i != streams.size() - 1)
pbos@webrtc.org931e3da2014-11-06 09:35:08 +000098 ss << ", ";
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +000099 }
pbos@webrtc.org931e3da2014-11-06 09:35:08 +0000100 ss << ']';
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +0000101 ss << ", content_type: ";
102 switch (content_type) {
Erik Språng143cec12015-04-28 10:01:41 +0200103 case ContentType::kRealtimeVideo:
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +0000104 ss << "kRealtimeVideo";
105 break;
Erik Språng143cec12015-04-28 10:01:41 +0200106 case ContentType::kScreen:
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +0000107 ss << "kScreenshare";
108 break;
109 }
110 ss << ", encoder_specific_settings: ";
111 ss << (encoder_specific_settings != NULL ? "(ptr)" : "NULL");
112
113 ss << ", min_transmit_bitrate_bps: " << min_transmit_bitrate_bps;
114 ss << '}';
115 return ss.str();
116}
117
pbos@webrtc.org1e92b0a2014-05-15 09:35:06 +0000118} // namespace webrtc