Update V8 to version 4.6.61.
[chromium-blink-merge.git] / remoting / codec / codec_test.h
blobe5d5bb63d722b1b4969aefef3e1f42e581a6508d
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 for a sequence of one "changed"
30 // frame followed by one or more "unchanged" frames, and verify that the
31 // encoder sends up to |max_topoff_frames| of non-empty data for unchanged
32 // frames, after which it returns null frames.
33 void TestVideoEncoderEmptyFrames(VideoEncoder* encoder, int max_topoff_frames);
35 // Generate test data and test the encoder and decoder pair.
37 // If |strict| is set to true, this routine will make sure the updated rects
38 // are correct.
39 void TestVideoEncoderDecoder(VideoEncoder* encoder,
40 VideoDecoder* decoder,
41 bool strict);
43 // Generate a frame containing a gradient, and test the encoder and decoder
44 // pair.
45 void TestVideoEncoderDecoderGradient(VideoEncoder* encoder,
46 VideoDecoder* decoder,
47 const webrtc::DesktopSize& screen_size,
48 const webrtc::DesktopSize& view_size,
49 double max_error_limit,
50 double mean_error_limit);
52 // Run sufficient encoding iterations to measure the FPS of the specified
53 // encoder. The caller may supply one or more DesktopFrames to encode, which
54 // will be cycled through until timing is complete. If the caller does not
55 // supply any frames then a single full-frame of randomized pixels is used.
56 float MeasureVideoEncoderFpsWithSize(VideoEncoder* encoder,
57 const webrtc::DesktopSize& size);
58 float MeasureVideoEncoderFpsWithFrames(
59 VideoEncoder* encoder,
60 const std::list<webrtc::DesktopFrame*>& frames);
62 } // namespace remoting
64 #endif // REMOTING_CODEC_CODEC_TEST_H_