blob: d870878a631c16e29eab52077c7d34726abdfba0 [file] [log] [blame]
pbos@webrtc.org7e686932014-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 {
solenberg5a37e3e2016-06-14 17:02:4116std::string NackConfig::ToString() const {
17 std::stringstream ss;
18 ss << "{rtp_history_ms: " << rtp_history_ms;
19 ss << '}';
20 return ss.str();
21}
22
pbos@webrtc.org7e686932014-05-15 09:35:0623std::string FecConfig::ToString() const {
24 std::stringstream ss;
25 ss << "{ulpfec_payload_type: " << ulpfec_payload_type;
26 ss << ", red_payload_type: " << red_payload_type;
Stefan Holmer75851e02016-02-03 12:29:5927 ss << ", red_rtx_payload_type: " << red_rtx_payload_type;
pbos@webrtc.org7e686932014-05-15 09:35:0628 ss << '}';
29 return ss.str();
30}
31
32std::string RtpExtension::ToString() const {
33 std::stringstream ss;
isheriffc4921f42016-05-26 18:24:5534 ss << "{uri: " << uri;
pbos@webrtc.org7e686932014-05-15 09:35:0635 ss << ", id: " << id;
36 ss << '}';
37 return ss.str();
38}
39
isheriffc4921f42016-05-26 18:24:5540const char* RtpExtension::kAudioLevelUri =
Fredrik Solenbergad867862015-04-29 13:24:0141 "urn:ietf:params:rtp-hdrext:ssrc-audio-level";
isheriffc4921f42016-05-26 18:24:5542const int RtpExtension::kAudioLevelDefaultId = 1;
Fredrik Solenbergad867862015-04-29 13:24:0143
isheriffc4921f42016-05-26 18:24:5544const char* RtpExtension::kTimestampOffsetUri =
45 "urn:ietf:params:rtp-hdrext:toffset";
46const int RtpExtension::kTimestampOffsetDefaultId = 2;
47
48const char* RtpExtension::kAbsSendTimeUri =
49 "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time";
50const int RtpExtension::kAbsSendTimeDefaultId = 3;
51
52const char* RtpExtension::kVideoRotationUri = "urn:3gpp:video-orientation";
53const int RtpExtension::kVideoRotationDefaultId = 4;
54
55const char* RtpExtension::kTransportSequenceNumberUri =
56 "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01";
57const int RtpExtension::kTransportSequenceNumberDefaultId = 5;
58
isheriff00cc0452016-06-08 07:24:2159// This extension allows applications to adaptively limit the playout delay
60// on frames as per the current needs. For example, a gaming application
61// has very different needs on end-to-end delay compared to a video-conference
62// application.
63const char* RtpExtension::kPlayoutDelayUri =
64 "http://www.webrtc.org/experiments/rtp-hdrext/playout-delay";
65const int RtpExtension::kPlayoutDelayDefaultId = 6;
66
isheriffc4921f42016-05-26 18:24:5567bool RtpExtension::IsSupportedForAudio(const std::string& uri) {
68 return uri == webrtc::RtpExtension::kAbsSendTimeUri ||
69 uri == webrtc::RtpExtension::kAudioLevelUri ||
70 uri == webrtc::RtpExtension::kTransportSequenceNumberUri;
Fredrik Solenbergad867862015-04-29 13:24:0171}
72
isheriffc4921f42016-05-26 18:24:5573bool RtpExtension::IsSupportedForVideo(const std::string& uri) {
74 return uri == webrtc::RtpExtension::kTimestampOffsetUri ||
75 uri == webrtc::RtpExtension::kAbsSendTimeUri ||
76 uri == webrtc::RtpExtension::kVideoRotationUri ||
isheriff00cc0452016-06-08 07:24:2177 uri == webrtc::RtpExtension::kTransportSequenceNumberUri ||
78 uri == webrtc::RtpExtension::kPlayoutDelayUri;
Fredrik Solenbergad867862015-04-29 13:24:0179}
80
kwiberg@webrtc.orgc4e2cd02015-02-26 13:59:2281VideoStream::VideoStream()
82 : width(0),
83 height(0),
84 max_framerate(-1),
85 min_bitrate_bps(-1),
86 target_bitrate_bps(-1),
87 max_bitrate_bps(-1),
88 max_qp(-1) {}
89
90VideoStream::~VideoStream() = default;
91
pbos@webrtc.org7e686932014-05-15 09:35:0692std::string VideoStream::ToString() const {
93 std::stringstream ss;
94 ss << "{width: " << width;
95 ss << ", height: " << height;
96 ss << ", max_framerate: " << max_framerate;
97 ss << ", min_bitrate_bps:" << min_bitrate_bps;
98 ss << ", target_bitrate_bps:" << target_bitrate_bps;
99 ss << ", max_bitrate_bps:" << max_bitrate_bps;
100 ss << ", max_qp: " << max_qp;
101
pbos@webrtc.org98dd0b82014-11-06 09:35:08102 ss << ", temporal_layer_thresholds_bps: [";
pbos@webrtc.orgddb84aa2014-10-31 13:08:10103 for (size_t i = 0; i < temporal_layer_thresholds_bps.size(); ++i) {
104 ss << temporal_layer_thresholds_bps[i];
105 if (i != temporal_layer_thresholds_bps.size() - 1)
pbos@webrtc.org98dd0b82014-11-06 09:35:08106 ss << ", ";
pbos@webrtc.org7e686932014-05-15 09:35:06107 }
pbos@webrtc.org98dd0b82014-11-06 09:35:08108 ss << ']';
pbos@webrtc.org7e686932014-05-15 09:35:06109
110 ss << '}';
111 return ss.str();
112}
pbos@webrtc.org23668752014-10-24 09:23:21113
kwiberg@webrtc.orgc4e2cd02015-02-26 13:59:22114VideoEncoderConfig::VideoEncoderConfig()
Erik Språngfc398fe2015-04-28 08:01:41115 : content_type(ContentType::kRealtimeVideo),
kwiberg@webrtc.orgc4e2cd02015-02-26 13:59:22116 encoder_specific_settings(NULL),
skvlad48be0542016-06-16 19:08:03117 min_transmit_bitrate_bps(0),
118 expect_encode_from_texture(false) {}
kwiberg@webrtc.orgc4e2cd02015-02-26 13:59:22119
120VideoEncoderConfig::~VideoEncoderConfig() = default;
121
pbos@webrtc.org23668752014-10-24 09:23:21122std::string VideoEncoderConfig::ToString() const {
123 std::stringstream ss;
124
pbos@webrtc.org98dd0b82014-11-06 09:35:08125 ss << "{streams: [";
pbos@webrtc.org23668752014-10-24 09:23:21126 for (size_t i = 0; i < streams.size(); ++i) {
127 ss << streams[i].ToString();
128 if (i != streams.size() - 1)
pbos@webrtc.org98dd0b82014-11-06 09:35:08129 ss << ", ";
pbos@webrtc.org23668752014-10-24 09:23:21130 }
pbos@webrtc.org98dd0b82014-11-06 09:35:08131 ss << ']';
pbos@webrtc.org23668752014-10-24 09:23:21132 ss << ", content_type: ";
133 switch (content_type) {
Erik Språngfc398fe2015-04-28 08:01:41134 case ContentType::kRealtimeVideo:
pbos@webrtc.org23668752014-10-24 09:23:21135 ss << "kRealtimeVideo";
136 break;
Erik Språngfc398fe2015-04-28 08:01:41137 case ContentType::kScreen:
pbos@webrtc.org23668752014-10-24 09:23:21138 ss << "kScreenshare";
139 break;
140 }
141 ss << ", encoder_specific_settings: ";
142 ss << (encoder_specific_settings != NULL ? "(ptr)" : "NULL");
143
144 ss << ", min_transmit_bitrate_bps: " << min_transmit_bitrate_bps;
145 ss << '}';
146 return ss.str();
147}
148
pbos@webrtc.org7e686932014-05-15 09:35:06149} // namespace webrtc