2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-05-11 11:08:54 +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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef WEBRTC_MODULES_VIDEO_CODING_TEST_RECEIVER_TESTS_H_
|
|
|
|
|
#define WEBRTC_MODULES_VIDEO_CODING_TEST_RECEIVER_TESTS_H_
|
|
|
|
|
|
|
|
|
|
#include "video_coding.h"
|
|
|
|
|
#include "module_common_types.h"
|
|
|
|
|
#include "common_types.h"
|
|
|
|
|
#include "rtp_rtcp.h"
|
|
|
|
|
#include "typedefs.h"
|
|
|
|
|
#include "rtp_player.h"
|
|
|
|
|
#include "test_util.h"
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
|
class RtpDataCallback : public webrtc::RtpData
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
RtpDataCallback(webrtc::VideoCodingModule* vcm)
|
|
|
|
|
: _vcm(vcm) {};
|
|
|
|
|
|
2013-04-02 15:54:38 +00:00
|
|
|
virtual int32_t OnReceivedPayloadData(const uint8_t* payloadData,
|
|
|
|
|
const uint16_t payloadSize,
|
2011-07-07 08:21:25 +00:00
|
|
|
const webrtc::WebRtcRTPHeader* rtpHeader);
|
|
|
|
|
private:
|
|
|
|
|
webrtc::VideoCodingModule* _vcm;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FrameReceiveCallback : public webrtc::VCMReceiveCallback
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
FrameReceiveCallback(std::string outFilename) :
|
|
|
|
|
_outFilename(outFilename),
|
|
|
|
|
_outFile(NULL),
|
2012-10-08 07:02:53 +00:00
|
|
|
_timingFile(NULL),
|
|
|
|
|
width_(0),
|
2013-01-17 09:27:17 +00:00
|
|
|
height_(0),
|
|
|
|
|
count_(0) {}
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
virtual ~FrameReceiveCallback();
|
|
|
|
|
|
2013-04-02 15:54:38 +00:00
|
|
|
int32_t FrameToRender(webrtc::I420VideoFrame& videoFrame);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
private:
|
2012-10-08 07:02:53 +00:00
|
|
|
static void SplitFilename(std::string filename, std::string* basename,
|
|
|
|
|
std::string* ending);
|
2013-01-17 09:27:17 +00:00
|
|
|
static std::string AppendWidthHeightAndCount(std::string basename,
|
|
|
|
|
unsigned int width,
|
|
|
|
|
unsigned int height,
|
|
|
|
|
int count);
|
2011-07-07 08:21:25 +00:00
|
|
|
std::string _outFilename;
|
|
|
|
|
FILE* _outFile;
|
|
|
|
|
FILE* _timingFile;
|
2012-10-08 07:02:53 +00:00
|
|
|
unsigned int width_;
|
|
|
|
|
unsigned int height_;
|
2013-01-17 09:27:17 +00:00
|
|
|
int count_;
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class SharedState
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
SharedState(webrtc::VideoCodingModule& vcm, RTPPlayer& rtpPlayer) :
|
2011-08-03 07:49:56 +00:00
|
|
|
_vcm(vcm),
|
|
|
|
|
_rtpPlayer(rtpPlayer) {}
|
2011-07-07 08:21:25 +00:00
|
|
|
webrtc::VideoCodingModule& _vcm;
|
|
|
|
|
RTPPlayer& _rtpPlayer;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int RtpPlay(CmdArgs& args);
|
|
|
|
|
int RtpPlayMT(CmdArgs& args,
|
|
|
|
|
int releaseTest = 0,
|
|
|
|
|
webrtc::VideoCodecType releaseTestVideoType = webrtc::kVideoCodecVP8);
|
|
|
|
|
int ReceiverTimingTests(CmdArgs& args);
|
|
|
|
|
int JitterBufferTest(CmdArgs& args);
|
|
|
|
|
int DecodeFromStorageTest(CmdArgs& args);
|
|
|
|
|
|
|
|
|
|
// Thread functions:
|
|
|
|
|
bool ProcessingThread(void* obj);
|
|
|
|
|
bool RtpReaderThread(void* obj);
|
|
|
|
|
bool DecodeThread(void* obj);
|
|
|
|
|
bool NackThread(void* obj);
|
|
|
|
|
|
|
|
|
|
#endif // WEBRTC_MODULES_VIDEO_CODING_TEST_RECEIVER_TESTS_H_
|