1812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org/*
2812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org *
4812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org *  Use of this source code is governed by a BSD-style license
5812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org *  that can be found in the LICENSE file in the root of the source
6812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org *  tree. An additional intellectual property rights grant can be found
7812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org *  in the file PATENTS.  All contributing project authors may
8812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org *  be found in the AUTHORS file in the root of the source tree.
9812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org */
10812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org
11812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org#ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_BASELINEFILE_H_
12812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org#define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_BASELINEFILE_H_
13812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org
14812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org#include <string>
15ff761fba8274d93bd73e76c8b8a1f2d0776dd840Henrik Kjellander#include "webrtc/modules/include/module_common_types.h"
16812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org
17812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.orgnamespace webrtc {
18812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.orgnamespace testing {
19812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.orgnamespace bwe {
20812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org
21812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.orgclass BaseLineFileInterface {
22812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org public:
23812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org  virtual ~BaseLineFileInterface() {}
24812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org
25812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org  // Compare, or log, one estimate against the baseline file.
26812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org  virtual void Estimate(int64_t time_ms, uint32_t estimate_bps) = 0;
27812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org
28812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org  // Verify whether there are any differences between the logged estimates and
29812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org  // those read from the baseline file. If updating the baseline file, write out
30812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org  // new file if there were differences. Return true if logged estimates are
31812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org  // identical, or if output file was updated successfully.
32812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org  virtual bool VerifyOrWrite() = 0;
33812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org
34812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org  // Create an instance for either verifying estimates against a baseline file
35812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org  // with name |filename|, living in the resources/ directory or, if the flag
36812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org  // |write_updated_file| is set, write logged estimates to a file with the same
37812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org  // name, living in the out/ directory.
38812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org  static BaseLineFileInterface* Create(const std::string& filename,
39812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org                                       bool write_updated_file);
40812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org};
41812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org}  // namespace bwe
42812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org}  // namespace testing
43812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org}  // namespace webrtc
44812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org
45812dd11f8c83f391bb9efa1ebcee9411475e46besolenberg@webrtc.org#endif  // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_BASELINEFILE_H_
46