⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stdafx.h

📁 一个在Linux下开发的IP摄像头的驱动程序及控制软件
💻 H
字号:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently

#pragma once

#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers
#endif

// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER				// Allow use of features specific to Windows 95 and Windows NT 4 or later.
#define WINVER 0x0400		// Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif

#ifndef _WIN32_WINNT		// Allow use of features specific to Windows NT 4 or later.
#define _WIN32_WINNT 0x0400		// Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif						

#ifndef _WIN32_WINDOWS		// Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif

#ifndef _WIN32_IE			// Allow use of features specific to IE 4.0 or later.
#define _WIN32_IE 0x0400	// Change this to the appropriate value to target IE 5.0 or later.
#endif

#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS	// some CString constructors will be explicit

// turns off MFC's hiding of some common and often safely ignored warning messages
#define _AFX_ALL_WARNINGS

#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

//for static library
#ifdef STATICLIB
#include "MainProfile.h"
#endif	//STATICLIB
#include "DataBroker.h"
#include "SrvDepResource.h"
#include "AVSynchronizer.h"
#include "database.h"
#include "assert.h"

#define MAX_CHANNELS    16

enum CH_STATUS
{
	channelStopped = 0,
	channelConnecting = 1,
	channelConnected = 2,
	channelDisconnecting = 3,
};

enum CH_ASYNC_OPER
{
	asyncNone = 0,
	asyncSetProp = 1,
	asyncHttpOperGet = (1 << 1),
	asyncHttpOperPost = (1 << 2),
	asyncUartRead = (1 << 3),
	asyncSetDO = (1 << 4),
	asyncUartWrite = (1 << 5),
	asyncGetDI = (1 << 6),
	asyncGetSys = (1 << 7),
};

enum ETalkState
{
	eTalkNone = 0,
	eTalkEstablishing = 1,
	eTalkTalking = 2,
	eTalkStopping = 3,
};

enum ERtspRunState
{
	eRtspStNone = 0,
	eRtspStPlay = 1,
	eRtspStPause = 2,
};

typedef struct Channel_Info
{
	HANDLE				hConn;
	HANDLE				hChannel;
	HANDLE				hDBLocation;
	HWND				hDisplay;
	char 				chHostIP[64];
	char				chUserName[32];
	char				chPassword[32];
	char				chServer_Type[32];
	char				chLocation[64];
	char				chDBLocation[64];
	DWORD				dwHTTPPort;
	DWORD				dwCtrlPort;	// for RTSP server
	DWORD				dwProtocol;//1->TCP,2->UDP,3->HTTP
	DWORD				dwMediaType;
	DWORD				dwAudioCodec;
	DWORD				dwVideoCodec;
	DWORD				dwCamera;
	DWORD				dwVSize;	// only for VS2K
	DWORD				dwQuality;	// only for VS2K
	DWORD				dwContext;
	DWORD				dwVideo_Width;
	DWORD				dwVideo_Height;
	BOOL				bConnecting;
	BOOL				bRecording;
	DWORD				dwVolume;
	int					nTimerDI;
	HANDLE				hSrvDev;
	DWORD				dwWantMedia;
	BOOL				bNoDisplay;
	CH_STATUS			chStatus;
	BOOL				bEventRecord;
	BOOL				bEventRecording;
	DWORD				dwCBCount;
	DWORD				dwTickStart;
	void				*pvDlg;
	BOOL				bUpper;	// for DI to know how fast or slow it is chaning
	BOOL				bNoBorder;

	// for async operation
	DWORD				dwAsyncOper;
	char				chUartReadBuffer[MAX_PATH];
	BOOL				bExitBlock;
	int					nFrames;
	DWORD				dwLastFRTick;

	// for decoder channel
	HANDLE				hDecoderChannel;
	DWORD				dwDecFileIndex;
	DWORD				dwAudioFileIndex;
	DWORD				dwVideoBuffSize;
	DWORD				dwAudioBuffSize;
	BYTE				*pbyVideoBuff;
	BYTE				*pbyAudioBuff;

	// for packet maker
	HANDLE				hPacketMakerChannel;

	// for tx operation
	int					nTxConn;	// 0 nothing, 1 txing, 2 talking
	FILE				*pFileMedia;
	DWORD				dwBufLen;
	BYTE				*pbyTxData;
	int					iAudioMode;
	DWORD				dwPrivilege;
	ETalkState			eTalkState;
	BOOL				bAudioDisabled;
	DWORD				dwAOnlyCBCount;
	int					nXAdd;
	int					nYAdd;
	int					nLastSecond;
	DWORD				dwLastAudioSec;
	DWORD				dwLastAudioMiliSec;
	BOOL				bUserStoppingTalk;
	DWORD				dwAOnlyX;
	DWORD				dwAOnlyY;

	char				szUserUrl[MAX_PATH];
	char				szUserUrlExtra[MAX_PATH];
	BOOL				bNetPacketCallback;
	HANDLE				hDataBrokerInput;
	// for testing
	DWORD				nQueueFullTimes;

	// for AVCB
	BYTE				*pbyAVCBVideoBuf;
	DWORD				dwAVCBVideoBufSize;
	BYTE				*pbyAVCBAudioBuf;
	DWORD				dwAVCBAudioBufSize;
	DWORD				dwAVCBFileIndex;
	DWORD				dwAVCBAudioFileIndex;

	// for auto reconnect
	BOOL				bUserStop;
	BOOL				bNeedReconnect;

	// for RTSP
	DWORD				dwMediaStart;
	DWORD				dwMediaEnd;
	ERtspRunState		eRtspState;
}TCHANNEL_INFO, *PTCHANNEL_INFO;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -