Add support for multiple streams to RtpPlayer:
- Tests video_rtp_play.cc, video_rtp_play_mt.cc, decode_from_storage.cc rewritten - rtp_player.cc/.h rewritten; added interfaces for externally setting up sinks - Support for reading .rtp files pulled out into rtp_file_reader namespace - Added support for reading .pcap (libpcap/wireshark/tcpdump) files, see pcap_file_reader BUG= TEST=trybots Review URL: https://webrtc-codereview.appspot.com/1201009 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3856 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -15,56 +15,37 @@
|
||||
* General declarations used through out VCM offline tests.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <fstream>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
|
||||
#include "webrtc/modules/interface/module_common_types.h"
|
||||
#include "webrtc/modules/video_coding/main/interface/video_coding.h"
|
||||
#include "webrtc/system_wrappers/interface/event_wrapper.h"
|
||||
#include "webrtc/test/testsupport/fileutils.h"
|
||||
#include "webrtc/system_wrappers/interface/constructor_magic.h"
|
||||
|
||||
enum { kMaxNackListSize = 250 };
|
||||
enum { kMaxPacketAgeToNack = 450 };
|
||||
|
||||
// Class used for passing command line arguments to tests
|
||||
class CmdArgs
|
||||
{
|
||||
class CmdArgs {
|
||||
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"),
|
||||
fv_outputfile(webrtc::test::OutputPath() + "features.txt"),
|
||||
testNum(0) {}
|
||||
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;
|
||||
std::string fv_outputfile;
|
||||
int testNum;
|
||||
CmdArgs();
|
||||
|
||||
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;
|
||||
std::string fv_outputfile;
|
||||
int testNum;
|
||||
};
|
||||
|
||||
// forward declaration
|
||||
int MTRxTxTest(CmdArgs& args);
|
||||
double NormalDist(double mean, double stdDev);
|
||||
|
||||
@ -100,8 +81,27 @@ class NullEventFactory : public webrtc::EventFactory {
|
||||
}
|
||||
};
|
||||
|
||||
class FileOutputFrameReceiver : public webrtc::VCMReceiveCallback {
|
||||
public:
|
||||
FileOutputFrameReceiver(const std::string& base_out_filename, uint32_t ssrc);
|
||||
virtual ~FileOutputFrameReceiver();
|
||||
|
||||
// VCMReceiveCallback
|
||||
virtual WebRtc_Word32 FrameToRender(webrtc::I420VideoFrame& video_frame);
|
||||
|
||||
private:
|
||||
std::string out_filename_;
|
||||
uint32_t ssrc_;
|
||||
FILE* out_file_;
|
||||
FILE* timing_file_;
|
||||
int width_;
|
||||
int height_;
|
||||
int count_;
|
||||
|
||||
DISALLOW_IMPLICIT_CONSTRUCTORS(FileOutputFrameReceiver);
|
||||
};
|
||||
|
||||
// Codec type conversion
|
||||
webrtc::RTPVideoCodecTypes
|
||||
ConvertCodecType(const char* plname);
|
||||
webrtc::RTPVideoCodecTypes ConvertCodecType(const char* plname);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user