1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef REMOTING_CODEC_CODEC_TEST_H_
6 #define REMOTING_CODEC_CODEC_TEST_H_
10 #include "base/memory/ref_counted.h"
22 // Generate test data and test the encoder for a regular encoding sequence.
23 // This will test encoder test and the sequence of messages sent.
25 // If |strict| is set to true then this routine will make sure the updated
26 // rects match dirty rects.
27 void TestVideoEncoder(VideoEncoder
* encoder
, bool strict
);
29 // Generate test data and test the encoder and decoder pair.
31 // If |strict| is set to true, this routine will make sure the updated rects
33 void TestVideoEncoderDecoder(VideoEncoder
* encoder
,
34 VideoDecoder
* decoder
,
37 // Generate a frame containing a gradient, and test the encoder and decoder
39 void TestVideoEncoderDecoderGradient(VideoEncoder
* encoder
,
40 VideoDecoder
* decoder
,
41 const webrtc::DesktopSize
& screen_size
,
42 const webrtc::DesktopSize
& view_size
,
43 double max_error_limit
,
44 double mean_error_limit
);
46 // Run sufficient encoding iterations to measure the FPS of the specified
47 // encoder. The caller may supply one or more DesktopFrames to encode, which
48 // will be cycled through until timing is complete. If the caller does not
49 // supply any frames then a single full-frame of randomized pixels is used.
50 float MeasureVideoEncoderFpsWithSize(VideoEncoder
* encoder
,
51 const webrtc::DesktopSize
& size
);
52 float MeasureVideoEncoderFpsWithFrames(
53 VideoEncoder
* encoder
,
54 const std::list
<webrtc::DesktopFrame
*>& frames
);
56 } // namespace remoting
58 #endif // REMOTING_CODEC_CODEC_TEST_H_