Remove unused video tests.

Review URL: https://webrtc-codereview.appspot.com/841010

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2843 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mflodman@webrtc.org
2012-09-28 12:34:25 +00:00
parent 7cf8121a52
commit 953368bf73
31 changed files with 0 additions and 4581 deletions

View File

@ -1,36 +0,0 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* 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.
*/
/*
* GUI_Defines.h
*
*/
#ifndef WEBRTC_VIDEO_ENGINE_MAIN_TEST_SIMPLECOCOAGUI_GUI_DEFINES_H_
#define WEBRTC_VIDEO_ENGINE_MAIN_TEST_SIMPLECOCOAGUI_GUI_DEFINES_H_
#define ViE_TEST(x) if(-1 == x){ \
int errNum = _ptrViEBase->LastError(); \
NSLog(@"ERROR: %d at %s:%d", errNum, __FUNCTION__, __LINE__); \
}
// Video Engine Related
#define V_CAPTURE_DEVICE_INDEX 0
#define V_VIE_CAPTURE_ID 747
#define V_DEVICE_NAME_LENGTH 256
#define V_CODEC_INDEX 2
#define V_IP_ADDRESS "127.0.0.1"
#define V_RTP_PORT 8000
#endif // WEBRTC_VIDEO_ENGINE_MAIN_TEST_SIMPLECOCOAGUI_GUI_DEFINES_H_

View File

@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSMainNibFile</key>
<string>SimpleCocoaGUI</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View File

@ -1,77 +0,0 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* 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.
*/
//
// SimpleCocoaGUIAppDelegate.h
//
#import <Cocoa/Cocoa.h>
#include <iostream>
using namespace std;
@class ViECocoaRenderView;
#include "GUI_Defines.h"
#include "common_types.h"
#include "voe_base.h"
#include "vie_base.h"
#include "vie_capture.h"
#include "vie_codec.h"
#include "vie_file.h"
#include "vie_network.h"
#include "vie_render.h"
#include "vie_rtp_rtcp.h"
#include "vie_errors.h"
@interface SimpleCocoaGUIAppDelegate : NSObject <NSApplicationDelegate> {
NSWindow* _window;
IBOutlet NSOpenGLView* _vieCocoaRenderView1;
IBOutlet NSOpenGLView* _vieCocoaRenderView2;
IBOutlet NSButton* _butRestartLoopback;
VideoEngine* _ptrViE;
ViEBase* _ptrViEBase;
ViECapture* _ptrViECapture;
ViERender* _ptrViERender;
ViECodec* _ptrViECodec;
ViENetwork* _ptrViENetwork;
bool _fullScreen;
int _videoChannel;
int _captureId;
VideoEngine* ptrViE;
ViEBase* ptrViEBase;
ViECapture* ptrViECapture;
ViERTP_RTCP* ptrViERtpRtcp;
ViERender* ptrViERender;
ViECodec* ptrViECodec;
ViENetwork* ptrViENetwork;
}
@property (assign) IBOutlet NSWindow* window;
-(void)createUI:(bool)fullScreen;
-(void)initViECocoaTest;
-(void)initializeVariables;
-(void)NSLogVideoCodecs;
-(void)startViECocoaTest;
-(int)initLoopback;
-(int)ioLooback;
-(int)startLoopback;
-(int)stopLooback;
-(IBAction)handleRestart:(id)sender;
@end

View File

@ -1,7 +0,0 @@
//
// Prefix header for all source files of the 'SimpleCocoaGUI' target in the 'SimpleCocoaGUI' project
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif

View File

@ -1,12 +0,0 @@
//
// main.m
// SimpleCocoaGUI
//
//
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
return NSApplicationMain(argc, (const char **) argv);
}

View File

