OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 14 matching lines...) Expand all Loading... |
25 decoding_successful(false), | 25 decoding_successful(false), |
26 encode_return_code(0), | 26 encode_return_code(0), |
27 decode_return_code(0), | 27 decode_return_code(0), |
28 encode_time_in_us(0), | 28 encode_time_in_us(0), |
29 decode_time_in_us(0), | 29 decode_time_in_us(0), |
30 frame_number(0), | 30 frame_number(0), |
31 packets_dropped(0), | 31 packets_dropped(0), |
32 total_packets(0), | 32 total_packets(0), |
33 bit_rate_in_kbps(0), | 33 bit_rate_in_kbps(0), |
34 encoded_frame_length_in_bytes(0), | 34 encoded_frame_length_in_bytes(0), |
35 frame_type(kDeltaFrame) {} | 35 frame_type(kVideoFrameDelta) {} |
36 | 36 |
37 Stats::Stats() {} | 37 Stats::Stats() {} |
38 | 38 |
39 Stats::~Stats() {} | 39 Stats::~Stats() {} |
40 | 40 |
41 bool LessForEncodeTime(const FrameStatistic& s1, const FrameStatistic& s2) { | 41 bool LessForEncodeTime(const FrameStatistic& s1, const FrameStatistic& s2) { |
42 return s1.encode_time_in_us < s2.encode_time_in_us; | 42 return s1.encode_time_in_us < s2.encode_time_in_us; |
43 } | 43 } |
44 | 44 |
45 bool LessForDecodeTime(const FrameStatistic& s1, const FrameStatistic& s2) { | 45 bool LessForDecodeTime(const FrameStatistic& s1, const FrameStatistic& s2) { |
(...skipping 30 matching lines...) Expand all Loading... |
76 size_t total_encoded_key_frames_lengths = 0; | 76 size_t total_encoded_key_frames_lengths = 0; |
77 size_t total_encoded_nonkey_frames_lengths = 0; | 77 size_t total_encoded_nonkey_frames_lengths = 0; |
78 size_t nbr_keyframes = 0; | 78 size_t nbr_keyframes = 0; |
79 size_t nbr_nonkeyframes = 0; | 79 size_t nbr_nonkeyframes = 0; |
80 | 80 |
81 for (FrameStatisticsIterator it = stats_.begin(); | 81 for (FrameStatisticsIterator it = stats_.begin(); |
82 it != stats_.end(); ++it) { | 82 it != stats_.end(); ++it) { |
83 total_encoding_time_in_us += it->encode_time_in_us; | 83 total_encoding_time_in_us += it->encode_time_in_us; |
84 total_decoding_time_in_us += it->decode_time_in_us; | 84 total_decoding_time_in_us += it->decode_time_in_us; |
85 total_encoded_frames_lengths += it->encoded_frame_length_in_bytes; | 85 total_encoded_frames_lengths += it->encoded_frame_length_in_bytes; |
86 if (it->frame_type == webrtc::kKeyFrame) { | 86 if (it->frame_type == webrtc::kVideoFrameKey) { |
87 total_encoded_key_frames_lengths += it->encoded_frame_length_in_bytes; | 87 total_encoded_key_frames_lengths += it->encoded_frame_length_in_bytes; |
88 nbr_keyframes++; | 88 nbr_keyframes++; |
89 } else { | 89 } else { |
90 total_encoded_nonkey_frames_lengths += it->encoded_frame_length_in_bytes; | 90 total_encoded_nonkey_frames_lengths += it->encoded_frame_length_in_bytes; |
91 nbr_nonkeyframes++; | 91 nbr_nonkeyframes++; |
92 } | 92 } |
93 } | 93 } |
94 | 94 |
95 FrameStatisticsIterator frame; | 95 FrameStatisticsIterator frame; |
96 | 96 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 printf("Total encoding time : %7d ms.\n", | 181 printf("Total encoding time : %7d ms.\n", |
182 total_encoding_time_in_us / 1000); | 182 total_encoding_time_in_us / 1000); |
183 printf("Total decoding time : %7d ms.\n", | 183 printf("Total decoding time : %7d ms.\n", |
184 total_decoding_time_in_us / 1000); | 184 total_decoding_time_in_us / 1000); |
185 printf("Total processing time: %7d ms.\n", | 185 printf("Total processing time: %7d ms.\n", |
186 (total_encoding_time_in_us + total_decoding_time_in_us) / 1000); | 186 (total_encoding_time_in_us + total_decoding_time_in_us) / 1000); |
187 } | 187 } |
188 | 188 |
189 } // namespace test | 189 } // namespace test |
190 } // namespace webrtc | 190 } // namespace webrtc |
OLD | NEW |