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

📄 okapi32.h

📁 实现了java调用c的功能(JNI)
💻 H
📖 第 1 页 / 共 4 页
字号:

//set out LUT:
long	WINAPI okFillOutLUT(HANDLE hBoard,  LPBYTE bLUT, short start, short num);
		//fill specified playback out LUT. 
		//bLut stored values to fill, (r0,g0,b0, r1,g1,b1 ...)
		//start: offset pos in LUT(based 0), num: num items to fill

//set input LUT:
long	WINAPI okFillInputLUT(HANDLE hBoard,  LPBYTE bLUT, short start, short num);
		//fill specified input LUT. 
		//bLut stored values to fill, (r0,g0,b0, r1,g1,b1 ...)
		//start: offset pos in LUT(based 0), num: num items to fill

BOOL	WINAPI okCaptureSequence(HANDLE hBoard, LONG lStart, LPARAM lNoFrame);
		//capture sequence to BUFFER by way of Interrupt Service Routine 
		//Note: Only M10 series, M20H,M40, M60, M30, M70 and RGB20 support this way 
		//wParam=start(o based). lParam>0: number of frame to capture to,
 		//if lParam > total frames in BUFER, it will loop in rewind mode(i%total)
		//when -1 mean loop in all buffer. infinitely until call okStopCapture, 
		//return max num frame can be stored in the target in this way if success,
		// return 0 if failed(eg. format not matched). -1 not support target
		//this call will start a Interrupt Service Routine to manage to capture sequencely then
		//return immediately not wait to finish. This routine not support callback 

BOOL	WINAPI okPlaybackSequence(HANDLE hBoard, LONG lStart, LONG lNoFrame);
		//playback on monitor from BUFFER
		//start(0 based), lNoFrame>0: number of frame to capture to,  
		//if lParam > total frames in BUFER, it will loop in rewind mode (i%total)
		//if lParam=-1 mean it loop infinitely until call okStopCapture
		//return max num frame be stored in the target if success, 
		//return 0 if wrong. -1 not support 
		//this call will start a Interrupt Service Routine to manage to playback sequencely then
		//return immediately not wait to finish. This routine not support callback 
		//


//--3. multi cards, channels, memories --------------

//multi cards access:
short	WINAPI okGetSlotBoard(BOARDTYPE **lpOkInfo);
		//Query all Ok boards available in PCI bus, return total number
short	WINAPI okGetBoardIndex(char *szBoardName, short iNo);
		//Get index (start 0) of specified board name string (it can also be typcode string)
		// and order in same name (start 0), 
		//return -1 if no this specified ok board
short	WINAPI okGetBoardName(long lIndex, LPSTR szBoardName);
		//get the board code and name of the specified index 
		//return the type code if success else return 0 if no card

//multi cards capture
BOOL	WINAPI 	okMulCaptureTo(HANDLE *lphBaord,TARGET Dest, long start, LPARAM lParam);
		//control multi boards to capture to target simultaneously, lphBaord are pointer of hBoard of multi board  
		//other functions are same as okCaptureByBuffer
BOOL	WINAPI 	okMulCaptureByBuffer(HANDLE *lphBaord,TARGET tgt, long start, long num);
		//control multi boards to capture by buffer simultaneously, lphBaord are pointer of hBoard of multi board  
		//other functions are same as okCaptureByBuffer

//multi channels:
BOOL	WINAPI okLoadInitParam(HANDLE hBoard, short iChannNo);
		//load specified chann (and as current chann.)of initial params
BOOL	WINAPI okSaveInitParam(HANDLE hBoard, short iChannNo);
		//save current init param to specified chann (and as current chann.)

//get and lock buffer
long	WINAPI okGetAvailBuffer(void **lpLinear, DWORD *dwSize);
		//Get free meomery buffers pre-allocated . 
		//call it when user hope to access buffer directly or lock for some one board 
long	WINAPI okLockBuffer(HANDLE hBoard, DWORD dwSizeByte, void **lpBasLinear);
		//Lock speicfiled size meomery buffers, then other handle can not use them
		//return the size of locked buffer in fact
