2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-01-23 14:56:14 +00:00
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
2011-07-07 08:21:25 +00:00
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2011-09-23 16:41:11 +00:00
|
|
|
#ifndef WEBRTC_MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_
|
|
|
|
|
#define WEBRTC_MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* General declarations used through out VCM offline tests.
|
|
|
|
|
*/
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <fstream>
|
|
|
|
|
#include <cstdlib>
|
|
|
|
|
|
2011-11-30 14:23:39 +00:00
|
|
|
#include "module_common_types.h"
|
|
|
|
|
#include "testsupport/fileutils.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
// Class used for passing command line arguments to tests
|
|
|
|
|
class CmdArgs
|
|
|
|
|
{
|
2011-11-30 14:23:39 +00:00
|
|
|
public:
|
|
|
|
|
CmdArgs()
|
|
|
|
|
: codecName("VP8"),
|
|
|
|
|
codecType(webrtc::kVideoCodecVP8),
|
|
|
|
|
width(352),
|
|
|
|
|
height(288),
|
|
|
|
|
bitRate(500),
|
|
|
|
|
frameRate(30),
|
|
|
|
|
packetLoss(0),
|
|
|
|
|
rtt(0),
|
|
|
|
|
protectionMode(0),
|
|
|
|
|
camaEnable(0),
|
|
|
|
|
inputFile(webrtc::test::ProjectRootPath() +
|
|
|
|
|
"/resources/foreman_cif.yuv"),
|
|
|
|
|
outputFile(webrtc::test::OutputPath() +
|
|
|
|
|
"video_coding_test_output_352x288.yuv"),
|
2012-11-09 16:16:41 +00:00
|
|
|
fv_outputfile(webrtc::test::OutputPath() + "features.txt"),
|
|
|
|
|
testNum(0) {}
|
2011-08-22 21:08:15 +00:00
|
|
|
std::string codecName;
|
|
|
|
|
webrtc::VideoCodecType codecType;
|
|
|
|
|
int width;
|
|
|
|
|
int height;
|
|
|
|
|
int bitRate;
|
|
|
|
|
int frameRate;
|
|
|
|
|
int packetLoss;
|
|
|
|
|
int rtt;
|
|
|
|
|
int protectionMode;
|
|
|
|
|
int camaEnable;
|
|
|
|
|
std::string inputFile;
|
|
|
|
|
std::string outputFile;
|
2012-11-09 16:16:41 +00:00
|
|
|
std::string fv_outputfile;
|
2011-08-22 21:08:15 +00:00
|
|
|
int testNum;
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// forward declaration
|
|
|
|
|
int MTRxTxTest(CmdArgs& args);
|
2011-09-09 14:38:59 +00:00
|
|
|
double NormalDist(double mean, double stdDev);
|
2011-08-22 21:08:15 +00:00
|
|
|
|
2012-01-23 14:56:14 +00:00
|
|
|
struct RtpPacket {
|
|
|
|
|
WebRtc_Word8 data[1650]; // max packet size
|
|
|
|
|
WebRtc_Word32 length;
|
|
|
|
|
WebRtc_Word64 receiveTime;
|
|
|
|
|
};
|
2011-08-22 21:08:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
// Codec type conversion
|
2011-07-07 08:21:25 +00:00
|
|
|
webrtc::RTPVideoCodecTypes
|
|
|
|
|
ConvertCodecType(const char* plname);
|
|
|
|
|
|
|
|
|
|
#endif
|