@ -1,255 +0,0 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Korean resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR)
#ifdef _WIN32
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
#pragma code_page(949)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 18, 1\r\n"
"#pragma code_page(949)\r\n"
"#endif //_WIN32\r\n"
"#include ""res\\Capture.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""l.kor\\afxres.rc"" // Standard components\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
END
#endif // Korean resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Swedish resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE)
#ifdef _WIN32
LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_SLAVE_CHANNEL DIALOGEX 0, 0, 677, 358
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Slave channel"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_IPADDRESS1,"SysIPAddress32",WS_TABSTOP,485,18,105,15
EDITTEXT IDC_LOCAL_PORT1,631,18,36,16,ES_AUTOHSCROLL
LTEXT "IP-address",IDC_STATIC,495,7,42,9
LTEXT "Local Port",IDC_STATIC,633,7,37,9
EDITTEXT IDC_REMOTE_PORT1,593,18,36,16,ES_AUTOHSCROLL
LTEXT "Port",IDC_STATIC,595,7,17,9
CONTROL "Ext",IDC_EXTTRANSPORT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,489,41,29,12
LTEXT "delay",IDC_STATIC,589,41,21,9
COMBOBOX IDC_PACKETLOSS,535,40,45,82,CBS_DROPDOWN | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_DELAY,611,40,45,82,CBS_DROPDOWN | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_SLAVE_CHANNEL, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 670
TOPMARGIN, 7
BOTTOMMARGIN, 351
END
END
#endif // APSTUDIO_INVOKED
#endif // Swedish resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Neutral (Sys. Default) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUSD)
#ifdef _WIN32
LANGUAGE LANG_NEUTRAL, SUBLANG_SYS_DEFAULT
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_DXQUALITY_DIALOG DIALOGEX 0, 0, 699, 385
STYLE DS_ABSALIGN | DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_WINDOWEDGE | WS_EX_STATICEDGE | WS_EX_APPWINDOW | WS_EX_NOINHERITLAYOUT
CAPTION "webrtc ViE test program"
FONT 9, "Arial", 400, 0, 0x0
BEGIN
PUSHBUTTON "Start Send",IDC_STARTSEND,589,270,50,19
PUSHBUTTON "Stop Send",IDC_STOPSend,639,270,50,19
PUSHBUTTON "Start Listen",IDC_STARTLISTEN,589,291,50,19
PUSHBUTTON "StopListen",IDC_STOPLISTEN,639,291,50,19
CONTROL "",IDC_LIVEVIDEO,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_SUNKEN,450,179,139,101
COMBOBOX IDC_DEVICE,487,14,185,30,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
CTEXT "Select Capture Device",IDC_STATIC,485,7,78,8
COMBOBOX IDC_CODEC_LIST,490,90,58,30,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
LTEXT "Codec",IDC_STATIC,490,82,21,8
COMBOBOX IDC_CODEC_SIZE,627,90,62,30,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
LTEXT "Codec Size",IDC_STATIC,611,82,36,8
CONTROL "",IDC_IPADDRESS1,"SysIPAddress32",WS_TABSTOP,490,46,90,13
EDITTEXT IDC_LOCAL_PORT1,615,46,31,14,ES_AUTOHSCROLL
LTEXT "IP-address",IDC_STATIC,498,37,36,8
LTEXT "Local Port",IDC_STATIC,616,36,32,8
LTEXT "Start Bitrate",IDC_STATIC,553,80,37,8
COMBOBOX IDC_BITRATE,558,90,49,30,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
EDITTEXT IDC_REMOTE_PORT1,582,46,31,14,ES_AUTOHSCROLL
LTEXT "Port",IDC_STATIC,584,37,14,8
GROUPBOX "Remote client 1",IDC_STATIC,487,27,203,50
LTEXT "Max FrameRate",IDC_STATIC,488,106,50,8
COMBOBOX IDC_MIN_FRAME_RATE,488,115,48,82,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
CONTROL "",IDC_CAPTURE,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_REALSIZEIMAGE,7,7,418,276
CONTROL "TMMBR",IDC_TMMBR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,486,138,40,10
GROUPBOX "Standard Protection",IDC_STATIC,607,138,72,55
CONTROL "None",IDC_PROT_NONE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,615,146,33,10
CONTROL "NACK",IDC_PROT_NACK,"Button",BS_AUTORADIOBUTTON,615,165,35,10
CONTROL "FEC",IDC_PROT_FEC,"Button",BS_AUTORADIOBUTTON,615,155,30,10
CONTROL "NACK & FEC",IDC_PROT_NACKFEC,"Button",BS_AUTORADIOBUTTON,615,174,52,10
COMBOBOX IDC_RTCPMODE,571,119,80,57,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
LTEXT "RTCP Mode",IDC_STATIC,571,110,39,8
LISTBOX IDC_INFORMATION,476,309,214,63,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_PACKETBURST,653,118,36,57,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
LTEXT "Packet Burst",IDC_STATIC,649,109,40,8
CONTROL "Stop Log",IDC_FREEZELOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,465,292,44,10
PUSHBUTTON "Version",IDC_VERSION,530,291,55,16
CONTROL "Ext",IDC_EXTTRANSPORT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,493,66,25,10
LTEXT "loss",IDC_STATIC,519,66,15,8
LTEXT "delay",IDC_STATIC,578,66,18,8
COMBOBOX IDC_PACKETLOSS,533,65,38,82,CBS_DROPDOWN | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_DELAY,598,65,38,82,CBS_DROPDOWN | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Record Incoming",IDC_BTN_RECORD_INCOMING,587,198,69,14
PUSHBUTTON "Record outgoing",IDC_BTN_RECORD_OUTGOING,587,212,69,14
PUSHBUTTON "Create Slave",IDC_BTN_CREATE_SLAVE,586,231,50,14
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_DXQUALITY_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 690
VERTGUIDE, 321
VERTGUIDE, 372
VERTGUIDE, 425
VERTGUIDE, 465
TOPMARGIN, 7
BOTTOMMARGIN, 372
END
END
#endif // APSTUDIO_INVOKED
#endif // Neutral (Sys. Default) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR)
#ifdef _WIN32
LANGUAGE 18, 1
#pragma code_page(949)
#endif //_WIN32
#include "res\Capture.rc2" // non-Microsoft Visual C++ edited resources
#include "l.kor\afxres.rc" // Standard components
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -1,93 +0,0 @@
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* 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.
*/
#include "CaptureDevicePool.h"
#include "map_wrapper.h"
#include <string.h>
#include <assert.h>
#include "critical_section_wrapper.h"
#include "vie_file.h"
CaptureDevicePool::CaptureDevicePool(VideoEngine* videoEngine):
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_vieCapture(ViECapture::GetInterface(videoEngine)),
_vieFile(ViEFile::GetInterface(videoEngine))
{
}
CaptureDevicePool::~CaptureDevicePool(void)
{
assert(_deviceMap.Size()==0);
_vieCapture->Release();
_vieFile->Release();
delete &_critSect;
}
WebRtc_Word32 CaptureDevicePool::GetCaptureDevice(int& captureId, const char* uniqeDeviceName)
{
CriticalSectionScoped cs(_critSect);
DeviceItem* device=NULL;
for(MapItem* item=_deviceMap.First();
item!=NULL;
item=_deviceMap.Next(item))
{
//Found the device?
if(strcmp(uniqeDeviceName,(static_cast<DeviceItem*>( item->GetItem()))->uniqeDeviceName)==0)
{
device=static_cast<DeviceItem*>( item->GetItem());
device->refCount++;
captureId=device->captureId;
return 0;
}
}
device = new DeviceItem;
strncpy(device->uniqeDeviceName,uniqeDeviceName,255);
// Device does not exist. Create it.
WebRtc_Word32 result=_vieCapture->AllocateCaptureDevice(device->uniqeDeviceName,strlen(device->uniqeDeviceName),device->captureId);
if(result==0)
{
result=_vieFile->SetCaptureDeviceImage(device->captureId,
"./main/test/WindowsTest/captureDeviceImage.jpg");
}
captureId=device->captureId;
_deviceMap.Insert(captureId,device);
device->refCount++;
return result;
}
WebRtc_Word32 CaptureDevicePool::ReturnCaptureDevice(int captureId)
{
CriticalSectionScoped cs(_critSect);
MapItem* mapItem=_deviceMap.Find(captureId);
if(!mapItem)
return -1;
DeviceItem* item=static_cast<DeviceItem*> (mapItem->GetItem());
if(!item)
return 0;
item->refCount--;
WebRtc_Word32 result=0;
if(item->refCount==0)
{
result=_vieCapture->ReleaseCaptureDevice(captureId);
_deviceMap.Erase(mapItem);
delete item;
}
return result;
}

View File

@ -1,49 +0,0 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* 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.
*/
#pragma once
#include "common_types.h"
#include "vie_base.h"
#include "vie_capture.h"
#include "vie_file.h"
#include "map_wrapper.h"
namespace webrtc {
class CriticalSectionWrapper;
}
using namespace webrtc;
class CaptureDevicePool
{
public:
CaptureDevicePool(VideoEngine* videoEngine);
~CaptureDevicePool(void);
WebRtc_Word32 GetCaptureDevice(int& captureId, const char uniqeDeviceName[256]);
WebRtc_Word32 ReturnCaptureDevice(int captureId);
private:
struct DeviceItem
{
int captureId;
WebRtc_Word32 refCount;
char uniqeDeviceName[256];
DeviceItem()
{
captureId=-1;
refCount=0;
}
};
CriticalSectionWrapper& _critSect;
ViECapture* _vieCapture;
ViEFile* _vieFile;
MapWrapper _deviceMap;
};

File diff suppressed because it is too large Load Diff

View File

