OWLIFT C Library for Linux: Getting and Releasing Device
OWLIFT C Library for Linux  1.9.3
Top Page
Functions
Getting and Releasing Device

Functions

OwStatus_t OwLib_GetDevices (OwDev **devsp, int *numDevsp, OwHostErrorCode_t *hep)
 
OwStatus_t OwLib_GetDevicesDiff (OwDev **newDevsp, int *numNewDevsp, OwDev **removedDevsp, int *numRemovedDevsp, OwDev *oldDevs, int numOldDevs, OwHostErrorCode_t *hep)
 
OwStatus_t OwLib_GetDeviceByDeviceFile (const char *devPath, OwDev *devp, OwHostErrorCode_t *hep)
 
OwStatus_t OwLib_CreateWithoutConnect (OwDev *devp)
 
void OwLib_Release (OwDev dev)
 
void OwLib_ReleaseArray (OwDev *devs)
 
OwStatus_t OwLib_Reconnect (OwDev dev)
 

Detailed Description

Function Documentation

◆ OwLib_CreateWithoutConnect()

OwStatus_t OwLib_CreateWithoutConnect ( OwDev devp)

Creates a new OwDev object that is not related with any devices. The created object can ONLY be used for calling OwLib_Decode() if the image source is directly DirectShow or V4L2 without OWLIFT SDK.

Parameters
devp[out] The pointer that receives an object.
Returns
The error code.

◆ OwLib_GetDeviceByDeviceFile()

OwStatus_t OwLib_GetDeviceByDeviceFile ( const char *  devPath,
OwDev devp,
OwHostErrorCode_t hep 
)

Gets a device handle corresponding to the specified video device. Returns OWST_DEVICE_NOT_FOUND if the video device is an inoperable one.

Parameters
devPath[in] The device file path of which prefix is /dev/video.
devp[out] The pointer that receives a device handle.
hep[out] The pointer that receives the V4L2 error code when this function returns OWST_V4L2_ERROR.
Returns
The error code.

◆ OwLib_GetDevices()

OwStatus_t OwLib_GetDevices ( OwDev **  devsp,
int *  numDevsp,
OwHostErrorCode_t hep 
)

Gets devices. Returns OWST_EVICE_NOT_FOUND if not device was found. Returns OWST_DEVICE_UNSUPPORTED if the firmware version is invalid. If this function returns OWST_DEVICE_UNSUPPORTED, a device handle with invalid state will be stored to devsp. It cannot be executed against the device handle with invalid state except OwLib_Release() and some functions that return properties.

Parameters
devsp[out] The pointer that receives the device handle. Caller takes responsibility for releasing *devsp and each device handle stored in *devsp. OwLib_ReleaseArray() releases *devsp. OwLib_Release() releases each device handle stored in *devsp.
numDevsp[out] The pointer that receives the number of device handles.
hep[out] The pointer that receives the V4L2 error code when the return value is OWST_V4L2_ERROR.
Returns
The error code.

◆ OwLib_GetDevicesDiff()

OwStatus_t OwLib_GetDevicesDiff ( OwDev **  newDevsp,
int *  numNewDevsp,
OwDev **  removedDevsp,
int *  numRemovedDevsp,
OwDev oldDevs,
int  numOldDevs,
OwHostErrorCode_t hep 
)

Gets newly connected devices and detects disconnected devices. Returns OWST_DEVICE_NOT_FOUND if not device was found. Returns OWST_DEVICE_UNSUPPORTED if the firmware version is invalid. If this function returns OWST_OK, OWST_DEVICE_NOT_FOUND or OWST_DEVICE_UNSUPPORTED, values will be stored into newDevsp, numNewDevsp, removedDevsp and numRemovedDevsp.

Parameters
newDevsp[out] The pointer that receives the newly connected device handle. If no device was newly connected, returns NULL. Caller takes responsibility for releasing *newDevspp and each device handle stored in *newDevspp. OwLib_ReleaseArray() releases *newDevsp. OwLib_Release() releases each device handle stored in *newDevsp.
numNewDevsp[out] The pointer that receives the number of device handles stored into newDevsp.
removedDevsp[out] The pointer that receives the disconnected devices within oldDevs. If no device was detected as disconnected, returns NULL. Caller takes responsibility for releasing *removedDevsp. OwLib_ReleaseArray() releases *removedDevsp.
numRemovedDevsp[out] The pointer that receives the number of device handles stored into removedDevsp.
oldDevs[in] The device handles that are already connected. If NULL is specified, disconnected devices will not be detected.
numOldDevs[in] The number of device handles stored into oldDevs.
hep[out] See hep in OwLib_GetDevices().
Returns
The error code.

◆ OwLib_Reconnect()

OwStatus_t OwLib_Reconnect ( OwDev  dev)

Disconnect the device from the host and reconnect it by software operation. Type-F supports this function only after the firmware version 3.1.

Parameters
dev[in] The device handle.
Returns
The error code.

◆ OwLib_Release()

void OwLib_Release ( OwDev  dev)

Releases a device handle.

Parameters
dev[in] The device handle.

◆ OwLib_ReleaseArray()

void OwLib_ReleaseArray ( OwDev devs)

Releases an array of device handle. Each device handle stored in the array is not released.

Parameters
devs[in] The array of device handles.