1af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org/* 2af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 3af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org * 4af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org * Use of this source code is governed by a BSD-style license 5af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org * that can be found in the LICENSE file in the root of the source 6af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org * tree. An additional intellectual property rights grant can be found 7af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org * in the file PATENTS. All contributing project authors may 8af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org * be found in the AUTHORS file in the root of the source tree. 9af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org */ 10af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org 11af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org#ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_BASELINEFILE_H_ 12af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org#define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_BASELINEFILE_H_ 13af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org 14af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org#include <string> 15af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org#include "webrtc/modules/interface/module_common_types.h" 16af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org 17af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.orgnamespace webrtc { 18af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.orgnamespace testing { 19af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.orgnamespace bwe { 20af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org 21af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.orgclass BaseLineFileInterface { 22af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org public: 23af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org virtual ~BaseLineFileInterface() {} 24af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org 25af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org // Compare, or log, one estimate against the baseline file. 26af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org virtual void Estimate(int64_t time_ms, uint32_t estimate_bps) = 0; 27af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org 28af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org // Verify whether there are any differences between the logged estimates and 29af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org // those read from the baseline file. If updating the baseline file, write out 30af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org // new file if there were differences. Return true if logged estimates are 31af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org // identical, or if output file was updated successfully. 32af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org virtual bool VerifyOrWrite() = 0; 33af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org 34af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org // Create an instance for either verifying estimates against a baseline file 35af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org // with name |filename|, living in the resources/ directory or, if the flag 36af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org // |write_updated_file| is set, write logged estimates to a file with the same 37af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org // name, living in the out/ directory. 38af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org static BaseLineFileInterface* Create(const std::string& filename, 39af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org bool write_updated_file); 40af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org}; 41af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org} // namespace bwe 42af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org} // namespace testing 43af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org} // namespace webrtc 44af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org 45af00735ca7a7b0eab3e31d9d274340b3589fa5e4solenberg@webrtc.org#endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_BASELINEFILE_H_ 46