@ -1,273 +0,0 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* 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_VIDEO_ENGINE_MAIN_TEST_WINDOWSTEST_CHANNELDLG_H_
#define WEBRTC_VIDEO_ENGINE_MAIN_TEST_WINDOWSTEST_CHANNELDLG_H_
#include "StdAfx.h"
//#define NO_VOICE_ENGINE
/////////////////////////////////////////////////////////////////////////////
// CDXChannelDlg dialog
// Include ViE headers
#include "common_types.h"
#include "vie_base.h"
#include "vie_capture.h"
#include "vie_codec.h"
#include "vie_network.h"
#include "vie_render.h"
#include "vie_rtp_rtcp.h"
#include "vie_errors.h"
#include "vie_file.h"
#include "tbExternalTransport.h"
#include "resource.h" // main symbols
#ifndef NO_VOICE_ENGINE
#include "voe_base.h"
#include "voe_errors.h"
#include "voe_base.h"
#include "voe_network.h"
#include "voe_codec.h"
#include "voe_rtp_rtcp.h"
#endif
using namespace webrtc;
class CDXChannelDlg;
class CaptureDevicePool;
class ChannelPool;
#define TEST_MUSTPASS(expr,oklasterror) \
{ \
if ((expr)) \
{ \
CString r_msg; \
int r_lastError=_vieBase->LastError(); \
CString exp; \
exp=#expr;\
r_msg.Format(_T("\nError at line:%i, %s \nError code: %i\n"),__LINE__, exp,r_lastError); \
if(r_lastError!=oklasterror) \
::MessageBox (NULL, (LPCTSTR)r_msg, TEXT("Error Message"), MB_OK | MB_ICONINFORMATION); \
} \
}
class CDXChannelDlgObserver
{
public:
virtual void ChannelDialogEnded(CDXChannelDlg* context)=0;
protected:
virtual ~CDXChannelDlgObserver(){};
};
class CDXChannelDlg : public CDialog , public ViEEncoderObserver, public ViEDecoderObserver, public ViEBaseObserver, public ViECaptureObserver
{
// Construction
public:
CDXChannelDlg(VideoEngine* videoEngine,
CaptureDevicePool& captureDevicePool,
ChannelPool& channelPool,
void* voiceEngine=NULL
,CWnd* pParent = NULL,CDXChannelDlgObserver* observer=NULL,int parentChannel=-1); // standard constructor
// Dialog Data
//{{AFX_DATA(CDXChannelDlg)
enum { IDD = IDD_DXQUALITY_DIALOG };
CComboBox m_ctrlDevice;
CComboBox m_ctrlCodec;
CComboBox m_ctrlBitrate;
CComboBox m_ctrlCodecSize;
CComboBox m_ctrlRtcpMode;
CComboBox m_ctrlPacketBurst;
CComboBox m_ctrlMinFrameRate;
CListBox m_ctrlInfo;
CStatic m_ctrlLiveRemoteVideo;
CStatic m_ctrlLiveVideo;
CEdit m_localPort1;
CEdit m_remotePort1;
CIPAddressCtrl m_remoteIp1;
CButton m_cbTmmbr;
CButton m_cbExternalTransport;
CButton m_cbFreezeLog;
CButton m_cbDefaultSendChannel;
CComboBox m_ctrlPacketLoss;
CComboBox m_ctrlDelay;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDXChannelDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
public :
// Callback
//Capture observer
virtual void BrightnessAlarm(const int captureId,
const Brightness brightness);
virtual void CapturedFrameRate(const int captureId,
const unsigned char frameRate);
virtual void NoPictureAlarm(const int captureId,
const CaptureAlarm alarm);
// same callback method is being used to raise also to clear.
// true - raise, false - clear
// virtual void NoPictureAlarm(bool active = true);
// Encoder observer
virtual void OutgoingRate(const int videoChannel,
const unsigned int framerate,
const unsigned int bitrate) ;
//Decoder observer
virtual void IncomingCodecChanged(const int videoChannel,
const VideoCodec& videoCodec);
virtual void IncomingRate(const int videoChannel,
const unsigned int framerate,
const unsigned int bitrate);
virtual void RequestNewKeyFrame(const int videoChannel);
// Base observer
virtual void PerformanceAlarm(const unsigned int cpuLoad);
//virtual void IncomingCSRCChanged(int channel, unsigned int csrc, bool added);
// Implementation
protected:
HICON m_hIcon;
int _channelId;
int _parentChannel;
int _audioChannel;
bool _canAddLog;
// Thread and function for callbacks
CRITICAL_SECTION _critCallback;
HANDLE _callbackThread;
HANDLE _callbackEvent;
char _logMsg[512];
static unsigned int WINAPI CallbackThread(LPVOID lpParameter);
void CallbackThreadProcess();
//void GetSize(int sizeSel, int &width, int &height);
virtual void ConfigureRender();
virtual void SetCaptureDevice();
virtual void SetLocalReceiver();
virtual void SetSendDestination();
virtual void SetSendCodec();
void AddToInfo(const char* msg);
// afx_msg void Command(UINT nID, LPARAM lParam);
// Generated message map functions
//{{AFX_MSG(CDXChannelDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnRButtonUp( UINT nFlags, CPoint point);
afx_msg BOOL OnDeviceChange( UINT, DWORD );
afx_msg void OnPaint();
//afx_msg LRESULT OnDisplayChange(WPARAM, LPARAM);
afx_msg HCURSOR OnQueryDragIcon();
virtual afx_msg void OnStartSend();
virtual afx_msg void OnDestroy();
virtual afx_msg void OnStopSend();
virtual afx_msg void OnCancel();
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
CDXChannelDlgObserver* _dialogObserver;
VideoEngine* _videoEngine;
ViEBase* _vieBase;
ViECapture* _vieCapture;
ViERTP_RTCP* _vieRTPRTCP;
ViERender* _vieRender;
ViECodec* _vieCodec;
ViENetwork* _vieNetwork;
ViEFile* _vieFile;
TbExternalTransport* _externalTransport;
char _fileName[256];
#ifndef NO_VOICE_ENGINE
VoiceEngine* _voiceEngine;
VoEBase* _veBase;
VoENetwork* _veNetwork;
VoECodec* _veCodec;
VoERTP_RTCP* _veRTCP;
#else
void* _voiceEngine;
#endif
VideoCodec _sendCodec;
int _captureId;
CaptureDevicePool& _captureDevicePool;
ChannelPool& _channelPool;
afx_msg void OnCbnSelchangeCodecList();
afx_msg void OnCbnSelchangeDevice();
afx_msg void OnCbnSelchangeSize();
afx_msg void OnCbnSelchangeBitrate();
afx_msg void OnCbnSelchangeWindowSize();
afx_msg void OnBnClickedversion();
afx_msg void OnCbnSelchangeMinFrameRate();
afx_msg void OnBnClickedStartlisten();
afx_msg void OnBnClickedStoplisten();
afx_msg void OnBnClickedStopsend();
afx_msg void OnBnClickedTmmbr();
afx_msg void OnCbnSelchangeRtcpmode();
afx_msg void OnBnClickedProtNack();
afx_msg void OnBnClickedProtNone();
afx_msg void OnBnClickedProtFec();
afx_msg void OnBnClickedProtNackFec();
afx_msg void OnBnClickedFreezelog();
public:
afx_msg void OnBnClickedExttransport();
afx_msg void OnCbnSelchangePacketloss();
afx_msg void OnCbnSelchangeDelay();
afx_msg void OnBnClickedBtnRecordIncoming();
afx_msg void OnBnClickedBtnRecordOutgoing();
afx_msg void OnBnClickedBtnCreateSlave();
afx_msg void OnBnClickedVersion();
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // WEBRTC_VIDEO_ENGINE_MAIN_TEST_WINDOWSTEST_CHANNELDLG_H_

View File

@ -1,40 +0,0 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* 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.
*/
#include "ChannelPool.h"
#include "map_wrapper.h"
#include <string.h>
#include <assert.h>
#include "critical_section_wrapper.h"
ChannelPool::ChannelPool():
_critSect(*webrtc::CriticalSectionWrapper::CreateCriticalSection())
{
}
ChannelPool::~ChannelPool(void)
{
assert(_channelMap.Size()==0);
delete &_critSect;
}
WebRtc_Word32 ChannelPool::AddChannel(int channel)
{
return _channelMap.Insert(channel,(void*) channel);
}
WebRtc_Word32 ChannelPool::RemoveChannel(int channel)
{
return _channelMap.Erase(channel);
}
webrtc::MapWrapper& ChannelPool::ChannelMap()
{
return _channelMap;
}

View File

@ -1,36 +0,0 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* 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.
*/
#pragma once
#include "StdAfx.h"
#include "common_types.h"
#include "vie_base.h"
#include "map_wrapper.h"
namespace webrtc {
class CriticalSectionWrapper;
}
class ChannelPool
{
public:
ChannelPool();
~ChannelPool(void);
WebRtc_Word32 AddChannel(int channel);
WebRtc_Word32 RemoveChannel(int channel);
webrtc::MapWrapper& ChannelMap();
private:
webrtc::CriticalSectionWrapper& _critSect;
webrtc::MapWrapper _channelMap;
};

View File

@ -1,37 +0,0 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* 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.
*/
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#ifndef WEBRTC_VIDEO_ENGINE_MAIN_TEST_WINDOWSTEST_STDAFX_H_
#define WEBRTC_VIDEO_ENGINE_MAIN_TEST_WINDOWSTEST_STDAFX_H_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // WEBRTC_VIDEO_ENGINE_MAIN_TEST_WINDOWSTEST_STDAFX_H_

View File

@ -1,53 +0,0 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* 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_VIDEO_ENGINE_MAIN_TEST_WINDOWSTEST_VIDEOSIZE_H_
#define WEBRTC_VIDEO_ENGINE_MAIN_TEST_WINDOWSTEST_VIDEOSIZE_H_
#include "StdAfx.h"
enum VideoSize
{
UNDEFINED,
SQCIF, // 128*96 = 12 288
QQVGA, // 160*120 = 19 200
QCIF, // 176*144 = 25 344
CGA, // 320*200 = 64 000
QVGA, // 320*240 = 76 800
SIF, // 352*240 = 84 480
WQVGA, // 400*240 = 96 000
CIF, // 352*288 = 101 376
W288P, // 512*288 = 147 456 (WCIF)
W368P, // 640*368 = 235 520
S_448P, // 576*448 = 281 088
VGA, // 640*480 = 307 200
S_432P, // 720*432 = 311 040
W432P, // 768*432 = 331 776 (a.k.a WVGA 16:9)
S_4SIF, // 704*480 = 337 920
W448P, // 768*448 = 344 064
NTSC, // 720*480 = 345 600
FW448P, // 800*448 = 358 400
S_768x480P, // 768*480 = 368 640 (a.k.a WVGA 16:10)
WVGA, // 800*480 = 384 000
S_4CIF, // 704576 = 405 504
SVGA, // 800*600 = 480 000
W544P, // 960*544 = 522 240
W576P, // 1024*576 = 589 824 (W4CIF)
HD, // 960*720 = 691 200
XGA, // 1024*768 = 786 432
WHD, // 1280*720 = 921 600
FULL_HD, // 1440*1080 = 1 555 200
UXGA, // 1600*1200 = 1 920 000
WFULL_HD, // 1920*1080 = 2 073 600
NUMBER_OF_VIDEO_SIZE
};
int GetWidthHeight(VideoSize size, int& width, int& height);
#endif // WEBRTC_VIDEO_ENGINE_MAIN_TEST_WINDOWSTEST_VIDEOSIZE_H_

View File

@ -1,114 +0,0 @@
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* 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.
*/
#include "WindowsTest.h"
#include "ChannelDlg.h"
#include "WindowsTestMainDlg.h"
#include "engine_configurations.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// Check memory leaks id running debug
#if (defined(_DEBUG) && defined(_WIN32))
// #include "vld.h"
#endif
/////////////////////////////////////////////////////////////////////////////
// CDXWindowsTestApp
BEGIN_MESSAGE_MAP(CDXWindowsTestApp, CWinApp)
//{{AFX_MSG_MAP(CDXWindowsTestApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDXWindowsTestApp construction
CDXWindowsTestApp::CDXWindowsTestApp()
{
}
/////////////////////////////////////////////////////////////////////////////
// The one and only object
CDXWindowsTestApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CDXWindowsTestApp initialization
BOOL CDXWindowsTestApp::InitInstance()
{
int result=0;
#ifndef NO_VOICE_ENGINE
_voiceEngine = VoiceEngine::Create();
_veBase = VoEBase::GetInterface(_voiceEngine);
result+=_veBase->Init();
#else
_voiceEngine=NULL;
#endif
_videoEngine = VideoEngine::Create();
_videoEngine->SetTraceFilter(webrtc::kTraceDefault);//webrtc::kTraceDebug | webrtc::kTraceError | webrtc::kTraceApiCall | webrtc::kTraceWarning | webrtc::kTraceCritical | webrtc::kTraceStateInfo | webrtc::kTraceInfo | webrtc::kTraceStream);
_videoEngine->SetTraceFile("trace.txt");
ViEBase* vieBase=ViEBase::GetInterface(_videoEngine);
result+=vieBase->Init();
if(result!=0)
{
::MessageBox (NULL, (LPCTSTR)("failed to init VideoEngine"), TEXT("Error Message"), MB_OK | MB_ICONINFORMATION);
}
{
WindowsTestMainDlg dlg(_videoEngine,_voiceEngine);
m_pMainWnd = &dlg;
dlg.DoModal();
}
vieBase->Release();
if(!VideoEngine::Delete(_videoEngine))
{
char errorMsg[255];
sprintf(errorMsg,"All VideoEngine interfaces are not released properly!");
::MessageBox (NULL, (LPCTSTR)errorMsg, TEXT("Error Message"), MB_OK | MB_ICONINFORMATION);
}
#ifndef NO_VOICE_ENGINE
_veBase->Terminate();
if(_veBase->Release()!=0)
{
// ensure that no interface is still referenced
char errorMsg[256];
sprintf(errorMsg,"All VoiceEngine interfaces are not released properly!");
::MessageBox (NULL, (LPCTSTR)errorMsg, TEXT("Error Message"), MB_OK | MB_ICONINFORMATION);
}
if (false == VoiceEngine::Delete(_voiceEngine))
{
char errorMsg[256];
sprintf(errorMsg,"VoiceEngine::Delete() failed!");
::MessageBox (NULL, (LPCTSTR)errorMsg, TEXT("Error Message"), MB_OK | MB_ICONINFORMATION);
}
#endif
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}

View File

@ -1,61 +0,0 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* 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_VIDEO_ENGINE_MAIN_TEST_WINDOWSTEST_WINDOWSTEST_H_
#define WEBRTC_VIDEO_ENGINE_MAIN_TEST_WINDOWSTEST_WINDOWSTEST_H_
#include "StdAfx.h"
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
//Forward declarations
namespace webrtc {
class VoiceEngine;
class VoEBase;
class VideoEngine;
}
using namespace webrtc;
class CDXWindowsTestApp : public CWinApp
{
public:
CDXWindowsTestApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDXWindowsTestApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CDXWindowsTestApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
VideoEngine* _videoEngine;
VoiceEngine* _voiceEngine;
VoEBase* _veBase;
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // WEBRTC_VIDEO_ENGINE_MAIN_TEST_WINDOWSTEST_WINDOWSTEST_H_

View File

@ -1,142 +0,0 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* 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.
*/
// WindowsTestMainDlg.cpp : implementation file
//
#include "WindowsTestMainDlg.h"
#include "WindowsTest.h"
#include "ChannelDlg.h"
#include "voe_base.h"
// WindowsTestMainDlg dialog
IMPLEMENT_DYNAMIC(WindowsTestMainDlg, CDialog)
WindowsTestMainDlg::WindowsTestMainDlg(VideoEngine* videoEngine,void* voiceEngine,CWnd* pParent /*=NULL*/)
: CDialog(WindowsTestMainDlg::IDD, pParent),
_videoEngine(videoEngine),
_voiceEngine((VoiceEngine*) voiceEngine),
_testDlg1(NULL),
_testDlg2(NULL),
_testDlg3(NULL),
_testDlg4(NULL),
_externalInWidth(0),
_externalInHeight(0),
_externalInVideoType(0),
_captureDevicePool(videoEngine)
{
}
WindowsTestMainDlg::~WindowsTestMainDlg()
{
}
void WindowsTestMainDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(WindowsTestMainDlg, CDialog)
ON_BN_CLICKED(IDC_CHANNEL1, &WindowsTestMainDlg::OnBnClickedChannel1)
ON_BN_CLICKED(IDC_CHANNEL2, &WindowsTestMainDlg::OnBnClickedChannel2)
ON_BN_CLICKED(IDC_CHANNEL3, &WindowsTestMainDlg::OnBnClickedChannel3)
ON_BN_CLICKED(IDC_CHANNEL4, &WindowsTestMainDlg::OnBnClickedChannel4)
END_MESSAGE_MAP()
void WindowsTestMainDlg::OnBnClickedChannel1()
{
if(!_testDlg1)
{
_testDlg1=new CDXChannelDlg(_videoEngine,_captureDevicePool,_channelPool,_voiceEngine,NULL,this);
_testDlg1->Create(CDXChannelDlg::IDD,this);
}
else
{
_testDlg1->SetActiveWindow();
}
}
void WindowsTestMainDlg::OnBnClickedChannel2()
{
if(!_testDlg2)
{
_testDlg2=new CDXChannelDlg(_videoEngine,_captureDevicePool,_channelPool,_voiceEngine,NULL,this);
_testDlg2->Create(CDXChannelDlg::IDD,this);
}
else
{
_testDlg2->SetActiveWindow();
}
}
void WindowsTestMainDlg::ChannelDialogEnded(CDXChannelDlg* context)
{
if(context==_testDlg4)
{
delete _testDlg4;
_testDlg4=NULL;
}
else if(context==_testDlg3)
{
delete _testDlg3;
_testDlg3=NULL;
}
else if(context==_testDlg2)
{
delete _testDlg2;
_testDlg2=NULL;
}
else if(context==_testDlg1)
{
delete _testDlg1;
_testDlg1=NULL;
}
else // Slave channel
{
delete context;
}
}
void WindowsTestMainDlg::OnBnClickedChannel3()
{
if(!_testDlg3)
{
_testDlg3=new CDXChannelDlg(_videoEngine,_captureDevicePool,_channelPool,_voiceEngine,NULL,this);
_testDlg3->Create(CDXChannelDlg::IDD,this);
}
else
{
_testDlg3->SetActiveWindow();
}
}
void WindowsTestMainDlg::OnBnClickedChannel4()
{
if(!_testDlg4)
{
_testDlg4=new CDXChannelDlg(_videoEngine,_captureDevicePool,_channelPool,_voiceEngine,NULL,this);
_testDlg4->Create(CDXChannelDlg::IDD,this);
}
else
{
_testDlg4->SetActiveWindow();
}
}

View File

@ -1,72 +0,0 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* 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.
*/
#pragma once
#include "StdAfx.h"
#include "WindowsTestResource.h"
#include "ChannelDlg.h"
#include "CaptureDevicePool.h"
#include "ChannelPool.h"
//Forward declarations
namespace webrtc {
class VideoEngine;
class VoiceEngine;
}
using namespace webrtc;
class CDXCaptureDlg;
class WindowsTestMainDlg : public CDialog, private CDXChannelDlgObserver
{
DECLARE_DYNAMIC(WindowsTestMainDlg)
public:
WindowsTestMainDlg(VideoEngine* videoEngine,void* voiceEngine=NULL,CWnd* pParent = NULL); // standard constructor
virtual ~WindowsTestMainDlg();
// Dialog Data
enum { IDD = IDD_WINDOWSTEST_MAIN };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedChannel1();
afx_msg void OnBnClickedChannel2();
afx_msg void OnBnClickedChannel3();
afx_msg void OnBnClickedChannel4();
VideoEngine* _videoEngine;
VoiceEngine* _voiceEngine;
VoEBase* _veBase;
CDXChannelDlg* _testDlg1;
CDXChannelDlg* _testDlg2;
CDXChannelDlg* _testDlg3;
CDXChannelDlg* _testDlg4;
int _externalInWidth;
int _externalInHeight;
int _externalInVideoType;
CaptureDevicePool _captureDevicePool;
ChannelPool _channelPool;
private:
virtual void ChannelDialogEnded(CDXChannelDlg* context);
public:
};

View File

@ -1,101 +0,0 @@
// Microsoft Visual C++ generated resource script.
//
#include "WindowsTestResource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Swedish resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE)
#ifdef _WIN32
LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"WindowsTestResource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_WINDOWSTEST_MAIN DIALOGEX 0, 0, 186, 156
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Windows ViE Test"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,129,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14
PUSHBUTTON "Channel 1",IDC_CHANNEL1,129,45,50,14
PUSHBUTTON "Channel 2",IDC_CHANNEL2,129,62,50,14
PUSHBUTTON "Channel 3",IDC_CHANNEL3,129,79,50,14
PUSHBUTTON "Channel 4",IDC_CHANNEL4,129,96,50,14
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_WINDOWSTEST_MAIN, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 7
BOTTOMMARGIN, 149
END
END
#endif // APSTUDIO_INVOKED
#endif // Swedish resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -1,28 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by WindowsTestResouce.rc
//
#define IDD_WINDOWSTEST_MAIN 101
#define IDC_CHANNEL1 1001
#define IDC_CHANNEL2 1002
#define IDC_CHANNEL3 1004
#define IDC_CHANNEL4 1005
#define IDC_POSITION 1009
#define IDC_INFORMATION 1050
#define IDC_CHECK_CHANNEL1 1070
#define IDC_CHECK_CHANNEL2 1071
#define IDC_CHECK_CHANNEL3 1072
#define IDC_CHECK_CHANNEL4 1073
#define IDC_COMBO1 1074
#define IDC_BTN_CREATE2 1076
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 106
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1076
#define _APS_NEXT_SYMED_VALUE 107
#endif
#endif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

View File

@ -1,13 +0,0 @@
//
// DXCAPTURE.RC2 - resources Microsoft Visual C++ does not edit directly
//
#ifdef APSTUDIO_INVOKED
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
/////////////////////////////////////////////////////////////////////////////

View File

@ -1,58 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by Capture.rc
//
#define IDM_ABOUTBOX 0x0010
#define IDD_DXQUALITY_DIALOG 102
#define IDI_ICON1 130
#define IDD_SLAVE_CHANNEL 132
#define IDC_LIVEVIDEO 1000
#define IDC_CAPTURE 1001
#define IDC_DEVICE 1003
#define IDC_STARTSEND 1004
#define IDC_STARTLISTEN 1006
#define IDC_STOPLISTEN 1007
#define IDC_STOPSend 1008
#define IDC_CODEC_LIST 1010
#define IDC_CODEC_SIZE 1011
#define IDC_IPADDRESS1 1012
#define IDC_LOCAL_PORT1 1013
#define IDC_CHANGE_SIZE 1017
#define IDC_QUALITY 1018
#define IDC_BITRATE 1019
#define IDC_WINDOW_SIZE 1022
#define IDC_REMOTE_PORT1 1025
#define IDC_START_REC 1030
#define IDC_STOP_REC 1031
#define IDC_CAM_PROPERTY 1033
#define IDC_ONMODE 1034
#define IDC_CAPTURECAP 1038
#define IDC_RADIO1 1039
#define IDC_MIN_FRAME_RATE 1040
#define IDC_RTCPMODE 1042
#define IDC_TMMBR 1043
#define IDC_PACKETBURST 1044
#define IDC_PROT_NONE 1045
#define IDC_PROT_NACK 1046
#define IDC_PROT_FEC 1047
#define IDC_PROT_NACKFEC 1048
#define IDC_INFORMATION 1050
#define IDC_PACKETLOSS 1051
#define IDC_FREEZELOG 1052
#define IDC_VERSION 1053
#define IDC_EXTTRANSPORT 1054
#define IDC_DELAY 1055
#define IDC_BTN_RECORD_INCOMING 1056
#define IDC_BTN_RECORD_OUTGOING 1057
#define IDC_BTN_CREATE_SLAVE 1058
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 133
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1059
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@ -1,313 +0,0 @@
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* 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.
*/
//
// tbExternalTransport.cpp
//
#include "tbExternalTransport.h"
#include "critical_section_wrapper.h"
#include "event_wrapper.h"
#include "thread_wrapper.h"
#include "tick_util.h"
#include "vie_network.h"
#include "tick_util.h"
using namespace webrtc;
TbExternalTransport::TbExternalTransport(ViENetwork& vieNetwork)
:
_vieNetwork(vieNetwork),
_thread(*ThreadWrapper::CreateThread(ViEExternalTransportRun, this, kHighPriority, "AutotestTransport")),
_event(*EventWrapper::Create()),
_crit(*CriticalSectionWrapper::CreateCriticalSection()),
_statCrit(*CriticalSectionWrapper::CreateCriticalSection()),
_lossRate(0),
_networkDelayMs(0),
_rtpCount(0),
_dropCount(0),
_rtcpCount(0),
_rtpPackets(),
_rtcpPackets(),
_checkSSRC(false),
_lastSSRC(0),
_checkSequenceNumber(0),
_firstSequenceNumber(0),
_lastSeq(0)
{
srand((int)TickTime::MicrosecondTimestamp());
unsigned int tId = 0;
_thread.Start(tId);
}
TbExternalTransport::~TbExternalTransport()
{
// TODO: stop thread
_thread.SetNotAlive();
_event.Set();
if (_thread.Stop())
{
delete &_thread;
delete &_event;
}
delete &_crit;
delete &_statCrit;
}
int TbExternalTransport::SendPacket(int channel, const void *data, int len)
{
_statCrit.Enter();
_rtpCount++;
_statCrit.Leave();
unsigned short sequenceNumber = (((unsigned char*) data)[2]) << 8;
sequenceNumber += (((unsigned char*) data)[3]);
// Packet loss
int dropThis = rand() % 100;
bool nacked=false;
if(sequenceNumber<_lastSeq)
{
nacked=true;
}
else
{
_lastSeq=sequenceNumber;
}
if (dropThis < _lossRate)
{
_statCrit.Enter();
_dropCount++;
_statCrit.Leave();
/* char str[256];
sprintf(str,"Dropping seq %d length %d m %d, ts %u\n", sequenceNumber,len,marker,timestamp) ;
OutputDebugString(str);*/
return len;
}
else
{
if(nacked)
{
/*char str[256];
sprintf(str,"Resending seq %d length %d m %d, ts %u\n", sequenceNumber,len,marker,timestamp) ;
OutputDebugString(str);*/
}
else
{
/*char str[256];
sprintf(str,"Sending seq %d length %d m %d, ts %u\n", sequenceNumber,len,marker,timestamp) ;
OutputDebugString(str);*/
}
}
VideoPacket* newPacket = new VideoPacket();
memcpy(newPacket->packetBuffer, data, len);
newPacket->length = len;
newPacket->channel = channel;
_crit.Enter();
newPacket->receiveTime = NowMs() + _networkDelayMs;
_rtpPackets.push(newPacket);
_event.Set();
_crit.Leave();
return len;
}
int TbExternalTransport::SendRTCPPacket(int channel, const void *data, int len)
{
_statCrit.Enter();
_rtcpCount++;
_statCrit.Leave();
VideoPacket* newPacket = new VideoPacket();
memcpy(newPacket->packetBuffer, data, len);
newPacket->length = len;
newPacket->channel = channel;
_crit.Enter();
newPacket->receiveTime = NowMs() + _networkDelayMs;
_rtcpPackets.push(newPacket);
_event.Set();
_crit.Leave();
return len;
}
WebRtc_Word32 TbExternalTransport::SetPacketLoss(WebRtc_Word32 lossRate)
{
CriticalSectionScoped cs(_statCrit);
_lossRate = lossRate;
return 0;
}
void TbExternalTransport::SetNetworkDelay(WebRtc_Word64 delayMs)
{
CriticalSectionScoped cs(_crit);
_networkDelayMs = delayMs;
return;
}
void TbExternalTransport::ClearStats()
{
CriticalSectionScoped cs(_statCrit);
_rtpCount = 0;
_dropCount = 0;
_rtcpCount = 0;
return;
}
void TbExternalTransport::GetStats(WebRtc_Word32& numRtpPackets, WebRtc_Word32& numDroppedPackets, WebRtc_Word32& numRtcpPackets)
{
CriticalSectionScoped cs(_statCrit);
numRtpPackets = _rtpCount;
numDroppedPackets = _dropCount;
numRtcpPackets = _rtcpCount;
return;
}
void TbExternalTransport::EnableSSRCCheck()
{
CriticalSectionScoped cs(_statCrit);
_checkSSRC = true;
}
unsigned int TbExternalTransport::ReceivedSSRC()
{
CriticalSectionScoped cs(_statCrit);
return _lastSSRC;
}
void TbExternalTransport::EnableSequenceNumberCheck()
{
CriticalSectionScoped cs(_statCrit);
_checkSequenceNumber = true;
}
unsigned short TbExternalTransport::GetFirstSequenceNumber()
{
CriticalSectionScoped cs(_statCrit);
return _firstSequenceNumber;
}
bool TbExternalTransport::ViEExternalTransportRun(void* object)
{
return static_cast<TbExternalTransport*>(object)->ViEExternalTransportProcess();
}
bool TbExternalTransport::ViEExternalTransportProcess()
{
unsigned int waitTime = KMaxWaitTimeMs;
VideoPacket* packet = NULL;
while (!_rtpPackets.empty())
{
// Take first packet in queue
_crit.Enter();
packet = _rtpPackets.front();
WebRtc_Word64 timeToReceive = packet->receiveTime - NowMs();
if (timeToReceive > 0)
{
// No packets to receive yet
if (timeToReceive < waitTime &&
timeToReceive > 0)
{
waitTime = (unsigned int) timeToReceive;
}
_crit.Leave();
break;
}
_rtpPackets.pop();
_crit.Leave();
// Send to ViE
if (packet)
{
{
CriticalSectionScoped cs(_statCrit);
if (_checkSSRC)
{
_lastSSRC = ((packet->packetBuffer[8]) << 24);
_lastSSRC += (packet->packetBuffer[9] << 16);
_lastSSRC += (packet->packetBuffer[10] << 8);
_lastSSRC += packet->packetBuffer[11];
_checkSSRC = false;
}
if (_checkSequenceNumber)
{
_firstSequenceNumber = (unsigned char)packet->packetBuffer[2] << 8;
_firstSequenceNumber += (unsigned char)packet->packetBuffer[3];
_checkSequenceNumber = false;
}
}
/*
unsigned short sequenceNumber = (unsigned char)packet->packetBuffer[2] << 8;
sequenceNumber += (unsigned char)packet->packetBuffer[3];
int marker=packet->packetBuffer[1] & 0x80;
unsigned int timestamp=((((unsigned char*)packet->packetBuffer)[4]) << 24) + ((((unsigned char*)packet->packetBuffer)[5])<<16) +((((unsigned char*)packet->packetBuffer)[6])<<8)+(((unsigned char*)packet->packetBuffer)[7]);
char str[256];
sprintf(str,"Receiving seq %u length %d m %d, ts %u\n", sequenceNumber,packet->length,marker,timestamp) ;
OutputDebugString(str);*/
_vieNetwork.ReceivedRTPPacket(packet->channel, packet->packetBuffer, packet->length);
delete packet;
packet = NULL;
}
}
while (!_rtcpPackets.empty())
{
// Take first packet in queue
_crit.Enter();
packet = _rtcpPackets.front();
WebRtc_Word64 timeToReceive = packet->receiveTime - NowMs();
if (timeToReceive > 0)
{
// No packets to receive yet
if (timeToReceive < waitTime &&
timeToReceive > 0)
{
waitTime = (unsigned int) timeToReceive;
}
_crit.Leave();
break;
}
packet = _rtcpPackets.front();
_rtcpPackets.pop();
_crit.Leave();
// Send to ViE
if (packet)
{
_vieNetwork.ReceivedRTCPPacket(packet->channel, packet->packetBuffer, packet->length);
delete packet;
packet = NULL;
}
}
_event.Wait(waitTime + 1); // Add 1 ms to not call to early...
return true;
}
WebRtc_Word64 TbExternalTransport::NowMs()
{
return TickTime::MillisecondTimestamp();
}

View File

@ -1,106 +0,0 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* 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.
*/
//
// tbExternalTransport.h
//
#ifndef WEBRTC_VIDEO_ENGINE_MAIN_TEST_WINDOWSTEST_TBEXTERNALTRANSPORT_H_
#define WEBRTC_VIDEO_ENGINE_MAIN_TEST_WINDOWSTEST_TBEXTERNALTRANSPORT_H_
#include "common_types.h"
#include <queue>
namespace webrtc
{
class CriticalSectionWrapper;
class EventWrapper;
class ThreadWrapper;
class ViENetwork;
}
class TbExternalTransport : public webrtc::Transport
{
public:
TbExternalTransport(webrtc::ViENetwork& vieNetwork);
~TbExternalTransport(void);
virtual int SendPacket(int channel, const void *data, int len);
virtual int SendRTCPPacket(int channel, const void *data, int len);
WebRtc_Word32 SetPacketLoss(WebRtc_Word32 lossRate); // Rate in %
void SetNetworkDelay(WebRtc_Word64 delayMs);
void ClearStats();
void GetStats(WebRtc_Word32& numRtpPackets, WebRtc_Word32& numDroppedPackets, WebRtc_Word32& numRtcpPackets);
void EnableSSRCCheck();
unsigned int ReceivedSSRC();
void EnableSequenceNumberCheck();
unsigned short GetFirstSequenceNumber();
protected:
static bool ViEExternalTransportRun(void* object);
bool ViEExternalTransportProcess();
private:
WebRtc_Word64 NowMs();
enum { KMaxPacketSize = 1650};
enum { KMaxWaitTimeMs = 100};
typedef struct
{
WebRtc_Word8 packetBuffer[KMaxPacketSize];
WebRtc_Word32 length;
WebRtc_Word32 channel;
WebRtc_Word64 receiveTime;
} VideoPacket;
typedef std::queue<VideoPacket*> VideoPacketQueue;
webrtc::ViENetwork& _vieNetwork;
webrtc::ThreadWrapper& _thread;
webrtc::EventWrapper& _event;
webrtc::CriticalSectionWrapper& _crit;
webrtc::CriticalSectionWrapper& _statCrit;
WebRtc_Word32 _lossRate;
WebRtc_Word64 _networkDelayMs;
WebRtc_Word32 _rtpCount;
WebRtc_Word32 _rtcpCount;
WebRtc_Word32 _dropCount;
VideoPacketQueue _rtpPackets;
VideoPacketQueue _rtcpPackets;
bool _checkSSRC;
WebRtc_UWord32 _lastSSRC;
bool _checkSequenceNumber;
WebRtc_UWord16 _firstSequenceNumber;
WebRtc_Word32 _lastSeq;
//int& numberOfErrors;
//int _bits;
//int _lastTicks;
//int _dropCnt;
//int _sentCount;
//int _frameCount;
//int _packetLoss;
//VideoEngine* _video;
//ReceiveBufferQueue _videoBufferQueue;
//ReceiveBufferQueue _rtcpBufferQueue;
};
#endif // WEBRTC_VIDEO_ENGINE_MAIN_TEST_WINDOWSTEST_TBEXTERNALTRANSPORT_H_

View File

@ -1,140 +0,0 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* 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.
*/
#include "VideoSize.h"
int GetWidthHeight( VideoSize size, int& width, int& height)
{
switch(size)
{
case SQCIF:
width = 128;
height = 96;
return 0;
case QQVGA:
width = 160;
height = 120;
return 0;
case QCIF:
width = 176;
height = 144;
return 0;
case CGA:
width = 320;
height = 200;
return 0;
case QVGA:
width = 320;
height = 240;
return 0;
case SIF:
width = 352;
height = 240;
return 0;
case WQVGA:
width = 400;
height = 240;
return 0;
case CIF:
width = 352;
height = 288;
return 0;
case W288P:
width = 512;
height = 288;
return 0;
case W368P:
width = 640;
height = 368;
return 0;
case S_448P:
width = 576;
height = 448;
return 0;
case VGA:
width = 640;
height = 480;
return 0;
case S_432P:
width = 720;
height = 432;
return 0;
case W432P:
width = 768;
height = 432;
return 0;
case S_4SIF:
width = 704;
height = 480;
return 0;
case W448P:
width = 768;
height = 448;
return 0;
case NTSC:
width = 720;
height = 480;
return 0;
case FW448P:
width = 800;
height = 448;
return 0;
case S_768x480P:
width = 768;
height = 480;
return 0;
case WVGA:
width = 800;
height = 480;
return 0;
case S_4CIF:
width = 704;
height = 576;
return 0;
case SVGA:
width = 800;
height = 600;
return 0;
case W544P:
width = 960;
height = 544;
return 0;
case W576P:
width = 1024;
height = 576;
return 0;
case HD:
width = 960;
height = 720;
return 0;
case XGA:
width = 1024;
height = 768;
return 0;
case FULL_HD:
width = 1440;
height = 1080;
return 0;
case WHD:
width = 1280;
height = 720;
return 0;
case UXGA:
width = 1600;
height = 1200;
return 0;
case WFULL_HD:
width = 1920;
height = 1080;
return 0;
default:
return -1;
}
return -1;
}

View File

@ -1,86 +0,0 @@
# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
#
# 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.
{
'conditions': [
# TODO(kjellander): Support UseoFMFC on VS2010.
# http://code.google.com/p/webrtc/issues/detail?id=709
['OS=="win" and MSVS_VERSION < "2010"', {
'targets': [
# WinTest - GUI test for Windows
{
'target_name': 'vie_win_test',
'type': 'executable',
'dependencies': [
'<(webrtc_root)/modules/modules.gyp:video_render_module',
'<(webrtc_root)/modules/modules.gyp:video_capture_module',
'<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
## VoiceEngine
'<(webrtc_root)/voice_engine/voice_engine.gyp:voice_engine_core',
## VideoEngine
'video_engine_core',
],
'include_dirs': [
'./interface',
'../../../../', # common_types.h and typedefs.h
'../commonTestClasses/'
],
'sources': [
'Capture.rc',
'captureDeviceImage.jpg',
'ChannelDlg.cc',
'ChannelDlg.h',
'ChannelPool.cc',
'ChannelPool.h',
'renderStartImage.jpg',
'renderTimeoutImage.jpg',
'res\Capture.rc2',
'resource.h',
'StdAfx.h',
'videosize.cc',
'VideoSize.h',
'WindowsTest.cc',
'WindowsTest.h',
'WindowsTestMainDlg.cc',
'WindowsTestMainDlg.h',
'WindowsTestResouce.rc',
'WindowsTestResource.h',
'tbExternalTransport.cc',
'CaptureDevicePool.cc',
'tbExternalTransport.h',
'CaptureDevicePool.h',
],
'configurations': {
'Common_Base': {
'msvs_configuration_attributes': {
'conditions': [
['component=="shared_library"', {
'UseOfMFC': '2', # Shared DLL
},{
'UseOfMFC': '1', # Static
}],
],
},
},
},
'msvs_settings': {
'VCLinkerTool': {
'SubSystem': '2', # Windows
},
},
},
],
}],
],
}
# Local Variables:
# tab-width:2
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=2 shiftwidth=2:

View File

@ -17,7 +17,6 @@
'includes': [
'test/libvietest/libvietest.gypi',
'test/auto_test/vie_auto_test.gypi',
'main/test/WindowsTest/windowstest.gypi',
],
}],
],