return OMX_ErrorUndefined;
return OMX_ErrorNone;
}
+
+OMX_ERRORTYPE PREFIX(OMXAndroid_GetHalFormat)( const char *comp_name, int* hal_format )
+{
+ if( !strncmp( comp_name, "OMX.SEC.", 8 ) ) {
+ switch( *hal_format ) {
+ case OMX_COLOR_FormatYUV420SemiPlanar:
+ *hal_format = 0x105; // HAL_PIXEL_FORMAT_YCbCr_420_SP
+ break;
+ case OMX_COLOR_FormatYUV420Planar:
+ *hal_format = 0x101; // HAL_PIXEL_FORMAT_YCbCr_420_P
+ break;
+ }
+ }
+ else if( !strcmp( comp_name, "OMX.TI.720P.Decoder" ) ||
+ !strcmp( comp_name, "OMX.TI.Video.Decoder" ) )
+ *hal_format = 0x14; // HAL_PIXEL_FORMAT_YCbCr_422_I
+#if ANDROID_API <= 13 // Required on msm8660 on 3.2, not required on 4.1
+ else if( !strcmp( comp_name, "OMX.qcom.video.decoder.avc" ))
+ *hal_format = 0x108;
+#endif
+
+ return OMX_ErrorNone;
+}
+
#endif
}
msg_Dbg( p_dec, "HwBuffer_Init");
if( !(pf_enable_graphic_buffers && pf_get_graphic_buffer_usage &&
- pf_omx_hwbuffer_connect && pf_omx_hwbuffer_disconnect &&
- pf_omx_hwbuffer_setup && pf_omx_hwbuffer_get_min_undequeued &&
- pf_omx_hwbuffer_set_buffer_count && pf_omx_hwbuffer_setcrop &&
- pf_omx_hwbuffer_dequeue && pf_omx_hwbuffer_lock &&
- pf_omx_hwbuffer_queue && pf_omx_hwbuffer_cancel &&
- pf_omx_hwbuffer_get_hal_format &&
+ pf_get_hal_format &&
((OMX_COMPONENTTYPE*)p_port->omx_handle)->UseBuffer) )
{
msg_Warn( p_dec, "direct output port enabled but can't find "
msg_Warn( p_dec, "LoadNativeWindowAPI failed" );
goto error;
}
+ if( LoadNativeWindowPrivAPI( &p_port->p_hwbuf->anwpriv ) != 0 )
+ {
+ msg_Warn( p_dec, "LoadNativeWindowPrivAPI failed" );
+ goto error;
+ }
surf = jni_LockAndGetAndroidJavaSurface();
if( !surf ) {
msg_Warn( p_dec, "winFromSurface failed" );
goto error;
}
- pf_omx_hwbuffer_connect( p_port->p_hwbuf->window );
+ p_port->p_hwbuf->anwpriv.connect( p_port->p_hwbuf->window );
omx_error = pf_enable_graphic_buffers( p_port->omx_handle,
p_port->i_port_index, OMX_TRUE );
HwBuffer_Stop( p_dec, p_port );
HwBuffer_FreeBuffers( p_dec, p_port );
HwBuffer_Join( p_dec, p_port );
- pf_omx_hwbuffer_disconnect( p_port->p_hwbuf->window );
+ p_port->p_hwbuf->anwpriv.disconnect( p_port->p_hwbuf->window );
pf_enable_graphic_buffers( p_port->omx_handle,
p_port->i_port_index, OMX_FALSE );
p_port->p_hwbuf->native_window.winRelease( p_port->p_hwbuf->window );
if( !p_port->p_hwbuf )
return 0;
- omx_error = pf_omx_hwbuffer_get_hal_format( p_sys->psz_component, &colorFormat );
+ omx_error = pf_get_hal_format( p_sys->psz_component, &colorFormat );
if( omx_error != OMX_ErrorNone )
{
- msg_Warn( p_dec, "pf_omx_hwbuffer_get_hal_format failed (Not fatal)" );
+ msg_Warn( p_dec, "pf_get_hal_format failed (Not fatal)" );
}
omx_error = pf_get_graphic_buffer_usage( p_port->omx_handle,
i_hw_usage = 0;
}
- if( pf_omx_hwbuffer_setup( p_port->p_hwbuf->window,
- def->format.video.nFrameWidth,
- def->format.video.nFrameHeight,
- colorFormat,
- (int) i_hw_usage ) != 0 )
+ if( p_port->p_hwbuf->anwpriv.setup( p_port->p_hwbuf->window,
+ def->format.video.nFrameWidth,
+ def->format.video.nFrameHeight,
+ colorFormat,
+ (int) i_hw_usage ) != 0 )
{
msg_Err( p_dec, "can't setup OMXHWBuffer" );
goto error;
}
- if( pf_omx_hwbuffer_get_min_undequeued( p_port->p_hwbuf->window,
- &min_undequeued ) != 0 )
+ if( p_port->p_hwbuf->anwpriv.getMinUndequeued( p_port->p_hwbuf->window,
+ &min_undequeued ) != 0 )
{
msg_Err( p_dec, "can't get min_undequeued" );
goto error;
omx_error, ErrorToString(omx_error) );
}
- if( pf_omx_hwbuffer_set_buffer_count( p_port->p_hwbuf->window,
- def->nBufferCountActual ) != 0 )
+ if( p_port->p_hwbuf->anwpriv.setBufferCount( p_port->p_hwbuf->window,
+ def->nBufferCountActual ) != 0 )
{
msg_Err( p_dec, "can't set buffer_count" );
goto error;
{
void *p_handle = NULL;
- if( pf_omx_hwbuffer_dequeue( p_port->p_hwbuf->window, &p_handle ) != 0 )
+ if( p_port->p_hwbuf->anwpriv.dequeue( p_port->p_hwbuf->window,
+ &p_handle ) != 0 )
{
msg_Err( p_dec, "OMXHWBuffer_dequeue Fail" );
goto error;
for(; i < p_port->p_hwbuf->i_buffers; i++)
{
OMX_DBG( "canceling buffer(%d)", i );
- pf_omx_hwbuffer_cancel( p_port->p_hwbuf->window,
- p_port->p_hwbuf->pp_handles[i] );
+ p_port->p_hwbuf->anwpriv.cancel( p_port->p_hwbuf->window,
+ p_port->p_hwbuf->pp_handles[i] );
}
return 0;
if( p_handle && p_port->p_hwbuf->i_states[i] == BUF_STATE_OWNED )
{
- pf_omx_hwbuffer_cancel( p_port->p_hwbuf->window, p_handle );
+ p_port->p_hwbuf->anwpriv.cancel( p_port->p_hwbuf->window, p_handle );
HwBuffer_ChangeState( p_dec, p_port, i, BUF_STATE_NOT_OWNED );
}
}
if( p_header && p_port->p_hwbuf->i_states[i] == BUF_STATE_OWNED )
{
- if( pf_omx_hwbuffer_lock( p_port->p_hwbuf->window,
- p_header->pBuffer ) != 0 )
+ if( p_port->p_hwbuf->anwpriv.lock( p_port->p_hwbuf->window,
+ p_header->pBuffer ) != 0 )
{
msg_Err( p_dec, "lock failed" );
HWBUFFER_UNLOCK();
/*****************************************************************************
* HwBuffer_Stop: stop DequeueThread and invalidate all pictures that are sent
- * to vlc core. The thread can be stuck in pf_omx_hwbuffer_dequeue, so don't
+ * to vlc core. The thread can be stuck in dequeue, so don't
* join it now since it can be unblocked later by HwBuffer_FreeBuffers.
*****************************************************************************/
static int HwBuffer_Stop( decoder_t *p_dec, OmxPort *p_port )
void *p_handle = p_port->pp_buffers[p_picsys->i_index]->pBuffer;
if( p_handle )
{
- pf_omx_hwbuffer_cancel( p_port->p_hwbuf->window, p_handle );
+ p_port->p_hwbuf->anwpriv.cancel( p_port->p_hwbuf->window, p_handle );
HwBuffer_ChangeState( p_dec, p_port, p_picsys->i_index,
BUF_STATE_NOT_OWNED );
}
{
VLC_UNUSED( p_dec );
- pf_omx_hwbuffer_setcrop( p_port->p_hwbuf->window,
- p_rect->nLeft, p_rect->nTop,
- p_rect->nWidth, p_rect->nHeight );
+ p_port->p_hwbuf->anwpriv.setCrop( p_port->p_hwbuf->window,
+ p_rect->nLeft, p_rect->nTop,
+ p_rect->nWidth, p_rect->nHeight );
}
/*****************************************************************************
/* The thread can be stuck here. It shouldn't happen since we make sure
* we call the dequeue function if there is at least one buffer
* available. */
- err = pf_omx_hwbuffer_dequeue( p_port->p_hwbuf->window, &p_handle );
+ err = p_port->p_hwbuf->anwpriv.dequeue( p_port->p_hwbuf->window, &p_handle );
if( err == 0 )
- err = pf_omx_hwbuffer_lock( p_port->p_hwbuf->window, p_handle );
+ err = p_port->p_hwbuf->anwpriv.lock( p_port->p_hwbuf->window, p_handle );
HWBUFFER_LOCK();
if( !p_port->p_hwbuf->b_run )
{
- pf_omx_hwbuffer_cancel( p_port->p_hwbuf->window, p_handle );
+ p_port->p_hwbuf->anwpriv.cancel( p_port->p_hwbuf->window, p_handle );
continue;
}
}
if( i_index == -1 )
{
- msg_Err( p_dec, "pf_omx_hwbuffer_dequeue returned unknown handle" );
+ msg_Err( p_dec, "p_port->p_hwbuf->anwpriv.dequeue returned unknown handle" );
continue;
}
}
if( b_render )
- pf_omx_hwbuffer_queue( p_port->p_hwbuf->window, p_handle );
+ p_port->p_hwbuf->anwpriv.queue( p_port->p_hwbuf->window, p_handle );
else
- pf_omx_hwbuffer_cancel( p_port->p_hwbuf->window, p_handle );
+ p_port->p_hwbuf->anwpriv.cancel( p_port->p_hwbuf->window, p_handle );
HwBuffer_ChangeState( p_dec, p_port, p_picsys->i_index, BUF_STATE_NOT_OWNED );
HWBUFFER_BROADCAST( p_port );
void *window;
#if defined(USE_IOMX)
native_window_api_t native_window;
+ native_window_priv_api_t anwpriv;
#endif
} HwBuffer;
OMX_ERRORTYPE (*pf_get_roles_of_component)(OMX_STRING, OMX_U32 *, OMX_U8 **);
OMX_ERRORTYPE (*pf_enable_graphic_buffers)(OMX_HANDLETYPE, OMX_U32, OMX_BOOL);
OMX_ERRORTYPE (*pf_get_graphic_buffer_usage)(OMX_HANDLETYPE, OMX_U32, OMX_U32*);
-
-int (*pf_omx_hwbuffer_connect) (void *);
-int (*pf_omx_hwbuffer_disconnect) (void *);
-int (*pf_omx_hwbuffer_get_hal_format) (const char *, int *);
-int (*pf_omx_hwbuffer_setup) (void *, int, int, int, int );
-int (*pf_omx_hwbuffer_get_min_undequeued) (void *, unsigned int *);
-int (*pf_omx_hwbuffer_set_buffer_count) (void *, unsigned int );
-int (*pf_omx_hwbuffer_setcrop) (void *, int, int, int, int);
-int (*pf_omx_hwbuffer_dequeue) (void *, void **);
-int (*pf_omx_hwbuffer_lock) (void *, void *);
-int (*pf_omx_hwbuffer_queue) (void *, void *);
-int (*pf_omx_hwbuffer_cancel) (void *, void *);
+OMX_ERRORTYPE (*pf_get_hal_format) (const char *, int *);
#ifdef RPI_OMX
static void *extra_dll_handle;
#if defined(USE_IOMX)
pf_enable_graphic_buffers = dlsym( dll_handle, "OMXAndroid_EnableGraphicBuffers" );
pf_get_graphic_buffer_usage = dlsym( dll_handle, "OMXAndroid_GetGraphicBufferUsage" );
-
- pf_omx_hwbuffer_connect = dlsym( dll_handle, "OMXHWBuffer_Connect" );
- pf_omx_hwbuffer_disconnect = dlsym( dll_handle, "OMXHWBuffer_Disconnect" );
- pf_omx_hwbuffer_get_hal_format = dlsym( dll_handle, "OMXHWBuffer_GetHalFormat" );
- pf_omx_hwbuffer_setup = dlsym( dll_handle, "OMXHWBuffer_Setup" );
- pf_omx_hwbuffer_get_min_undequeued = dlsym( dll_handle, "OMXHWBuffer_GetMinUndequeued" );
- pf_omx_hwbuffer_set_buffer_count = dlsym( dll_handle, "OMXHWBuffer_SetBufferCount" );
- pf_omx_hwbuffer_setcrop = dlsym( dll_handle, "OMXHWBuffer_Setcrop" );
- pf_omx_hwbuffer_dequeue = dlsym( dll_handle, "OMXHWBuffer_Dequeue" );
- pf_omx_hwbuffer_lock = dlsym( dll_handle, "OMXHWBuffer_Lock" );
- pf_omx_hwbuffer_queue = dlsym( dll_handle, "OMXHWBuffer_Queue" );
- pf_omx_hwbuffer_cancel = dlsym( dll_handle, "OMXHWBuffer_Cancel" );
+ pf_get_hal_format = dlsym( dll_handle, "OMXAndroid_GetHalFormat" );
#endif
/* Initialise the OMX core */
/* Extra IOMX android functions. Can be NULL if we don't link with libiomx */
OMX_ERRORTYPE (*pf_enable_graphic_buffers)(OMX_HANDLETYPE, OMX_U32, OMX_BOOL);
OMX_ERRORTYPE (*pf_get_graphic_buffer_usage)(OMX_HANDLETYPE, OMX_U32, OMX_U32*);
-
-/* OMXHWBuffer functions */
-int (*pf_omx_hwbuffer_connect) (void *);
-int (*pf_omx_hwbuffer_disconnect) (void *);
-int (*pf_omx_hwbuffer_get_hal_format) (const char *, int *);
-int (*pf_omx_hwbuffer_setup) (void *, int, int, int, int );
-int (*pf_omx_hwbuffer_get_min_undequeued) (void *, unsigned int *);
-int (*pf_omx_hwbuffer_set_buffer_count) (void *, unsigned int );
-int (*pf_omx_hwbuffer_setcrop) (void *, int, int, int, int);
-int (*pf_omx_hwbuffer_dequeue) (void *, void **);
-int (*pf_omx_hwbuffer_lock) (void *, void *);
-int (*pf_omx_hwbuffer_queue) (void *, void *);
-int (*pf_omx_hwbuffer_cancel) (void *, void *);
+OMX_ERRORTYPE (*pf_get_hal_format) (const char *, int *);
int InitOmxCore(vlc_object_t *p_this);
void DeinitOmxCore(void);
/*****************************************************************************
- * iomx_hwbuffer.c: Wrapper to android native window api used for IOMX
+ * nativewindowpriv.c: Wrapper to android native window private api
*****************************************************************************
* Copyright (C) 2011 VLC authors and VideoLAN
*
#include <errno.h>
#include <stdio.h>
-#include <OMX_Core.h>
-#include <OMX_Component.h>
-
#if ANDROID_API <= 13
#include <ui/android_native_buffer.h>
#include <ui/egl/android_natives.h>
typedef android_native_buffer_t ANativeWindowBuffer_t;
#endif
-#define LOG_TAG "VLC/IOMX"
+#define LOG_TAG "VLC/ANW"
#define LOGD(...) __android_log_print( ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__ )
#define LOGE(...) __android_log_print( ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__ )
#define CHECK_ERR() do {\
if( err != NO_ERROR ) {\
- LOGE( "IOMXHWBuffer: error %d in %s line %d\n", err, __FUNCTION__, __LINE__ );\
+ LOGE( "error %d in %s line %d\n", err, __FUNCTION__, __LINE__ );\
return err;\
}\
} while (0)
#define CHECK_ANW() do {\
if( anw->common.magic != ANDROID_NATIVE_WINDOW_MAGIC &&\
anw->common.version != sizeof(ANativeWindow) ) {\
- LOGE( "IOMXHWBuffer: error, window not valid\n" );\
+ LOGE( "error, window not valid\n" );\
return -EINVAL;\
}\
} while (0)
#define CHECK_ANB() do {\
if( anb->common.magic != ANDROID_NATIVE_BUFFER_MAGIC &&\
anb->common.version != sizeof(ANativeWindowBuffer_t) ) {\
- LOGE( "IOMXHWBuffer: error, buffer not valid\n" );\
+ LOGE( "error, buffer not valid\n" );\
return -EINVAL;\
}\
} while (0)
-int IOMXHWBuffer_Connect( void *window )
+int ANativeWindowPriv_connect( void *window )
{
ANativeWindow *anw = (ANativeWindow *)window;
CHECK_ANW();
#endif
}
-int IOMXHWBuffer_Disconnect( void *window )
+int ANativeWindowPriv_disconnect( void *window )
{
ANativeWindow *anw = (ANativeWindow *)window;
return 0;
}
-
-int IOMXHWBuffer_GetHalFormat( const char *comp_name, int* hal_format )
-{
- if( !strncmp( comp_name, "OMX.SEC.", 8 ) ) {
- switch( *hal_format ) {
- case OMX_COLOR_FormatYUV420SemiPlanar:
- *hal_format = 0x105; // HAL_PIXEL_FORMAT_YCbCr_420_SP
- break;
- case OMX_COLOR_FormatYUV420Planar:
- *hal_format = 0x101; // HAL_PIXEL_FORMAT_YCbCr_420_P
- break;
- }
- }
- else if( !strcmp( comp_name, "OMX.TI.720P.Decoder" ) ||
- !strcmp( comp_name, "OMX.TI.Video.Decoder" ) )
- *hal_format = 0x14; // HAL_PIXEL_FORMAT_YCbCr_422_I
-#if ANDROID_API <= 13 // Required on msm8660 on 3.2, not required on 4.1
- else if( !strcmp( comp_name, "OMX.qcom.video.decoder.avc" ))
- *hal_format = 0x108;
-#endif
-
- return 0;
-}
-
-int IOMXHWBuffer_Setup( void *window, int w, int h, int hal_format, int hw_usage )
+int ANativeWindowPriv_setup( void *window, int w, int h, int hal_format, int hw_usage )
{
ANativeWindow *anw = (ANativeWindow *)window;
int usage = 0;
CHECK_ANW();
- LOGD( "IOMXHWBuffer_setup: %p, %d, %d, %X, %X\n",
+ LOGD( "setup: %p, %d, %d, %X, %X\n",
anw, w, h, hal_format, hw_usage );
usage |= hw_usage | GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE;
return 0;
}
-int IOMXHWBuffer_GetMinUndequeued( void *window, unsigned int *min_undequeued )
+int ANativeWindowPriv_getMinUndequeued( void *window, unsigned int *min_undequeued )
{
ANativeWindow *anw = (ANativeWindow *)window;
status_t err;
if( *min_undequeued == 0 )
*min_undequeued = 2;
- LOGD( "IOMXHWBuffer_GetMinUndequeued: %p %u", anw, *min_undequeued );
+ LOGD( "getMinUndequeued: %p %u", anw, *min_undequeued );
return 0;
}
-int IOMXHWBuffer_SetBufferCount(void *window, unsigned int count )
+int ANativeWindowPriv_setBufferCount(void *window, unsigned int count )
{
ANativeWindow *anw = (ANativeWindow *)window;
status_t err;
CHECK_ANW();
- LOGD( "IOMXHWBuffer_SetBufferCount: %p %u", anw, count );
+ LOGD( "setBufferCount: %p %u", anw, count );
err = native_window_set_buffer_count( anw, count );
CHECK_ERR();
return 0;
}
-int IOMXHWBuffer_Setcrop( void *window, int ofs_x, int ofs_y, int w, int h )
+int ANativeWindowPriv_setCrop( void *window, int ofs_x, int ofs_y, int w, int h )
{
ANativeWindow *anw = (ANativeWindow *)window;
android_native_rect_t crop;
return native_window_set_crop( anw, &crop );
}
-int IOMXHWBuffer_Dequeue( void *window, void **pp_handle )
+int ANativeWindowPriv_dequeue( void *window, void **pp_handle )
{
ANativeWindow *anw = (ANativeWindow *)window;
ANativeWindowBuffer_t *anb;
return 0;
}
-int IOMXHWBuffer_Lock( void *window, void *p_handle )
+int ANativeWindowPriv_lock( void *window, void *p_handle )
{
ANativeWindow *anw = (ANativeWindow *)window;
ANativeWindowBuffer_t *anb = (ANativeWindowBuffer_t *)p_handle;
return 0;
}
-int IOMXHWBuffer_Queue( void *window, void *p_handle )
+int ANativeWindowPriv_queue( void *window, void *p_handle )
{
ANativeWindow *anw = (ANativeWindow *)window;
ANativeWindowBuffer_t *anb = (ANativeWindowBuffer_t *)p_handle;
return 0;
}
-int IOMXHWBuffer_Cancel( void *window, void *p_handle )
+int ANativeWindowPriv_cancel( void *window, void *p_handle )
{
ANativeWindow *anw = (ANativeWindow *)window;
ANativeWindowBuffer_t *anb = (ANativeWindowBuffer_t *)p_handle;
return NULL;
}
+int LoadNativeWindowPrivAPI(native_window_priv_api_t *native)
+{
+ native->connect = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_connect");
+ native->disconnect = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_disconnect");
+ native->setup = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setup");
+ native->getMinUndequeued = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_getMinUndequeued");
+ native->setBufferCount = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setBufferCount");
+ native->setCrop = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setCrop");
+ native->dequeue = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_dequeue");
+ native->lock = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_lock");
+ native->queue = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_queue");
+ native->cancel = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_cancel");
+
+ return native->connect && native->disconnect && native->setup &&
+ native->getMinUndequeued && native->setBufferCount && native->setCrop &&
+ native->dequeue && native->lock && native->queue && native->cancel
+ ? 0 : -1;
+}
+
extern void jni_getMouseCoordinates(int *, int *, int *, int *);
void Manage(vout_display_t *vd)
that should be destroyed with dlclose. */
void *LoadNativeWindowAPI(native_window_api_t *native);
void Manage(vout_display_t *);
+
+typedef int (*ptr_ANativeWindowPriv_connect) (void *);
+typedef int (*ptr_ANativeWindowPriv_disconnect) (void *);
+typedef int (*ptr_ANativeWindowPriv_setup) (void *, int, int, int, int );
+typedef int (*ptr_ANativeWindowPriv_getMinUndequeued) (void *, unsigned int *);
+typedef int (*ptr_ANativeWindowPriv_setBufferCount) (void *, unsigned int );
+typedef int (*ptr_ANativeWindowPriv_setCrop) (void *, int, int, int, int);
+typedef int (*ptr_ANativeWindowPriv_dequeue) (void *, void **);
+typedef int (*ptr_ANativeWindowPriv_lock) (void *, void *);
+typedef int (*ptr_ANativeWindowPriv_queue) (void *, void *);
+typedef int (*ptr_ANativeWindowPriv_cancel) (void *, void *);
+typedef struct
+{
+ ptr_ANativeWindowPriv_connect connect;
+ ptr_ANativeWindowPriv_disconnect disconnect;
+ ptr_ANativeWindowPriv_setup setup;
+ ptr_ANativeWindowPriv_getMinUndequeued getMinUndequeued;
+ ptr_ANativeWindowPriv_setBufferCount setBufferCount;
+ ptr_ANativeWindowPriv_setCrop setCrop;
+ ptr_ANativeWindowPriv_dequeue dequeue;
+ ptr_ANativeWindowPriv_lock lock;
+ ptr_ANativeWindowPriv_queue queue;
+ ptr_ANativeWindowPriv_cancel cancel;
+} native_window_priv_api_t;
+
+/* Fill the structure passed as parameter and return 0 if all symbols are
+ found. Don't need to call dlclose, the lib is already loaded. */
+int LoadNativeWindowPrivAPI(native_window_priv_api_t *native);