Extensions: Store disable reasons in Sync
[chromium-blink-merge.git] / remoting / codec / codec_test.h
blob9c9ec7bf83b20c5d8ab2c9e500964f7f1e9b7962
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_
8 #include <list>
10 #include "base/memory/ref_counted.h"
12 namespace webrtc {
13 class DesktopFrame;
14 class DesktopSize;
17 namespace remoting {
19 class VideoDecoder;
20 class VideoEncoder;
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
32 // are correct.
33 void TestVideoEncoderDecoder(VideoEncoder* encoder,
34 VideoDecoder* decoder,
35 bool strict);
37 // Generate a frame containing a gradient, and test the encoder and decoder
38 // pair.
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_