📄 videocap.h
字号:
#ifndef __VIDEOCAP_H__
#define __VIDEOCAP_H__
#include "GUm.h"
#include "GCommDef.h"
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#define PWM_VIDEO_INIT (WM_USER + 1)
#define PWM_VIDEO_START_WAIT_EVENT (WM_USER + 2)
#define PWM_VIDEO_STOP_CAPTURE (WM_USER + 3)
#define PWM_VIDEO_CLOSE_THREAD (WM_USER + 4)
typedef struct _VIDEOCAP_INIT_CONFIG
{
DWORD dwTotalSlotNumber;
COMMON_PHandleBufferFunction pBufferFunction;
LPBYTE lpRegistryPath;
} VIDEOCAP_INIT_CONFIG, *PVIDEOCAP_INIT_CONFIG;
/*--------------------------------------
Members:
dwTotalSlotNumber
Indicate the total number of device slots in system.
pBufferFunction
Point to a function pointer that handles the video capture buffer.
lpRegistryPath
Point to a registry path string.
--------------------------------------*/
typedef struct _VIDEOCAP_LOGO
{
DWORD dwSlotNumber;
LPBYTE lpLogoBuffer;
int iLogoX;
int iLogoY;
} VIDEOCAP_LOGO, *PVIDEOCAP_LOGO;
/*--------------------------------------
Members:
dwSlotNumber
Indicate device's slot number.
lpLogoBuffer
Point to a logo data buffer with YCbCr 4:2:0 format.
iLogoX
Indicate the upper and left corner's x-coordinate of logo display area.
iLogoY
Indicate the upper and left corner's y-coordinate of logo display area.
--------------------------------------*/
typedef struct _VIDEOCAP_CAPTURE_CONFIG
{
DWORD dwSlotNumber;
LPBYTE lpLogoBuffer;
int iLogoX;
int iLogoY;
MPJ_CaptureConfigValues CaptureConfig;
MPJ_CaptureConfigValid ValidConfig;
BOOL fLVSSFirst;
MPJ_StreamType StreamType;
BOOL fAdjustQualityToBus;
MPJ_PReportEvent pVBVEvent;
MPJ_PReportEvent pOOSEvent;
MPJ_PReportEvent pTOEvent;
MPJ_PReportEvent pAOEvent;
int iOutOfSyncThreshold;
int iVideoTimeOut;
MPJ_SessionID *pSessionID;
} VIDEOCAP_CAPTURE_CONFIG, *PVIDEOCAP_CAPTURE_CONFIG;
/*--------------------------------------
Members:
dwSlotNumber
Indicate device's slot number.
pLogoBuffer
Point to a logo data buffer with YCbCr 4:2:0 format.
iLogoX
Indicate the upper and left corner's x-coordinate of logo display area.
iLogoY
Indicate the upper and left corner's y-coordinate of logo display area.
CaptureConfig
Points to an array that contains the setting for capture process. See
User-Mode driver specification for detailed description of this array.
ValidConfig
Points to an array that receives validation result of the settings for
capture process. See User-Mode driver specification for detailed
description of this array.
fLVSSFirst
Indicate the first step of SnapShot function.
StreamType
Identcate the stream type for capture process.
MPJ_VIDEO_STREAM Capture video stream only.
MPJ_AUDIO_STREAM Capture audio stream only. The board should support
audio source input.
MPJ_BOTH_STREAMS Capture audio and video streams in the same time.
The board should support audio source input.
fAdjustQualityToBus
If TRUE, it requests for quality adjustment for either MPEG/VBR stream
or JPEG stream to assure host response for the device generated bit
stream. This is set to FALSE in our application.
pVBVEvent
Point to an event object for VBV event handle. The VBV-Underflow status
will be reported by signaling this event if it is not NULL. If NULL, the
VBV-Underflow status will not be reported.
pOOSEvent
Point to an event object for OOS event handle. The Out-Of-Sync status
will be reported by signaling this event if it is not NULL. If NULL, the
Out-Of-Sync status will not be reported.
pTOEvent
Point to an event object for TO event handle. The Time-Out status will
be reported by signaling this event if it is not NULL. If NULL, the
Time-Out status will not be reported.
pAOEvent
Point to an event object for AO event handle. The Audio-Overflow status
will be reported by signaling this event if it is not NULL. If NULL, the
Audio-Overflow status will not be reported.
iOutOfSyncThreshold
The threshold is the number of successive frames after which an
Out-Of-Sync event is requested to be generated. Set this to 0 means use
a default value.
iVideoTimeOut
Time out, in seconds, for getting input video data to the host. Set this
to 0 means use a default value.
pSessionID
Use to receive the session ID assigned by driver.
--------------------------------------*/
int WINAPI VIDEOCAP_Open( PVIDEOCAP_INIT_CONFIG pInitConfig );
int WINAPI VIDEOCAP_Close( void );
int WINAPI VIDEOCAP_SetLogoData( PVIDEOCAP_LOGO pLogo );
int WINAPI VIDEOCAP_AddBuffers( DWORD dwSlotNumber, BOOL fOneBufferOnly );
int WINAPI VIDEOCAP_StartWaitEvent( DWORD dwSlotNumber, HANDLE hVideoCaptureFinishEvent );
int WINAPI VIDEOCAP_StartCapture( PVIDEOCAP_CAPTURE_CONFIG pVideoCaptureConfig );
int WINAPI VIDEOCAP_Reset( DWORD dwSlotNumber );
//int WINAPI VIDEOCAP_CompressSingleFrame_TwoSteps(
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -