blob: e9c56da32a24c97962a4cbce455884a21457d0aa [file] [log] [blame]
pbos@webrtc.org1e92b0a2014-05-15 09:35:061/*
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;
Stefan Holmer10880012016-02-03 12:29:5920 ss << ", red_rtx_payload_type: " << red_rtx_payload_type;
pbos@webrtc.org1e92b0a2014-05-15 09:35:0621 ss << '}';
22 return ss.str();
23}
24
25std::string RtpExtension::ToString() const {
26 std::stringstream ss;
isheriff6f8d6862016-05-26 18:24:5527 ss << "{uri: " << uri;
pbos@webrtc.org1e92b0a2014-05-15 09:35:0628 ss << ", id: " << id;
29 ss << '}';
30 return ss.str();
31}
32
isheriff6f8d6862016-05-26 18:24:5533const char* RtpExtension::kAudioLevelUri =
Fredrik Solenberg23fba1f2015-04-29 13:24:0134 "urn:ietf:params:rtp-hdrext:ssrc-audio-level";
isheriff6f8d6862016-05-26 18:24:5535const int RtpExtension::kAudioLevelDefaultId = 1;
Fredrik Solenberg23fba1f2015-04-29 13:24:0136
isheriff6f8d6862016-05-26 18:24:5537const char* RtpExtension::kTimestampOffsetUri =
38 "urn:ietf:params:rtp-hdrext:toffset";
39const int RtpExtension::kTimestampOffsetDefaultId = 2;
40
41const char* RtpExtension::kAbsSendTimeUri =
42 "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time";
43const int RtpExtension::kAbsSendTimeDefaultId = 3;
44
45const char* RtpExtension::kVideoRotationUri = "urn:3gpp:video-orientation";
46const int RtpExtension::kVideoRotationDefaultId = 4;
47
48const char* RtpExtension::kTransportSequenceNumberUri =
49 "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01";
50const int RtpExtension::kTransportSequenceNumberDefaultId = 5;
51
52bool RtpExtension::IsSupportedForAudio(const std::string& uri) {
53 return uri == webrtc::RtpExtension::kAbsSendTimeUri ||
54 uri == webrtc::RtpExtension::kAudioLevelUri ||
55 uri == webrtc::RtpExtension::kTransportSequenceNumberUri;
Fredrik Solenberg23fba1f2015-04-29 13:24:0156}
57
isheriff6f8d6862016-05-26 18:24:5558bool RtpExtension::IsSupportedForVideo(const std::string& uri) {
59 return uri == webrtc::RtpExtension::kTimestampOffsetUri ||
60 uri == webrtc::RtpExtension::kAbsSendTimeUri ||
61 uri == webrtc::RtpExtension::kVideoRotationUri ||
62 uri == webrtc::RtpExtension::kTransportSequenceNumberUri;
Fredrik Solenberg23fba1f2015-04-29 13:24:0163}
64
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:2265VideoStream::VideoStream()
66 : width(0),
67 height(0),
68 max_framerate(-1),
69 min_bitrate_bps(-1),
70 target_bitrate_bps(-1),
71 max_bitrate_bps(-1),
72 max_qp(-1) {}
73
74VideoStream::~VideoStream() = default;
75
pbos@webrtc.org1e92b0a2014-05-15 09:35:0676std::string VideoStream::ToString() const {
77 std::stringstream ss;
78 ss << "{width: " << width;
79 ss << ", height: " << height;
80 ss << ", max_framerate: " << max_framerate;
81 ss << ", min_bitrate_bps:" << min_bitrate_bps;
82 ss << ", target_bitrate_bps:" << target_bitrate_bps;
83 ss << ", max_bitrate_bps:" << max_bitrate_bps;
84 ss << ", max_qp: " << max_qp;
85
pbos@webrtc.org931e3da2014-11-06 09:35:0886 ss << ", temporal_layer_thresholds_bps: [";
pbos@webrtc.orgb7ed7792014-10-31 13:08:1087 for (size_t i = 0; i < temporal_layer_thresholds_bps.size(); ++i) {
88 ss << temporal_layer_thresholds_bps[i];
89 if (i != temporal_layer_thresholds_bps.size() - 1)
pbos@webrtc.org931e3da2014-11-06 09:35:0890 ss << ", ";
pbos@webrtc.org1e92b0a2014-05-15 09:35:0691 }
pbos@webrtc.org931e3da2014-11-06 09:35:0892 ss << ']';
pbos@webrtc.org1e92b0a2014-05-15 09:35:0693
94 ss << '}';
95 return ss.str();
96}
pbos@webrtc.orgad3b5a52014-10-24 09:23:2197
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:2298VideoEncoderConfig::VideoEncoderConfig()
Erik Språng143cec12015-04-28 08:01:4199 : content_type(ContentType::kRealtimeVideo),
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22100 encoder_specific_settings(NULL),
Erik Språng143cec12015-04-28 08:01:41101 min_transmit_bitrate_bps(0) {
102}
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22103
104VideoEncoderConfig::~VideoEncoderConfig() = default;
105
pbos@webrtc.orgad3b5a52014-10-24 09:23:21106std::string VideoEncoderConfig::ToString() const {
107 std::stringstream ss;
108
pbos@webrtc.org931e3da2014-11-06 09:35:08109 ss << "{streams: [";
pbos@webrtc.orgad3b5a52014-10-24 09:23:21110 for (size_t i = 0; i < streams.size(); ++i) {
111 ss << streams[i].ToString();
112 if (i != streams.size() - 1)
pbos@webrtc.org931e3da2014-11-06 09:35:08113 ss << ", ";
pbos@webrtc.orgad3b5a52014-10-24 09:23:21114 }
pbos@webrtc.org931e3da2014-11-06 09:35:08115 ss << ']';
pbos@webrtc.orgad3b5a52014-10-24 09:23:21116 ss << ", content_type: ";
117 switch (content_type) {
Erik Språng143cec12015-04-28 08:01:41118 case ContentType::kRealtimeVideo:
pbos@webrtc.orgad3b5a52014-10-24 09:23:21119 ss << "kRealtimeVideo";
120 break;
Erik Språng143cec12015-04-28 08:01:41121 case ContentType::kScreen:
pbos@webrtc.orgad3b5a52014-10-24 09:23:21122 ss << "kScreenshare";
123 break;
124 }
125 ss << ", encoder_specific_settings: ";
126 ss << (encoder_specific_settings != NULL ? "(ptr)" : "NULL");
127
128 ss << ", min_transmit_bitrate_bps: " << min_transmit_bitrate_bps;
129 ss << '}';
130 return ss.str();
131}
132
pbos@webrtc.org1e92b0a2014-05-15 09:35:06133} // namespace webrtc