OLD | NEW |
(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_receive_stream.h" |
| 12 |
| 13 namespace webrtc { |
| 14 |
| 15 VideoReceiveStream::Decoder::Decoder() = default; |
| 16 VideoReceiveStream::Decoder::Decoder(const Decoder&) = default; |
| 17 VideoReceiveStream::Decoder::~Decoder() = default; |
| 18 |
| 19 std::string VideoReceiveStream::Decoder::ToString() const { |
| 20 std::stringstream ss; |
| 21 ss << "{decoder: " << (decoder ? "(VideoDecoder)" : "nullptr"); |
| 22 ss << ", payload_type: " << payload_type; |
| 23 ss << ", payload_name: " << payload_name; |
| 24 ss << ", codec_params: {"; |
| 25 for (const auto& it : codec_params) |
| 26 ss << it.first << ": " << it.second; |
| 27 ss << '}'; |
| 28 ss << '}'; |
| 29 |
| 30 return ss.str(); |
| 31 } |
| 32 |
| 33 VideoReceiveStream::Stats::Stats() = default; |
| 34 VideoReceiveStream::Stats::~Stats() = default; |
| 35 |
| 36 std::string VideoReceiveStream::Stats::ToString(int64_t time_ms) const { |
| 37 std::stringstream ss; |
| 38 ss << "VideoReceiveStream stats: " << time_ms << ", {ssrc: " << ssrc << ", "; |
| 39 ss << "total_bps: " << total_bitrate_bps << ", "; |
| 40 ss << "width: " << width << ", "; |
| 41 ss << "height: " << height << ", "; |
| 42 ss << "key: " << frame_counts.key_frames << ", "; |
| 43 ss << "delta: " << frame_counts.delta_frames << ", "; |
| 44 ss << "network_fps: " << network_frame_rate << ", "; |
| 45 ss << "decode_fps: " << decode_frame_rate << ", "; |
| 46 ss << "render_fps: " << render_frame_rate << ", "; |
| 47 ss << "decode_ms: " << decode_ms << ", "; |
| 48 ss << "max_decode_ms: " << max_decode_ms << ", "; |
| 49 ss << "cur_delay_ms: " << current_delay_ms << ", "; |
| 50 ss << "targ_delay_ms: " << target_delay_ms << ", "; |
| 51 ss << "jb_delay_ms: " << jitter_buffer_ms << ", "; |
| 52 ss << "min_playout_delay_ms: " << min_playout_delay_ms << ", "; |
| 53 ss << "discarded: " << discarded_packets << ", "; |
| 54 ss << "sync_offset_ms: " << sync_offset_ms << ", "; |
| 55 ss << "cum_loss: " << rtcp_stats.packets_lost << ", "; |
| 56 ss << "max_ext_seq: " << rtcp_stats.extended_highest_sequence_number << ", "; |
| 57 ss << "nack: " << rtcp_packet_type_counts.nack_packets << ", "; |
| 58 ss << "fir: " << rtcp_packet_type_counts.fir_packets << ", "; |
| 59 ss << "pli: " << rtcp_packet_type_counts.pli_packets; |
| 60 ss << '}'; |
| 61 return ss.str(); |
| 62 } |
| 63 |
| 64 VideoReceiveStream::Config::Config(const Config&) = default; |
| 65 VideoReceiveStream::Config::Config(Config&&) = default; |
| 66 VideoReceiveStream::Config::Config(Transport* rtcp_send_transport) |
| 67 : rtcp_send_transport(rtcp_send_transport) {} |
| 68 |
| 69 VideoReceiveStream::Config& VideoReceiveStream::Config::operator=(Config&&) = |
| 70 default; |
| 71 VideoReceiveStream::Config::Config::~Config() = default; |
| 72 |
| 73 std::string VideoReceiveStream::Config::ToString() const { |
| 74 std::stringstream ss; |
| 75 ss << "{decoders: ["; |
| 76 for (size_t i = 0; i < decoders.size(); ++i) { |
| 77 ss << decoders[i].ToString(); |
| 78 if (i != decoders.size() - 1) |
| 79 ss << ", "; |
| 80 } |
| 81 ss << ']'; |
| 82 ss << ", rtp: " << rtp.ToString(); |
| 83 ss << ", renderer: " << (renderer ? "(renderer)" : "nullptr"); |
| 84 ss << ", render_delay_ms: " << render_delay_ms; |
| 85 if (!sync_group.empty()) |
| 86 ss << ", sync_group: " << sync_group; |
| 87 ss << ", pre_decode_callback: " |
| 88 << (pre_decode_callback ? "(EncodedFrameObserver)" : "nullptr"); |
| 89 ss << ", target_delay_ms: " << target_delay_ms; |
| 90 ss << '}'; |
| 91 |
| 92 return ss.str(); |
| 93 } |
| 94 |
| 95 VideoReceiveStream::Config::Rtp::Rtp() = default; |
| 96 VideoReceiveStream::Config::Rtp::Rtp(const Rtp&) = default; |
| 97 VideoReceiveStream::Config::Rtp::~Rtp() = default; |
| 98 |
| 99 std::string VideoReceiveStream::Config::Rtp::ToString() const { |
| 100 std::stringstream ss; |
| 101 ss << "{remote_ssrc: " << remote_ssrc; |
| 102 ss << ", local_ssrc: " << local_ssrc; |
| 103 ss << ", rtcp_mode: " |
| 104 << (rtcp_mode == RtcpMode::kCompound ? "RtcpMode::kCompound" |
| 105 : "RtcpMode::kReducedSize"); |
| 106 ss << ", rtcp_xr: "; |
| 107 ss << "{receiver_reference_time_report: " |
| 108 << (rtcp_xr.receiver_reference_time_report ? "on" : "off"); |
| 109 ss << '}'; |
| 110 ss << ", remb: " << (remb ? "on" : "off"); |
| 111 ss << ", transport_cc: " << (transport_cc ? "on" : "off"); |
| 112 ss << ", nack: {rtp_history_ms: " << nack.rtp_history_ms << '}'; |
| 113 ss << ", ulpfec: " << ulpfec.ToString(); |
| 114 ss << ", rtx_ssrc: " << rtx_ssrc; |
| 115 ss << ", rtx_payload_types: {"; |
| 116 for (auto& kv : rtx_payload_types) { |
| 117 ss << kv.first << " (apt) -> " << kv.second << " (pt), "; |
| 118 } |
| 119 ss << '}'; |
| 120 ss << ", extensions: ["; |
| 121 for (size_t i = 0; i < extensions.size(); ++i) { |
| 122 ss << extensions[i].ToString(); |
| 123 if (i != extensions.size() - 1) |
| 124 ss << ", "; |
| 125 } |
| 126 ss << ']'; |
| 127 ss << '}'; |
| 128 return ss.str(); |
| 129 } |
| 130 |
| 131 } // namespace webrtc |
OLD | NEW |