Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: webrtc/call/video_send_stream.cc

Issue 3000253002: Move video send/receive stream headers to webrtc/call. (Closed)
Patch Set: Headers moved to 'webrtc/call' instead of 'webrtc/api'. Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2017 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
11 #include "webrtc/call/video_send_stream.h"
12
13 namespace webrtc {
14
15 VideoSendStream::StreamStats::StreamStats() = default;
16 VideoSendStream::StreamStats::~StreamStats() = default;
17
18 std::string VideoSendStream::StreamStats::ToString() const {
19 std::stringstream ss;
20 ss << "width: " << width << ", ";
21 ss << "height: " << height << ", ";
22 ss << "key: " << frame_counts.key_frames << ", ";
23 ss << "delta: " << frame_counts.delta_frames << ", ";
24 ss << "total_bps: " << total_bitrate_bps << ", ";
25 ss << "retransmit_bps: " << retransmit_bitrate_bps << ", ";
26 ss << "avg_delay_ms: " << avg_delay_ms << ", ";
27 ss << "max_delay_ms: " << max_delay_ms << ", ";
28 ss << "cum_loss: " << rtcp_stats.packets_lost << ", ";
29 ss << "max_ext_seq: " << rtcp_stats.extended_highest_sequence_number << ", ";
30 ss << "nack: " << rtcp_packet_type_counts.nack_packets << ", ";
31 ss << "fir: " << rtcp_packet_type_counts.fir_packets << ", ";
32 ss << "pli: " << rtcp_packet_type_counts.pli_packets;
33 return ss.str();
34 }
35
36 VideoSendStream::Stats::Stats() = default;
37 VideoSendStream::Stats::~Stats() = default;
38
39 std::string VideoSendStream::Stats::ToString(int64_t time_ms) const {
40 std::stringstream ss;
41 ss << "VideoSendStream stats: " << time_ms << ", {";
42 ss << "input_fps: " << input_frame_rate << ", ";
43 ss << "encode_fps: " << encode_frame_rate << ", ";
44 ss << "encode_ms: " << avg_encode_time_ms << ", ";
45 ss << "encode_usage_perc: " << encode_usage_percent << ", ";
46 ss << "target_bps: " << target_media_bitrate_bps << ", ";
47 ss << "media_bps: " << media_bitrate_bps << ", ";
48 ss << "preferred_media_bitrate_bps: " << preferred_media_bitrate_bps << ", ";
49 ss << "suspended: " << (suspended ? "true" : "false") << ", ";
50 ss << "bw_adapted: " << (bw_limited_resolution ? "true" : "false");
51 ss << '}';
52 for (const auto& substream : substreams) {
53 if (!substream.second.is_rtx && !substream.second.is_flexfec) {
54 ss << " {ssrc: " << substream.first << ", ";
55 ss << substream.second.ToString();
56 ss << '}';
57 }
58 }
59 return ss.str();
60 }
61
62 VideoSendStream::Config::Config(const Config&) = default;
63 VideoSendStream::Config::Config(Config&&) = default;
64 VideoSendStream::Config::Config(Transport* send_transport)
65 : send_transport(send_transport) {}
66
67 VideoSendStream::Config& VideoSendStream::Config::operator=(Config&&) = default;
68 VideoSendStream::Config::Config::~Config() = default;
69
70 std::string VideoSendStream::Config::ToString() const {
71 std::stringstream ss;
72 ss << "{encoder_settings: " << encoder_settings.ToString();
73 ss << ", rtp: " << rtp.ToString();
74 ss << ", pre_encode_callback: "
75 << (pre_encode_callback ? "(VideoSinkInterface)" : "nullptr");
76 ss << ", post_encode_callback: "
77 << (post_encode_callback ? "(EncodedFrameObserver)" : "nullptr");
78 ss << ", render_delay_ms: " << render_delay_ms;
79 ss << ", target_delay_ms: " << target_delay_ms;
80 ss << ", suspend_below_min_bitrate: "
81 << (suspend_below_min_bitrate ? "on" : "off");
82 ss << '}';
83 return ss.str();
84 }
85
86 std::string VideoSendStream::Config::EncoderSettings::ToString() const {
87 std::stringstream ss;
88 ss << "{payload_name: " << payload_name;
89 ss << ", payload_type: " << payload_type;
90 ss << ", encoder: " << (encoder ? "(VideoEncoder)" : "nullptr");
91 ss << '}';
92 return ss.str();
93 }
94
95 VideoSendStream::Config::Rtp::Rtp() = default;
96 VideoSendStream::Config::Rtp::Rtp(const Rtp&) = default;
97 VideoSendStream::Config::Rtp::~Rtp() = default;
98
99 VideoSendStream::Config::Rtp::Flexfec::Flexfec() = default;
100 VideoSendStream::Config::Rtp::Flexfec::Flexfec(const Flexfec&) = default;
101 VideoSendStream::Config::Rtp::Flexfec::~Flexfec() = default;
102
103 std::string VideoSendStream::Config::Rtp::ToString() const {
104 std::stringstream ss;
105 ss << "{ssrcs: [";
106 for (size_t i = 0; i < ssrcs.size(); ++i) {
107 ss << ssrcs[i];
108 if (i != ssrcs.size() - 1)
109 ss << ", ";
110 }
111 ss << ']';
112 ss << ", rtcp_mode: "
113 << (rtcp_mode == RtcpMode::kCompound ? "RtcpMode::kCompound"
114 : "RtcpMode::kReducedSize");
115 ss << ", max_packet_size: " << max_packet_size;
116 ss << ", extensions: [";
117 for (size_t i = 0; i < extensions.size(); ++i) {
118 ss << extensions[i].ToString();
119 if (i != extensions.size() - 1)
120 ss << ", ";
121 }
122 ss << ']';
123
124 ss << ", nack: {rtp_history_ms: " << nack.rtp_history_ms << '}';
125 ss << ", ulpfec: " << ulpfec.ToString();
126
127 ss << ", flexfec: {payload_type: " << flexfec.payload_type;
128 ss << ", ssrc: " << flexfec.ssrc;
129 ss << ", protected_media_ssrcs: [";
130 for (size_t i = 0; i < flexfec.protected_media_ssrcs.size(); ++i) {
131 ss << flexfec.protected_media_ssrcs[i];
132 if (i != flexfec.protected_media_ssrcs.size() - 1)
133 ss << ", ";
134 }
135 ss << "]}";
136
137 ss << ", rtx: " << rtx.ToString();
138 ss << ", c_name: " << c_name;
139 ss << '}';
140 return ss.str();
141 }
142
143 VideoSendStream::Config::Rtp::Rtx::Rtx() = default;
144 VideoSendStream::Config::Rtp::Rtx::Rtx(const Rtx&) = default;
145 VideoSendStream::Config::Rtp::Rtx::~Rtx() = default;
146
147 std::string VideoSendStream::Config::Rtp::Rtx::ToString() const {
148 std::stringstream ss;
149 ss << "{ssrcs: [";
150 for (size_t i = 0; i < ssrcs.size(); ++i) {
151 ss << ssrcs[i];
152 if (i != ssrcs.size() - 1)
153 ss << ", ";
154 }
155 ss << ']';
156
157 ss << ", payload_type: " << payload_type;
158 ss << '}';
159 return ss.str();
160 }
161
162 } // namespace webrtc
OLDNEW
« webrtc/BUILD.gn ('K') | « webrtc/call/video_send_stream.h ('k') | webrtc/logging/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698