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
|
|
|
|
2013-04-16 10:31:56 +00:00
|
|
|
#include <string>
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2014-05-21 21:18:46 +00:00
|
|
|
#include "webrtc/base/constructormagic.h"
|
2015-11-04 08:31:52 +01:00
|
|
|
#include "webrtc/modules/include/module_common_types.h"
|
2015-11-18 22:00:21 +01:00
|
|
|
#include "webrtc/modules/video_coding/include/video_coding.h"
|
2015-10-28 18:17:40 +01:00
|
|
|
#include "webrtc/system_wrappers/include/event_wrapper.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-02-01 15:09:57 +00:00
|
|
|
enum { kMaxNackListSize = 250 };
|
|
|
|
|
enum { kMaxPacketAgeToNack = 450 };
|
|
|
|
|
|
2013-03-13 08:46:25 +00:00
|
|
|
class NullEvent : public webrtc::EventWrapper {
|
|
|
|
|
public:
|
|
|
|
|
virtual ~NullEvent() {}
|
|
|
|
|
|
|
|
|
|
virtual bool Set() { return true; }
|
|
|
|
|
|
|
|
|
|
virtual bool Reset() { return true; }
|
|
|
|
|
|
2015-12-21 08:23:20 -08:00
|
|
|
virtual webrtc::EventTypeWrapper Wait(unsigned long max_time) { // NOLINT
|
2013-03-13 08:46:25 +00:00
|
|
|
return webrtc::kEventTimeout;
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-21 08:23:20 -08:00
|
|
|
virtual bool StartTimer(bool periodic, unsigned long time) { // NOLINT
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2013-03-13 08:46:25 +00:00
|
|
|
|
|
|
|
|
virtual bool StopTimer() { return true; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class NullEventFactory : public webrtc::EventFactory {
|
|
|
|
|
public:
|
|
|
|
|
virtual ~NullEventFactory() {}
|
|
|
|
|
|
2015-12-21 08:23:20 -08:00
|
|
|
virtual webrtc::EventWrapper* CreateEvent() { return new NullEvent; }
|
2013-03-13 08:46:25 +00:00
|
|
|
};
|
2011-08-22 21:08:15 +00:00
|
|
|
|
2013-04-16 10:31:56 +00:00
|
|
|
class FileOutputFrameReceiver : public webrtc::VCMReceiveCallback {
|
|
|
|
|
public:
|
|
|
|
|
FileOutputFrameReceiver(const std::string& base_out_filename, uint32_t ssrc);
|
|
|
|
|
virtual ~FileOutputFrameReceiver();
|
|
|
|
|
|
|
|
|
|
// VCMReceiveCallback
|
2015-12-21 08:23:20 -08:00
|
|
|
virtual int32_t FrameToRender(webrtc::VideoFrame& video_frame); // NOLINT
|
2013-04-16 10:31:56 +00:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
std::string out_filename_;
|
|
|
|
|
FILE* out_file_;
|
|
|
|
|
FILE* timing_file_;
|
|
|
|
|
int width_;
|
|
|
|
|
int height_;
|
|
|
|
|
int count_;
|
|
|
|
|
|
2015-09-16 05:37:44 -07:00
|
|
|
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FileOutputFrameReceiver);
|
2013-04-16 10:31:56 +00:00
|
|
|
};
|
|
|
|
|
|
2015-03-19 08:18:53 +00:00
|
|
|
class CmdArgs {
|
|
|
|
|
public:
|
|
|
|
|
CmdArgs();
|
|
|
|
|
|
|
|
|
|
std::string codecName;
|
|
|
|
|
webrtc::VideoCodecType codecType;
|
|
|
|
|
int width;
|
|
|
|
|
int height;
|
|
|
|
|
int rtt;
|
|
|
|
|
std::string inputFile;
|
|
|
|
|
std::string outputFile;
|
|
|
|
|
};
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-11-18 22:00:21 +01:00
|
|
|
#endif // WEBRTC_MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_
|