i_angle );
}
- if( p_port->p_hwbuf->anwpriv.setup( p_port->p_hwbuf->window_priv,
- def->format.video.nFrameWidth,
- def->format.video.nFrameHeight,
- colorFormat,
- true,
- (int) i_hw_usage ) != 0 )
- {
- msg_Err( p_dec, "can't setup OMXHWBuffer" );
+ if( p_port->p_hwbuf->anwpriv.setUsage( p_port->p_hwbuf->window_priv,
+ true, (int) i_hw_usage ) != 0 )
+ {
+ msg_Err( p_dec, "can't set usage" );
+ goto error;
+ }
+ if( p_port->p_hwbuf->anwpriv.setBuffersGeometry( p_port->p_hwbuf->window_priv,
+ def->format.video.nFrameWidth,
+ def->format.video.nFrameHeight,
+ colorFormat ) != 0 )
+ {
+ msg_Err( p_dec, "can't set buffers geometry" );
goto error;
}
if (!p_window->p_handle_priv)
goto error;
- if (sys->anwp.setup(p_window->p_handle_priv,
- p_window->fmt.i_width, p_window->fmt.i_height,
- p_window->i_android_hal,
- false, 0) != 0)
+ if (sys->anwp.setUsage(p_window->p_handle_priv, false, 0) != 0)
+ goto error;
+
+ if (sys->anwp.setBuffersGeometry(p_window->p_handle_priv,
+ p_window->fmt.i_width,
+ p_window->fmt.i_height,
+ p_window->i_android_hal) != 0)
goto error;
sys->anwp.getMinUndequeued(p_window->p_handle_priv,
return 0;
}
-int ANativeWindowPriv_setup( native_window_priv *priv, int w, int h, int hal_format, bool is_hw, int hw_usage )
+int ANativeWindowPriv_setUsage( native_window_priv *priv, bool is_hw, int hw_usage )
{
status_t err;
- LOGD( "setup: %p, %d, %d, %X, %X\n",
- priv->anw, w, h, hal_format, hw_usage );
+ LOGD( "setUsage: %p, %d %X\n", priv->anw, is_hw, hw_usage );
if( is_hw )
{
err = native_window_set_usage( priv->anw, priv->usage );
CHECK_ERR();
+ return 0;
+}
+
+int ANativeWindowPriv_setBuffersGeometry( native_window_priv *priv, int w, int h, int hal_format )
+{
+ status_t err;
+
+ LOGD( "setBuffersGeometry: %p, %d, %d", priv->anw, w, h );
+
#if ANDROID_ICS_OR_LATER
err = native_window_set_buffers_format( priv->anw, hal_format );
CHECK_ERR();
{
native->connect = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_connect");
native->disconnect = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_disconnect");
- native->setup = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setup");
+ native->setUsage = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setUsage");
+ native->setBuffersGeometry = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setBuffersGeometry");
native->getMinUndequeued = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_getMinUndequeued");
native->getMaxBufferCount = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_getMaxBufferCount");
native->setBufferCount = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setBufferCount");
native->cancel = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_cancel");
native->setOrientation = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setOrientation");
- return native->connect && native->disconnect && native->setup &&
- native->getMinUndequeued && native->getMaxBufferCount &&
- native->setBufferCount && native->setCrop &&
+ return native->connect && native->disconnect && native->setUsage &&
+ native->setBuffersGeometry && native->getMinUndequeued &&
+ native->getMaxBufferCount && native->setBufferCount && native->setCrop &&
native->dequeue && native->lock && native->lockData && native->unlockData &&
native->queue && native->cancel && native->setOrientation ? 0 : -1;
}
typedef struct native_window_priv native_window_priv;
typedef native_window_priv *(*ptr_ANativeWindowPriv_connect) (void *);
typedef int (*ptr_ANativeWindowPriv_disconnect) (native_window_priv *);
-typedef int (*ptr_ANativeWindowPriv_setup) (native_window_priv *, int, int, int, bool, int );
+typedef int (*ptr_ANativeWindowPriv_setUsage) (native_window_priv *, bool, int );
+typedef int (*ptr_ANativeWindowPriv_setBuffersGeometry) (native_window_priv *, int, int, int );
typedef int (*ptr_ANativeWindowPriv_getMinUndequeued) (native_window_priv *, unsigned int *);
typedef int (*ptr_ANativeWindowPriv_getMaxBufferCount) (native_window_priv *, unsigned int *);
typedef int (*ptr_ANativeWindowPriv_setBufferCount) (native_window_priv *, unsigned int );
{
ptr_ANativeWindowPriv_connect connect;
ptr_ANativeWindowPriv_disconnect disconnect;
- ptr_ANativeWindowPriv_setup setup;
+ ptr_ANativeWindowPriv_setUsage setUsage;
+ ptr_ANativeWindowPriv_setBuffersGeometry setBuffersGeometry;
ptr_ANativeWindowPriv_getMinUndequeued getMinUndequeued;
ptr_ANativeWindowPriv_getMaxBufferCount getMaxBufferCount;
ptr_ANativeWindowPriv_setBufferCount setBufferCount;