BOOL	WINAPI okUnlockAllBuffer(void);
		//Unlock all buffer for all handle


//Mem Block Buffer appended to BUFFER 
long	WINAPI okApplyMemBlock(DWORD dwBlockSize, DWORD dwBlockNo);
		//apply mem block used as buffer appended to BUFFER
		//return the number of blocks allocated actually

BOOL	WINAPI okFreeMemBlock();
		//release appended MemBlock by okApplyMemBlock

long	WINAPI okGetMemBlock(HANDLE hBoard, DWORD *dwEachSize,  DWORD *dwBlockNo);
		//get the number of MemBlock and size per block applied by okApplyMemBlock 
		//and return the number can be as buffer as to cureent set size of BUFFER

long	WINAPI okLockMemBlock(HANDLE hBoard, long lBlockNo);
		//lock number of MemBlock to specified handle

BOOL	WINAPI okUnlockMemBlock(void);
		//unlcok all locked MemBlock


//--4. apps utilities-----------------


#define		STATICVXD		1
#define		INSTNTDRV		2
#define		ALLOCBUFFER		3
#define		MEMBLOCKSIZE	4
#define		MEMBLOCKCOUNT	5
#define		UNREGISTER		6


long	WINAPI okSetDriverParam(long lWhich, long lParam); 
		//

//set pre-allocate buffer size in k byte
long	WINAPI okSetAllocBuffer(long lSize);
		//set the new size to preallocate in  k bytes, 
		//if new size is not same as current, 
		//then the functuion will restart the window system

BOOL	WINAPI okSetStaticVxD(long lMode); //just for win95/98
		//lMode=0: check if static vxd registered.
		//=1: create static vxd register
		//=2: delete static vxd register

BOOL	WINAPI okSetNTDriver(BOOL bCmd);	//just for winNT/2K
		//bCmd=0: check if nt driver installed.
		//=1: install nt driver
		//=2: remove nt driver

BOOL	WINAPI okUnRegister(DWORD dwCmd);
		//uninstall all registered and generated infos

long	WINAPI	okGetProgramInfo(int iItem, LPSTR lpString, int iSize);
		//get program info
#define	PROGRAM		1
#define	VERSION		2
#define	PREFIX		3
#define	COMPANY		4
#define	TELFAX		5
#define	WEBEMAIL	6

long	WINAPI okSetLangResource(long langcode); //1252 for English, 936 for Simple Chinese



//encode and decode
HANDLE	WINAPI okBeginEncode(HANDLE hBoard, WORD wCodeWay, LPARAM lParam);
		//start to encode images. wCodeWay is JPEG or other compress, 
		//lParam is address of parameters preset to encode
		//return a handle of encoder if sucessful, else  return 0
long	WINAPI okEncodeImage(HANDLE hCoder, TARGET src, long start, LPBYTE lpData, long maxlen);
		//encode one frame image . src is source like BUFFER, SCREEN, FRAME and BLOCK.
		//lpData to store coded data,  maxlen is maximum length of lpCodedData
		//return the length coded data
long	WINAPI okEndEncode(HANDLE hCoder);
		//end encode and release resources of encoder

HANDLE	WINAPI okBeginDecode(HANDLE hBoard, WORD wCodeWay, LPBYTE lpData, LPIMAGESIZE lpImageInfo);
		//start to decode images. wCodeWay is JPEG or other compress, 
		//lpData is coded data with header infos, lpImageInfo will return size info, it can also be NULL
		//return a handle of decoder if sucessful, else  return 0
long	WINAPI okDecodeImage(HANDLE hCoder, LPBYTE lpData, long *length, TARGET target, long start);
		//decode coded data to image. lpData is coded data, 
		//length is input length of coded data, it also output length of real used data 
		//target is target decode to like BUFFER, SCREEN, FRAME,BLOCK or memory pointer 
		//return TRUE if one image finished, else return 0
long	WINAPI okEndDecode(HANDLE hCoder);
		//end decoder and release resources of decoder


//protect
long	WINAPI okReadProtCode(HANDLE hBoard, short iIndex);

long	WINAPI okWriteProtCode(HANDLE hBoard, short iIndex, long code);

