![]() |
PVCAM
3.9.x
Programmable Virtual Camera Access Method library
|
Each function of PVCAM API with the exception of pl_error_code returns either PV_OK
or PV_FAIL
depending on the outcome of the function call. If the call is successful, the function will return PV_OK
and if the call is unsuccessful, PV_FAIL
will be returned.
PV_OK
or PV_FAIL
values.Both functions work before pl_pvcam_init is called. This allows an error message to be returned if pl_pvcam_init fails.
If a PVCAM function call fails, PVCAM generates an error code with a message describing the error. The message may contain a dynamic part with extra details if a platform-specific call or a call to driver layer fails. Please, bear in mind that each PVCAM function call resets the error code. As a consequence, if a call fails and another function is called before retrieving the error code, the previous error code will be lost. This also applies to dynamic part of the error message with additional details.
When PVCAM is accessed from multiple threads simultaneously, it is recommended to lock the PVCAM API calls and error code retrieval function with a mutex as in the following example. This ensures that the error code is not reset by another call to PVCAM API from a different thread.