修改MV900视频卡测试。
This commit is contained in:
@@ -4775,3 +4775,10 @@ Usb Port Initialized.
|
||||
|
||||
Construct Cso7_Proto.
|
||||
|
||||
Init:Open device succeed .
|
||||
|
||||
_start_machine
|
||||
Exit: Exit_SO7Usb
|
||||
|
||||
Init:Open device succeed .
|
||||
|
||||
|
||||
@@ -220,7 +220,9 @@
|
||||
<ClCompile Include="So7_Util_External_Trig.cpp">
|
||||
<Filter>Sources Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Videocard_MV900.cpp" />
|
||||
<ClCompile Include="Videocard_MV900.cpp">
|
||||
<Filter>Sources Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="CaptureDataDlg.h">
|
||||
@@ -475,7 +477,9 @@
|
||||
<ClInclude Include="So7_Util_External_Trig.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Videocard_MV900.h" />
|
||||
<ClInclude Include="Videocard_MV900.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ReadMe.txt" />
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "afxdialogex.h"
|
||||
|
||||
#define WM_UPDATE_IMAGE WM_USER+100
|
||||
static BYTE g_DataBuffer[640*480*3];
|
||||
static BYTE g_DataBuffer[768*576*3];
|
||||
int m_VideoWidth=640;//640;
|
||||
int m_VideoHeight=480;//480;
|
||||
int m_VideoBitcount=3;
|
||||
@@ -19,6 +19,10 @@ int m_DisplayWidth=640;
|
||||
int m_DisplayHeight=480;
|
||||
// CVideocard_MV900 dialog
|
||||
HWND Msg_Hwnd=NULL;
|
||||
|
||||
VOID CALLBACK MV900_PrcVidCapCallBack( PUCHAR pData, ULONG Length, CVideocard_MV900* pIS);
|
||||
|
||||
|
||||
IMPLEMENT_DYNAMIC(CVideocard_MV900, CDialog)
|
||||
|
||||
CVideocard_MV900::CVideocard_MV900(CWnd* pParent /*=NULL*/)
|
||||
@@ -100,7 +104,7 @@ void CVideocard_MV900::OnBnClickedRadioMv900Rgb()
|
||||
//==============================================================================
|
||||
void CVideocard_MV900::OnBnClickedRadioMv900Gray()
|
||||
{
|
||||
m_ConvertColorType=RGB24TOGRAY;
|
||||
m_ConvertColorType=RGB24TORGB;
|
||||
}
|
||||
//==============================================================================
|
||||
void CVideocard_MV900::OnBnClickedMv900CheckMirrorVertically()
|
||||
@@ -147,13 +151,13 @@ void CVideocard_MV900::OnBnClickedButtonMv900Savefile()
|
||||
void CVideocard_MV900::OnBnClickedOk()
|
||||
{
|
||||
LoadVideocard();
|
||||
SetTimer(1,50,NULL);
|
||||
//SetTimer(1,50,NULL);
|
||||
GetDlgItem(IDOK)->EnableWindow(false);
|
||||
}
|
||||
//==============================================================================
|
||||
void CVideocard_MV900::OnBnClickedCancel()
|
||||
{
|
||||
KillTimer(1);
|
||||
//KillTimer(1);
|
||||
UnloadVideocard();
|
||||
CDialog::OnCancel();
|
||||
}
|
||||
@@ -165,17 +169,24 @@ BOOL CVideocard_MV900::LoadVideocard()
|
||||
m_dwCard=MV_GetCardNumber();
|
||||
m_hDev = Cap_Create("MVVGA", 0);
|
||||
|
||||
int m_Yoff(0),m_Xoff(0),m_Xmax(0),m_Ymax(0);
|
||||
m_Yoff = Cap_GetPropery( m_hDev, SIG_YOFF );
|
||||
m_Xoff = Cap_GetPropery( m_hDev, SIG_XOFF );
|
||||
m_Xmax = Cap_GetPropery( m_hDev, SIG_WIDTH);
|
||||
m_Ymax = Cap_GetPropery( m_hDev, SIG_HIGH );
|
||||
|
||||
//int m_Yoff(0),m_Xoff(0),m_Xmax(0),m_Ymax(0);
|
||||
//m_Yoff = Cap_GetPropery( m_hDev, SIG_YOFF );
|
||||
//m_Xoff = Cap_GetPropery( m_hDev, SIG_XOFF );
|
||||
//m_Xmax = Cap_GetPropery( m_hDev, SIG_WIDTH);
|
||||
//m_Ymax = Cap_GetPropery( m_hDev, SIG_HIGH );
|
||||
|
||||
m_status=Cap_SetPropery(m_hDev,SIG_FRAME,25);
|
||||
//long min,max,def;
|
||||
//Cap_GetProperyRange(m_hDev,SIG_YOFF,&min,&max,&def);
|
||||
//Cap_GetProperyRange(m_hDev,SIG_XOFF,&min,&max,&def);
|
||||
//Cap_GetProperyRange(m_hDev,SIG_WIDTH,&min,&max,&def);
|
||||
//Cap_GetProperyRange(m_hDev,SIG_HIGH,&min,&max,&def);
|
||||
//Cap_GetProperyRange(m_hDev,SIG_FRAME,&min,&max,&def);
|
||||
//Cap_GetProperyRange(m_hDev,PIEXL_BIT,&min,&max,&def);
|
||||
|
||||
//m_status=Cap_SetPropery(m_hDev,SIG_FRAME,25);
|
||||
m_status=Cap_SetPropery(m_hDev,PIEXL_BIT,24);
|
||||
m_status=Cap_SetOutSize(m_hDev,m_DisplayHeight,m_DisplayWidth);
|
||||
Cap_SetCallBack(m_hDev, (PUSERCALL)MV900_PrcVidCapCallBack, this );
|
||||
//m_status=Cap_SetOutSize(m_hDev,m_DisplayHeight,m_DisplayWidth);
|
||||
Cap_SetCallBack(m_hDev, (PUSERCALL)MV900_PrcVidCapCallBack, this);
|
||||
m_status=Cap_Start(m_hDev);
|
||||
#endif //_RELEASE_FULL_VERSION
|
||||
return TRUE;
|
||||
@@ -473,6 +484,11 @@ void CVideocard_MV900::OnPaint()
|
||||
delete pMemDC;
|
||||
ReleaseDC(dc);
|
||||
}
|
||||
//================================================================================================
|
||||
void CVideocard_MV900::UpdateImage()
|
||||
{
|
||||
OnPaint();
|
||||
}
|
||||
|
||||
afx_msg LRESULT CVideocard_MV900::OnUpdateImage(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
@@ -496,14 +512,13 @@ void CVideocard_MV900::OnTimer(UINT_PTR nIDEvent)
|
||||
|
||||
CDialog::OnTimer(nIDEvent);
|
||||
}
|
||||
const int iStartX(0);
|
||||
const int iStartY(0);
|
||||
static int iStartX(0);
|
||||
static int iStartY(0);
|
||||
|
||||
//==================================SV4000E=====================================
|
||||
VOID CALLBACK MV900_PrcVidCapCallBack( PUCHAR pData, ULONG Length, PVOID pUserData)
|
||||
VOID CALLBACK MV900_PrcVidCapCallBack( PUCHAR pData, ULONG Length,CVideocard_MV900* pIS)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(Length);
|
||||
UNREFERENCED_PARAMETER(pUserData);
|
||||
//memcpy(g_DataBuffer,(BYTE*)pData,Length);//640*480*m_VideoBitcount
|
||||
for(int y=iStartY;y<iStartY+480;y++)
|
||||
{
|
||||
@@ -512,5 +527,7 @@ VOID CALLBACK MV900_PrcVidCapCallBack( PUCHAR pData, ULONG Length, PVOID pUserDa
|
||||
g_DataBuffer[(y-iStartY)*640*3+(x-iStartX)]=(BYTE)pData[y*768*3+x];
|
||||
}
|
||||
}
|
||||
pIS->UpdateImage();
|
||||
|
||||
//PostMessage(Msg_Hwnd,WM_UPDATE_IMAGE,0,0);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
VOID CALLBACK MV900_PrcVidCapCallBack( PUCHAR pData, ULONG Length, PVOID pUserData );
|
||||
// CVideocard_MV900 dialog
|
||||
|
||||
class CVideocard_MV900 : public CDialog
|
||||
@@ -41,6 +40,7 @@ private:
|
||||
int m_nContrast;
|
||||
int m_nBrightness;
|
||||
public:
|
||||
void UpdateImage();
|
||||
afx_msg void OnBnClickedRadioMv900Rgb();
|
||||
afx_msg void OnBnClickedRadioMv900Gray();
|
||||
afx_msg void OnBnClickedMv900CheckMirrorVertically();
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user