www.pudn.com > XvidQP.rar > InputFile.h


//	VirtualDub - Video processing and capture application 
//	Copyright (C) 1998-2001 Avery Lee 
// 
//	This program is free software; you can redistribute it and/or modify 
//	it under the terms of the GNU General Public License as published by 
//	the Free Software Foundation; either version 2 of the License, or 
//	(at your option) any later version. 
// 
//	This program is distributed in the hope that it will be useful, 
//	but WITHOUT ANY WARRANTY; without even the implied warranty of 
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
//	GNU General Public License for more details. 
// 
//	You should have received a copy of the GNU General Public License 
//	along with this program; if not, write to the Free Software 
//	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
 
#ifndef f_INPUTFILE_H 
#define f_INPUTFILE_H 
 
#include  
#include  
 
#include "List.h" 
 
class AudioSource; 
class VideoSource; 
class AVIStripeSystem; 
class IAVIReadHandler; 
class IAVIReadStream; 
 
 
class InputFileOptions { 
public: 
	virtual ~InputFileOptions()=0; 
	virtual bool read(const char *buf)=0; 
	virtual int write(char *buf, int buflen)=0; 
}; 
 
class InputFilenameNode : public ListNode2 { 
public: 
	const char *name; 
 
	InputFilenameNode(const char *_n); 
	~InputFilenameNode(); 
}; 
 
class InputFile { 
public: 
	AudioSource *audioSrc;					//音频 
	VideoSource *videoSrc;					//视频 
	List2 listFiles; 
 
	virtual ~InputFile(); 
	virtual void Init(char *szFile) = 0; 
	virtual bool Append(const char *szFile); 
 
	virtual void setOptions(InputFileOptions *); 
	virtual void setAutomated(bool); 
	virtual InputFileOptions *promptForOptions(HWND); 
	virtual InputFileOptions *createOptions(const char *buf); 
	virtual void InfoDialog(HWND hwndParent); 
 
	virtual bool isOptimizedForRealtime(); 
	virtual bool isStreaming(); 
 
protected: 
	void AddFilename(const char *lpszFile); 
}; 
 
class InputFileAVI : public InputFile { 
private: 
	IAVIReadHandler *pAVIFile;								//AVI文件读入接口 
	IAVIReadStream *pAVIStreamAudio, *pAVIStreamVideo;		//音频和视频解码接口 
 
	AVIStripeSystem *stripesys;								//条纹系统(支持RAID技术) 
	IAVIReadHandler **stripe_files; 
	int stripe_count;										//条纹数目 
	bool isASF; 
	bool fAutomated; 
    //状态布尔值 
	bool fCompatibilityMode, fRedoKeyFlags, fInternalMJPEG, fDisableFastIO, fAcceptPartial, fAutoscanSegments; 
	//模式值 
	int iMJPEGMode; 
	FOURCC fccForceVideo; 
	FOURCC fccForceVideoHandler; 
	long lForceAudioHz; 
 
	static char szME[];				//动作估计 
 
	static void _InfoDlgThread(void *pvInfo);			//对话框线程 
	static BOOL APIENTRY _InfoDlgProc( HWND hDlg, UINT message, UINT wParam, LONG lParam); 
	//对话框窗口过程 
public: 
	InputFileAVI(bool isASF); 
	~InputFileAVI(); 
 
	void Init(char *szFile);					//初始化 
	void InitStriped(char *szFile); 
	bool Append(const char *szFile); 
 
	bool isOptimizedForRealtime(); 
	bool isStreaming(); 
 
	void setOptions(InputFileOptions *_ifo); 
	InputFileOptions *createOptions(const char *buf); 
	InputFileOptions *promptForOptions(HWND hwnd); 
	void EnableSegmentAutoscan(); 
	void ForceCompatibility(); 
   void setAutomated(bool fAuto); 
 
	void InfoDialog(HWND hwndParent); 
}; 
 
#endif