FVID_create()
FVID_create()函數(shù)的作用:分配并初始化FVID通道對象;
語法:fvidChan = FVID_create (name, mode, *status, optArgs, *attrs);
Parameters
String name /* handle to an instance of the device */
Int mode /* pointer to buffer allocated by driver */
Int *status /* pointer to size of buffer pointed to by */
Ptr optArgs /* */
FVID_Attrs *attrs /* */
其中:name是設(shè)備實例的句柄,是一個字符串
mode 是選擇的模式,只有兩個值:IOM_INPUT 設(shè)置采集模式,IOM_OUTPUT設(shè)置顯示模式.
status是The status argument is an out parameter that this function fills with a pointer to
the status that was returned by the mini-driver.
attrs 是指向FVID_Attrs結(jié)構(gòu)的指針:
FVID_Attrs的定義如下:typedef struct FVID_Attrs {
Uns timeout;
} FVID_Attrs;
timeout成員用來指定旗語同步,它的值可以是:
- SYS_FOREVER:會讓FVID_alloc, FVID_free and FVID_exchange的調(diào)用不確定的等待到這個調(diào)用完成.
- 數(shù)字的timeout值會讓這些APIs阻塞一段指定的時間(以系統(tǒng)時鐘).
- 0值會讓APIs不阻塞,他們會立刻返回,這種情況下,應(yīng)用程序會檢查返回的status值來保證調(diào)用已經(jīng)成功
完成.
備注:FVID_alloc, FVID_free and FVID_exchange 的調(diào)用只能在 DSP/BIOS task (TSK).
如果通道成功的打開了,那么FVID_create返回一個指向通道的句柄.這個句柄可以用來讓后來的模塊調(diào)用這個通道.
Example /* Initialize the attributes */
FVID_ATTRS dispAttrs = FVID_ATTRS;
/* Create an instance to a video display device */ chan-
Handle = FVID_create(“\display0”, IOM_INPUT, NULL, NULL,