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

Side by Side Diff: webrtc/test/fake_encoder.cc

Issue 1228393008: Add resolution and fps stats to histograms. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: added render fps Created 5 years, 5 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
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 stream_bytes *= 10; 90 stream_bytes *= 10;
91 } 91 }
92 if (stream_bytes > sizeof(encoded_buffer_)) 92 if (stream_bytes > sizeof(encoded_buffer_))
93 stream_bytes = sizeof(encoded_buffer_); 93 stream_bytes = sizeof(encoded_buffer_);
94 94
95 EncodedImage encoded( 95 EncodedImage encoded(
96 encoded_buffer_, stream_bytes, sizeof(encoded_buffer_)); 96 encoded_buffer_, stream_bytes, sizeof(encoded_buffer_));
97 encoded._timeStamp = input_image.timestamp(); 97 encoded._timeStamp = input_image.timestamp();
98 encoded.capture_time_ms_ = input_image.render_time_ms(); 98 encoded.capture_time_ms_ = input_image.render_time_ms();
99 encoded._frameType = (*frame_types)[i]; 99 encoded._frameType = (*frame_types)[i];
100 encoded._encodedWidth = config_.simulcastStream[i].width;
101 encoded._encodedHeight = config_.simulcastStream[i].height;
100 // Always encode something on the first frame. 102 // Always encode something on the first frame.
101 if (min_stream_bits > bits_available && i > 0) { 103 if (min_stream_bits > bits_available && i > 0) {
102 encoded._length = 0; 104 encoded._length = 0;
103 encoded._frameType = kSkipFrame; 105 encoded._frameType = kSkipFrame;
104 } 106 }
105 assert(callback_ != NULL); 107 assert(callback_ != NULL);
106 if (callback_->Encoded(encoded, &specifics, NULL) != 0) 108 if (callback_->Encoded(encoded, &specifics, NULL) != 0)
107 return -1; 109 return -1;
108 bits_available -= std::min(encoded._length * 8, bits_available); 110 bits_available -= std::min(encoded._length * 8, bits_available);
109 } 111 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 delay_ms_(delay_ms) {} 190 delay_ms_(delay_ms) {}
189 191
190 int32_t DelayedEncoder::Encode(const VideoFrame& input_image, 192 int32_t DelayedEncoder::Encode(const VideoFrame& input_image,
191 const CodecSpecificInfo* codec_specific_info, 193 const CodecSpecificInfo* codec_specific_info,
192 const std::vector<VideoFrameType>* frame_types) { 194 const std::vector<VideoFrameType>* frame_types) {
193 SleepMs(delay_ms_); 195 SleepMs(delay_ms_);
194 return FakeEncoder::Encode(input_image, codec_specific_info, frame_types); 196 return FakeEncoder::Encode(input_image, codec_specific_info, frame_types);
195 } 197 }
196 } // namespace test 198 } // namespace test
197 } // namespace webrtc 199 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/video/end_to_end_tests.cc » ('j') | webrtc/video/receive_statistics_proxy.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698