WVR_GetMarkerObserverState¶
-
WVR_EXPORT WVR_Result WVR_GetMarkerObserverState(WVR_MarkerObserverTarget target, WVR_MarkerObserverState * state)
Function is used to get the corresponding marker observer target state.
Developers can inspect the marker observer state by polling WVR_GetMarkerObserverState. Check state (refer to WVR_MarkerObserverState) to know the current status.
- Version
- API Level 13
- Parameters
target
: input marker observer target , refer to WVR_MarkerObserverTargetstate
: the returned WVR_MarkerObserverState value
- Return Value
WVR_Success
: Get marker observer state successfully.others
: WVR_Result mean failure.
How to use¶
Sample function:
#include <wvr/wvr_marker.h>
if (WVR_StartMarker() == WVR_Success) {
// start marker observer
if (WVR_StartMarkerObserver(WVR_MarkerObserverTarget_Aruco) == WVR_Success) {
// Start Aruco marker observer related resources success
auto checkPassed = false;
WVR_MarkerObserverState state;
while(!checkPassed) {
if (WAVE_SUCCEEDED(WVR_GetMarkerObserverState(WVR_MarkerObserverTarget_Aruco, &state)) == false) {
LOGE("%s(%d) WVR_GetMarkerObserverState with WVR_MarkerObserverTarget_Aruco failed", __FUNCTION__, __LINE__);
} else {
if (state == WVR_MarkerObserverState_Idle) {
LOGI("%s(%d) WVR_GetMarkerObserverState with WVR_MarkerObserverTarget_Aruco checkPassed = true", __FUNCTION__, __LINE__);
checkPassed = true;
} else {
LOGI("%s(%d) WVR_GetMarkerObserverState with WVR_MarkerObserverTarget_Aruco checkPassed = false", __FUNCTION__, __LINE__);
}
}
// release Aruco marker observer related resources success
if (WVR_StopMarkerObserver(WVR_MarkerObserverTarget_Aruco) == WVR_Success) {
}
}
WVR_StopMarker();
} else {
// start marker failed!
}