OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "webrtc/modules/video_coding/utility/ivf_file_writer.h" | 30 #include "webrtc/modules/video_coding/utility/ivf_file_writer.h" |
31 #include "webrtc/rtc_base/checks.h" | 31 #include "webrtc/rtc_base/checks.h" |
32 #include "webrtc/rtc_base/location.h" | 32 #include "webrtc/rtc_base/location.h" |
33 #include "webrtc/rtc_base/logging.h" | 33 #include "webrtc/rtc_base/logging.h" |
34 #include "webrtc/rtc_base/optional.h" | 34 #include "webrtc/rtc_base/optional.h" |
35 #include "webrtc/rtc_base/trace_event.h" | 35 #include "webrtc/rtc_base/trace_event.h" |
36 #include "webrtc/system_wrappers/include/clock.h" | 36 #include "webrtc/system_wrappers/include/clock.h" |
37 #include "webrtc/system_wrappers/include/field_trial.h" | 37 #include "webrtc/system_wrappers/include/field_trial.h" |
38 #include "webrtc/video/call_stats.h" | 38 #include "webrtc/video/call_stats.h" |
39 #include "webrtc/video/receive_statistics_proxy.h" | 39 #include "webrtc/video/receive_statistics_proxy.h" |
40 #include "webrtc/video_receive_stream.h" | |
41 | 40 |
42 namespace webrtc { | 41 namespace webrtc { |
43 | 42 |
44 std::string VideoReceiveStream::Decoder::ToString() const { | |
45 std::stringstream ss; | |
46 ss << "{decoder: " << (decoder ? "(VideoDecoder)" : "nullptr"); | |
47 ss << ", payload_type: " << payload_type; | |
48 ss << ", payload_name: " << payload_name; | |
49 ss << ", codec_params: {"; | |
50 for (const auto& it : codec_params) | |
51 ss << it.first << ": " << it.second; | |
52 ss << '}'; | |
53 ss << '}'; | |
54 | |
55 return ss.str(); | |
56 } | |
57 | |
58 std::string VideoReceiveStream::Config::ToString() const { | |
59 std::stringstream ss; | |
60 ss << "{decoders: ["; | |
61 for (size_t i = 0; i < decoders.size(); ++i) { | |
62 ss << decoders[i].ToString(); | |
63 if (i != decoders.size() - 1) | |
64 ss << ", "; | |
65 } | |
66 ss << ']'; | |
67 ss << ", rtp: " << rtp.ToString(); | |
68 ss << ", renderer: " << (renderer ? "(renderer)" : "nullptr"); | |
69 ss << ", render_delay_ms: " << render_delay_ms; | |
70 if (!sync_group.empty()) | |
71 ss << ", sync_group: " << sync_group; | |
72 ss << ", pre_decode_callback: " | |
73 << (pre_decode_callback ? "(EncodedFrameObserver)" : "nullptr"); | |
74 ss << ", target_delay_ms: " << target_delay_ms; | |
75 ss << '}'; | |
76 | |
77 return ss.str(); | |
78 } | |
79 | |
80 std::string VideoReceiveStream::Config::Rtp::ToString() const { | |
81 std::stringstream ss; | |
82 ss << "{remote_ssrc: " << remote_ssrc; | |
83 ss << ", local_ssrc: " << local_ssrc; | |
84 ss << ", rtcp_mode: " | |
85 << (rtcp_mode == RtcpMode::kCompound ? "RtcpMode::kCompound" | |
86 : "RtcpMode::kReducedSize"); | |
87 ss << ", rtcp_xr: "; | |
88 ss << "{receiver_reference_time_report: " | |
89 << (rtcp_xr.receiver_reference_time_report ? "on" : "off"); | |
90 ss << '}'; | |
91 ss << ", remb: " << (remb ? "on" : "off"); | |
92 ss << ", transport_cc: " << (transport_cc ? "on" : "off"); | |
93 ss << ", nack: {rtp_history_ms: " << nack.rtp_history_ms << '}'; | |
94 ss << ", ulpfec: " << ulpfec.ToString(); | |
95 ss << ", rtx_ssrc: " << rtx_ssrc; | |
96 ss << ", rtx_payload_types: {"; | |
97 for (auto& kv : rtx_payload_types) { | |
98 ss << kv.first << " (apt) -> " << kv.second << " (pt), "; | |
99 } | |
100 ss << '}'; | |
101 ss << ", extensions: ["; | |
102 for (size_t i = 0; i < extensions.size(); ++i) { | |
103 ss << extensions[i].ToString(); | |
104 if (i != extensions.size() - 1) | |
105 ss << ", "; | |
106 } | |
107 ss << ']'; | |
108 ss << '}'; | |
109 return ss.str(); | |
110 } | |
111 | |
112 std::string VideoReceiveStream::Stats::ToString(int64_t time_ms) const { | |
113 std::stringstream ss; | |
114 ss << "VideoReceiveStream stats: " << time_ms << ", {ssrc: " << ssrc << ", "; | |
115 ss << "total_bps: " << total_bitrate_bps << ", "; | |
116 ss << "width: " << width << ", "; | |
117 ss << "height: " << height << ", "; | |
118 ss << "key: " << frame_counts.key_frames << ", "; | |
119 ss << "delta: " << frame_counts.delta_frames << ", "; | |
120 ss << "network_fps: " << network_frame_rate << ", "; | |
121 ss << "decode_fps: " << decode_frame_rate << ", "; | |
122 ss << "render_fps: " << render_frame_rate << ", "; | |
123 ss << "decode_ms: " << decode_ms << ", "; | |
124 ss << "max_decode_ms: " << max_decode_ms << ", "; | |
125 ss << "cur_delay_ms: " << current_delay_ms << ", "; | |
126 ss << "targ_delay_ms: " << target_delay_ms << ", "; | |
127 ss << "jb_delay_ms: " << jitter_buffer_ms << ", "; | |
128 ss << "min_playout_delay_ms: " << min_playout_delay_ms << ", "; | |
129 ss << "discarded: " << discarded_packets << ", "; | |
130 ss << "sync_offset_ms: " << sync_offset_ms << ", "; | |
131 ss << "cum_loss: " << rtcp_stats.packets_lost << ", "; | |
132 ss << "max_ext_seq: " << rtcp_stats.extended_highest_sequence_number << ", "; | |
133 ss << "nack: " << rtcp_packet_type_counts.nack_packets << ", "; | |
134 ss << "fir: " << rtcp_packet_type_counts.fir_packets << ", "; | |
135 ss << "pli: " << rtcp_packet_type_counts.pli_packets; | |
136 ss << '}'; | |
137 return ss.str(); | |
138 } | |
139 | |
140 namespace { | 43 namespace { |
141 VideoCodec CreateDecoderVideoCodec(const VideoReceiveStream::Decoder& decoder) { | 44 VideoCodec CreateDecoderVideoCodec(const VideoReceiveStream::Decoder& decoder) { |
142 VideoCodec codec; | 45 VideoCodec codec; |
143 memset(&codec, 0, sizeof(codec)); | 46 memset(&codec, 0, sizeof(codec)); |
144 | 47 |
145 codec.plType = decoder.payload_type; | 48 codec.plType = decoder.payload_type; |
146 strncpy(codec.plName, decoder.payload_name.c_str(), sizeof(codec.plName)); | 49 strncpy(codec.plName, decoder.payload_name.c_str(), sizeof(codec.plName)); |
147 codec.codecType = | 50 codec.codecType = |
148 PayloadNameToCodecType(decoder.payload_name).value_or(kVideoCodecGeneric); | 51 PayloadNameToCodecType(decoder.payload_name).value_or(kVideoCodecGeneric); |
149 | 52 |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 if (stream_is_active && !receiving_keyframe) { | 447 if (stream_is_active && !receiving_keyframe) { |
545 LOG(LS_WARNING) << "No decodable frame in " << wait_ms | 448 LOG(LS_WARNING) << "No decodable frame in " << wait_ms |
546 << " ms, requesting keyframe."; | 449 << " ms, requesting keyframe."; |
547 RequestKeyFrame(); | 450 RequestKeyFrame(); |
548 } | 451 } |
549 } | 452 } |
550 return true; | 453 return true; |
551 } | 454 } |
552 } // namespace internal | 455 } // namespace internal |
553 } // namespace webrtc | 456 } // namespace webrtc |
OLD | NEW |