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

📄 capture_process.h

📁 本系统为单机版视频管理系统
💻 H
字号:
 

#if !defined(AFX_VFWIMAGEPROCESSOR_H__635099B7_63C1_11D4_9EF0_000083A26E84__INCLUDED_)
#define AFX_VFWIMAGEPROCESSOR_H__635099B7_63C1_11D4_9EF0_000083A26E84__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif  


#include <afxmt.h>
#include <vfw.h>
#include <afxole.h>

#define MAX_VFW_DEVICES    10

 
class CCapture_Main
{
public:
   CCapture_Main();
   virtual ~CCapture_Main();
   CCapture_Main(const CCapture_Main &CopyFrom);

   BOOL Initialize(SHORT DriverIndex = 0);
   VOID Destroy();
   BOOL PICPIC();//剪贴板
   BOOL VideoCompress();//视频压缩
   BOOL SetDriver(SHORT DriverIndex);
   BOOL CaptureAVI(LPCTSTR Filename, FLOAT FramesPerSec, ULONG Duration, UINT Quality);                            
   BOOL EnablePreviewVideo(HWND Parent, INT x, INT y, INT PreviewRate = 30);
   BOOL EnablePreviewVideo(HWND Parent, INT x, INT y, INT Width, INT Height, INT PreviewRate = 30);
   BOOL DisablePreviewVideo();
   BOOL DriverGetCaps(CAPDRIVERCAPS *Caps);
   BOOL DlgVideoSource();
   BOOL DlgVideoFormat();
   BOOL DlgVideoDisplay();

   //BITMAPINFOHEADER GetBitmapInfoHeader();

   static ULONG CalcBitmapSize(const BITMAPINFOHEADER &bmiHeader);
   static ULONG CalcBitmapInfoSize(const BITMAPINFOHEADER &bmiHeader);

   //
   friend LRESULT CALLBACK ControlCallbackProc(HWND hWnd, int nState);
//
   
   friend LRESULT CALLBACK StatusCallbackProc(HWND hWnd, int nID, LPCSTR lpsz);
   friend LRESULT CALLBACK FrameCallbackProc(HWND hWnd, LPVIDEOHDR lpVHdr);
   friend LRESULT CALLBACK StreamCallbackProc(HWND hWnd, LPVIDEOHDR lpVHdr);
  
   friend UINT CaptureThreadFunc(VOID *pCVFWImageProcessor);

public:     
   HWND m_hWndVideo;
   CMutex m_ImageProtect;
   CEvent m_ImageReady;
   CEvent m_CancelCapture;
   CEvent m_CaptureEnded;

   BITMAPINFOHEADER m_BitmapInfoHeader;    

   PBITMAPINFO m_TransferBitmapInfo;
   ULONG m_TransferBitmapInfoSize;

   CWinThread *m_CaptureThread;
   INT m_DriverIndex;

   static UINT m_ValidDriverIndex[MAX_VFW_DEVICES];
   static USHORT m_TotalVideoDrivers;

private:     
   CCapture_Main &Copy(const CCapture_Main &CopyFrom);
};

#endif   

⌨️ 快捷键说明

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