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

Side by Side Diff: webrtc/modules/video_coding/codecs/test/videoprocessor.h

Issue 2707023008: Step #2: Add batch mode to VideoProcessor integration tests. (Closed)
Patch Set: Created 3 years, 9 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) 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 // Processes a single frame. Returns true as long as there's more frames 141 // Processes a single frame. Returns true as long as there's more frames
142 // available in the source clip. 142 // available in the source clip.
143 // Frame number must be an integer >= 0. 143 // Frame number must be an integer >= 0.
144 virtual bool ProcessFrame(int frame_number) = 0; 144 virtual bool ProcessFrame(int frame_number) = 0;
145 145
146 // Updates the encoder with the target bit rate and the frame rate. 146 // Updates the encoder with the target bit rate and the frame rate.
147 virtual void SetRates(int bit_rate, int frame_rate) = 0; 147 virtual void SetRates(int bit_rate, int frame_rate) = 0;
148 148
149 // Return the size of the encoded frame in bytes. Dropped frames by the 149 // Return the size of the encoded frame in bytes. Dropped frames by the
150 // encoder are regarded as zero size. 150 // encoder are regarded as zero size.
151 virtual size_t EncodedFrameSize() = 0; 151 virtual size_t EncodedFrameSize(int frame_number) = 0;
152 152
153 // Return the encoded frame type (key or delta). 153 // Return the encoded frame type (key or delta).
154 virtual FrameType EncodedFrameType() = 0; 154 virtual FrameType EncodedFrameType(int frame_number) = 0;
155 155
156 // Return the number of dropped frames. 156 // Return the number of dropped frames.
157 virtual int NumberDroppedFrames() = 0; 157 virtual int NumberDroppedFrames() = 0;
158 158
159 // Return the number of spatial resizes. 159 // Return the number of spatial resizes.
160 virtual int NumberSpatialResizes() = 0; 160 virtual int NumberSpatialResizes() = 0;
161 }; 161 };
162 162
163 class VideoProcessorImpl : public VideoProcessor { 163 class VideoProcessorImpl : public VideoProcessor {
164 public: 164 public:
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 void FrameDecoded(const webrtc::VideoFrame& image); 257 void FrameDecoded(const webrtc::VideoFrame& image);
258 258
259 // Used for getting a 32-bit integer representing time 259 // Used for getting a 32-bit integer representing time
260 // (checks the size is within signed 32-bit bounds before casting it) 260 // (checks the size is within signed 32-bit bounds before casting it)
261 int GetElapsedTimeMicroseconds(int64_t start, int64_t stop); 261 int GetElapsedTimeMicroseconds(int64_t start, int64_t stop);
262 262
263 // Updates the encoder with the target bit rate and the frame rate. 263 // Updates the encoder with the target bit rate and the frame rate.
264 void SetRates(int bit_rate, int frame_rate) override; 264 void SetRates(int bit_rate, int frame_rate) override;
265 265
266 // Return the size of the encoded frame in bytes. 266 // Return the size of the encoded frame in bytes.
267 size_t EncodedFrameSize() override; 267 size_t EncodedFrameSize(int frame_number) override;
268 268
269 // Return the encoded frame type (key or delta). 269 // Return the encoded frame type (key or delta).
270 FrameType EncodedFrameType() override; 270 FrameType EncodedFrameType(int frame_number) override;
271 271
272 // Return the number of dropped frames. 272 // Return the number of dropped frames.
273 int NumberDroppedFrames() override; 273 int NumberDroppedFrames() override;
274 274
275 // Return the number of spatial resizes. 275 // Return the number of spatial resizes.
276 int NumberSpatialResizes() override; 276 int NumberSpatialResizes() override;
277 277
278 webrtc::VideoEncoder* const encoder_; 278 webrtc::VideoEncoder* const encoder_;
279 webrtc::VideoDecoder* const decoder_; 279 webrtc::VideoDecoder* const decoder_;
280 const std::unique_ptr<VideoBitrateAllocator> bitrate_allocator_; 280 const std::unique_ptr<VideoBitrateAllocator> bitrate_allocator_;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 Stats* stats_; 321 Stats* stats_;
322 int num_dropped_frames_; 322 int num_dropped_frames_;
323 int num_spatial_resizes_; 323 int num_spatial_resizes_;
324 double bit_rate_factor_; // Multiply frame length with this to get bit rate. 324 double bit_rate_factor_; // Multiply frame length with this to get bit rate.
325 }; 325 };
326 326
327 } // namespace test 327 } // namespace test
328 } // namespace webrtc 328 } // namespace webrtc
329 329
330 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_H_ 330 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698