//


//--5. audio section routines--------------

//-----defines wParam in okSetAudioParam
#define		AUDIO_RESETALL			0 //reset all to sys default
#define		AUDIO_SAMPLEFRQ			1 //Sample rate, in samples per second
#define		AUDIO_SAMPLEBITS		2 //Bits per sample 
#define		AUDIO_INVOLUME			3 //Audio input gain control
#define		AUDIO_CALLINTERVAL		4 //callback after interval times


//prolog and epilog
HANDLE	WINAPI okOpenAudio(HANDLE hBoard, LPARAM lParam);
		//open audio device owned by the video capture board 
		//hBoard is handle of image board, lParam reserved argument must ne set to 0
		//return handle of the audio device

BOOL	WINAPI okCloseAudio(HANDLE hAudio);
		//close audio device

//capture and stop
long	WINAPI okCaptureAudio(HANDLE hAudio, TARGET target, FARPROC lpfnUserProc, LPARAM lParam);
		//start to capture audio data, target can be BUFFER(audio data buffer) or file name
		//lpfnUserProc is callback function pointer, it must be NULL if not using callback 
		// lParam reserved argument must be set to 0
		//return the maximum times in miliseconds the inner audio data memory can be stored for

BOOL	CALLBACK WriteAudioProc(HANDLE hAudio, LPBYTE lpAudBuf, long length);
		//this callback function must written as the above protype by user 
		//call this function when there are enough audio data (the length in byte)
		//call this function when capture ended with argument length=0;

BOOL	WINAPI okStopCaptureAudio(HANDLE hAudio);
		//stop capturing audio data
		//return total length of read out by okReadAudioData 

//set and get audio
long	WINAPI okSetAudioParam(HANDLE hAudio, WORD wParam, LPARAM lParam);
		//set the parameters to sample audio,  wParam see above defines
		//return the new set value if success
		//if not support return -1, if error return -2 
		//if input lParam=-1, just return previous param 			

long	WINAPI okReadAudioData(HANDLE hAudio, LPBYTE lpAudioBuf, long lReadSize);
		//read audio captured from inner data buffer
		//lpAudioBuf is your memory address to store
		//lReadSize is data length (in byte) you expect to read
		//return the data length (in byte) truelly read 



//--6. ports io utilities--------------
// for Non-PCI IO cards on WinNT/Win2000 
// you must call this function before using follow port io functions 
BOOL	WINAPI okSetPortBase(WORD wPortBase, short iPortCount);
		//preset ports to use by setting port base address and port count 
		//to use some ports (default port=0x300, count=4) must preset by calling this one  
		//and these ports can be used correctly only after system restarted
		
		//this function only used for OK PCI GPIO20
short	WINAPI okGetGPIOPort(short index, WORD *wPortBase);
		//get port base and count of ok PCI GPIO20 
		//index is the nomber (0 based) of gpio cards,  
		//wPortBase: port base,  return port count if success else return 0

BOOL	WINAPI okOutputByte(WORD wPort, BYTE data);
		//output a byte at specified port 

BOOL	WINAPI okOutputShort(WORD wPort, short data);
		//output a word at specified port 

BOOL	WINAPI okOutputLong(WORD wPort, long data);
		//output a dword at specified port 

//----------- input data at port
BYTE	WINAPI okInputByte(WORD wPort);
		//input a byte at specified port 

short	WINAPI okInputShort(WORD wPort);
		//input a word at specified port 

long	WINAPI okInputLong(WORD wPort);
		//input a dword at specified port 

#define okGetDriverVer(a, b) okGetProgramInfo(2, a, b)

DWORD	WINAPI okGetAddrForVB(void *);
		//return array address for VB

//-----------get time elapse
DWORD	WINAPI okGetTickCount(void);
		//same as GetTickCount but exactly than it on Win2k

void	WINAPI okSleep(DWORD dwMill);
		//same as Sleep but exactly than it on Win2k


#ifdef __cplusplus
}
#endif    /* __cplusplus */


#endif

//-------------------end-------------------------------------------------------------------

⌨️ 快捷键说明

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