RP-VL-UTIL-V1 Developer s Guide [ Contents ] 1. Introduction... 1 2. Building Environment... 1 3. Operating Environment... 1 4. Function Explanation... 2 4.1. Common API for Transmitting and Receiving... 2 HANDLE fnvopen(void);... 2 int fnvclose(handle *h);... 2 int fnvsetconfig(handle h, UINT32 id, const void *cfg, size_t sz);... 3 int fnvgetconfig(handle h, UINT32 id, const void *cfg, size_t sz);... 4 int fnvgetavgframerate(handle h, float *avg);... 5 4.2. API for Transmitting only... 6 int fnvsendstream(handle h, HWND hwnd);... 6 4.3. API for Receiving only... 7 int fnvrecvstream(handle h, HWND hwnd, unsigned long timeout);... 7 int fnvdrawarearesize(handle h, long x, long y, long Width, long Height);... 8 int fnvgetdrawareasize(handle h, long *Width, long *Height);... 9 5. Structure Definition... 10 5.1. FNV_CAPTURE_CONFIG Structure... 10 5.2. FNV_SEND_CONFIG Structure... 11 5.3. FNV_RECV_CONFIG Structure... 12 6. Sample Programs... 13 Revision... 14
1. Introduction This paper explains the specification and usage of RP-VL-UTIL-V1 API library. You must read and agree to the license terms included in this product before using the product. 2. Building Environment To use the API library explained in this paper, the following files are necessary. These files are placed in CDROM ENU Dev directory. Header file: fnvfunclib.h Static link library: fnvfunclib.lib Dynamic link library fnvfunclib.dll * All the modules are built on Visual Studio 2008 Service Pack 1. 3. Operating Environment To operate a program in which the API library explained in this paper is used, the following conditions are necessary. Video Transfer Utility or FNVRuntime 1 is installed fnvfunclib.dll must be placed in the same folder as your program. 2 The number of screen colors is configured to 16/24/32bit 1 FNVRuntime is placed in CDROM ENU Dev. 2 The latest version of fnvfunclib.dll can be downloaded from our website. Please copy from the installation folder of the Video Transfer Utility trial version. 1
4. Function Explanation 4.1. Common API for Transmitting and Receiving HANDLE fnvopen(void); Function Creates a handle. parameter No If the function succeeds, the return is a handle. If the function fails, the return is NULL. When a handle was created, call fnvclose function to delete it. int fnvclose(handle *h); Function Parameter Deletes a handle. h [in] Specifies the pointer to the handle. If the function succeeds, the return is 0. If the function fails, the return is one of the following error codes. FNV_HANDLEERR The handle is not valid FNV_CLOSEERR Fails to delete the handle When a handle was created, call fnvclose function to delete it. 2
int fnvsetconfig(handle h, UINT32 id, const void *cfg, size_t sz); Function Sets parameters. Parameters * The setting is not for the parameters of transmitter and receiver. h [in] Specifies the handle. id [in] Specifies the parameter ID. Specifies one of the following s. FNV_CFGID_CAP Picture capture setting for the transmission side FNV_CFGID_SEND Network setting for the transmission side FNV_CFGID_RECV Network setting for the receive side cfg [in] Specifies the pointer to the structure that stores the parameters. Uses one of the following structures. FNV_CAPTURE_CONFIG Picture capture setting for the transmission side FNV_SEND_CONFIG Network setting for the transmission side FNV_RECV_CONFIG Network setting for the receive side sz [in] Specifies the size of the structure specified by the third parameter- cfg. If the function succeeds, the return is 0. If the function fails, the return is one of the following error codes. FNV_HANDLEERR The handle is not valid FNV_PARAMSIZEERR The of sz is not valid FNV_PARAMIDERR The of id is not valid CAP_FPSERR Fails to set FPS CAP_SIZEERR Fails to set the size of picture CAP_TRIMERR Fails to set trim area SEND_GROUPERR Fails to set group RECV_GROUPERR Fails to set group For the third parameter, please use the structure corresponding to the second parameter- ID. The correspondence is as follows. FNV_CFGID_CAP FNV_CAPTURE_CONFIG FNV_CFGID_SEND FNV_SEND_CONFIG FNV_CFGID_RECV FNV_RECV_CONFIG 3
int fnvgetconfig(handle h, UINT32 id, const void *cfg, size_t sz); Function Retrieves the parameters. Parameters *It is not for retrieving the parameters of transmitter and receiver. h [in] Specifies a handle. id [in] Specifies the parameter ID. Specifies one of the following s. FNV_CFGID_CAP Picture capture setting for the transmission side FNV_CFGID_SEND Network setting for the transmission side FNV_CFGID_RECV Network setting for the receive side cfg [out] Specifies the pointer to the structure that stores the parameters. Uses one of the following structures. FNV_CAPTURE_CONFIG Picture capture setting for the transmission side FNV_SEND_CONFIG Network setting for the transmission side FNV_RECV_CONFIG Network setting for the receive side sz [in] Specifies the size of the structure specified by the third parameter- cfg. If the function succeeds, the return is 0. If the function fails, the return is one of the following error codes. FNV_HANDLEERR The handle is not valid FNV_PARAMSIZEERR The of sz is not valid FNV_PARAMIDERR The of id is not valid CAP_FPSERR Fails to set FPS CAP_SIZEERR Fails to set the size of picture CAP_TRIMERR Fails to set trim area SEND_GROUPERR Fails to set group RECV_GROUPERR Fails to set group For the third parameter, please use the structure corresponding to the second parameter- ID. The correspondence is as follows. FNV_CFGID_CAP FNV_CAPTURE_CONFIG FNV_CFGID_SEND FNV_SEND_CONFIG FNV_CFGID_RECV FNV_RECV_CONFIG 4
int fnvgetavgframerate(handle h, float *avg); Function Parameters Retrieves the current frame rate. h [in] Specifies a handle. avg [out] Specifies the pointer to a float variable used to store the width of showing. If the function succeeds, the return is 0. If the function fails, the return is one of the following error codes. FNV_HANDLEERR The handle is not valid The only displaying size on receiving can be retrieved. 5
4.2. API for Transmitting only int fnvsendstream(handle h, HWND hwnd); Function Starts sending. Parameters h [in] Specifies a handle. hwnd [in] Specifies the window handle of picture to send. If the function succeeds, the return is 0. If the function fails, the return is one of the following error codes. FNV_HANDLEERR The handle is not valid FNV_BUSYERR In operating SEND_SELECTWINDOWERR The window handle is not valid FNV_COREERR1 Internal error FNV_COREERR2 Internal error FNV_COREERR3 Internal error FNV_COREERR4 Internal error Starts sending using the parameters configured by fnvsetconfig. When the parameters are not configured, starts sending using the default s. 6
4.3. API for Receiving only int fnvrecvstream(handle h, HWND hwnd, unsigned long timeout); Function Starts receiving. Checks the receive data during the timeout set. Parameters h [in] Specifies a handle. hwnd [in] Specifies the window handle to display the received picture. timeout [in] Time out (Unit: ms) If the function succeeds, the return is 0. If the function fails, the return is one of the following error codes. FNV_HANDLEERR The handle is not valid RECV_NETWORKERR Network setting error RECV_TIMEOUT Time out FNV_COREERR1 Internal error FNV_COREERR2 Internal error FNV_COREERR3 Internal error FNV_COREERR4 Internal error Starts receiving using the parameters configured by fnvsetconfig. When the parameters are not configured, starts receiving using the default s. 7
int fnvdrawarearesize(handle h, long x, long y, long Width, long Height); Function Parameters Changes the size to display the received picture. h [in] Specifies a handle. x [in] Specifies the x coordinate of the beginning point of the display area. y [in] Specifies the y coordinate of the beginning point of the display area. Width [in] Specifies the width to display. Height [in] Specifies the height to display. If the function succeeds, the return is 0. If the function fails, the return is one of the following error codes. FNV_HANDLEERR The handle is not valid RECV_RESIZEERR Fails to change the size of displaying The only displaying size on receiving can be changed. 8
int fnvgetdrawareasize(handle h, long *Width, long *Height); Function Parameters Retrieves the current displaying size. h [in] Specifies a handle. Width[out] Specifies the pointer to a long variable used to store the width of showing. Height[out] Specifies the pointer to a long variable used to store the height of showing. If the function succeeds, the return is 0. If the function fails, the return is one of the following error codes. FNV_HANDLEERR The handle is not valid. The only displaying size on receiving can be retrieved. The default is the size of the receive data. 9
5. Structure Definition Predefined in fnvfunclib.h 5.1. FNV_CAPTURE_CONFIG Structure This structure is used to store the screen capture setting. It is used by fnvsetconfig, fnvgetconfig functions. Parameter ID: FNV_CFGID_CAP typedef struct fnvcaptureconfig{ INT32 BOOL RECT INT32 nframe; bcurshow; TrimXor; nsize; }FNV_CAPTURE_CONFIG; nframe Specifies the frame rate. (Unit: FPS) Default is 15FPS. bcurshow Specifies whether the cursor is to be displayed. If this parameter is TRUE, the cursor is to be displayed. If the parameter is FALSE, the cursor is not to be displayed. Default is FALSE. TrimXor Specifies the trim area. The top, bottom, left and right can be specified by RECT structure. By default, the top, bottom, left and right are all 0. nsize Specifies the output resolution. Choose one of the following output resolutions. Default is FNV_SIZE_720p. Sample Code Parameters Resolutions FNV_SIZE_VGA 640 480 FNV_SIZE_SVGA 800 600 FNV_SIZE_XGA 1024 768 FNV_SIZE_480p 720 480 FNV_SIZE_720p 1280 720 FNV_SIZE_1080p 1920 1080 FNV_CAPTURE_CONFIG config; fnvgetconfig(handle, FNV_CFGID_CAP, &config, sizeof(config)); 10
5.2. FNV_SEND_CONFIG Structure This structure is used to store the send setting. It is used by fnvsetconfig, fnvgetconfig functions. Parameter ID: FNV_CFGID_SEND typedef struct fnvsendconfig{ CHAR szipaddr[16]; USHORT usgroup; CHAR szlocalip[16]; USHORT usport; }FNV_SEND_CONFIG; szipaddr Specifies the IP address of receiver. It is used for unicast transmission. For multicast transmission, it is ignored. Default is 239.192.19.100. usgroup Specifies the group ID. For multicast transmission, specifies the group ID within the range of 0x00 to 0x0F. For unicast transmission, specifies 0xFF. Default is 0x00. In the case of multicast transmission, send to the following IP addresses. 239.192.19.(100 + group ID) szlocalip Specifies IP address of the adapter which is used to send. It is used for multicast transmission. For unicast transmission, it is ignored. By default, the IP address of the first found adapter is set. usport Specifies the port number of receiver. Default is20487. Sample Code FNV_SEND_CONFIG config; fnvgetconfig(handle, FNV_CFGID_SEND, &config, sizeof(config)); 11
5.3. FNV_RECV_CONFIG Structure This structure is used to store the receive setting. It is used by fnvsetconfig, fnvgetconfig functions. Parameter ID: FNV_CFGID_RECV typedef struct fnvrecvconfig{ USHORT usgroup; USHORT usport; }FNV_RECV_CONFIG; usgroup Specifies the group ID. Default is 0. usport Specifies the port number for receive. Default is 20487. Sample Code FNV_RECV_CONFIG config; fnvgetconfig(handle, FNV_CFGID_RECV, &config, sizeof(config)); 12
6. Sample Programs The sample programs are stored in the following directories. Sample programs for send CDROM ENU Dev fnvsendsample.zip Sample programs for receive CDROM ENU Dev fnvrecvsample.zip * The ample programs are built by using Visual Studio 2008 Service Pack 1. 13
Revision Date Revision 2010/10/04 First Edition 2010/11/11 64bit Support, FNVRuntime is added. 2010/12/14 16bit color and 32bit color support 2011/08/25 Add fnvfunclib.dll operating environment 14