#define intf_Eject(a,b) __intf_Eject(VLC_OBJECT(a),b)
VLC_EXPORT( int, __intf_Eject, ( vlc_object_t *, const char * ) );
+VLC_EXPORT( void, libvlc_Quit, ( libvlc_int_t * ) );
+
VLC_EXPORT( int, interaction_Register, ( intf_thread_t * ) );
VLC_EXPORT( int, interaction_Unregister, ( intf_thread_t * ) );
VLC_EXPORT (void, libvlc_InternalDestroy, ( libvlc_int_t * ) );
VLC_EXPORT (int, libvlc_InternalAddIntf, ( libvlc_int_t *, const char * ) );
+VLC_EXPORT (void, libvlc_InternalWait, ( libvlc_int_t * ) );
/***************************************************************************
* Opaque structures for libvlc API
/* Initialize mutexes */
vlc_mutex_init( &priv->timer_lock );
vlc_mutex_init( &priv->config_lock );
+ vlc_cond_init( &priv->exiting );
return p_libvlc;
}
msg_Destroy( p_libvlc );
/* Destroy mutexes */
+ vlc_cond_destroy( &priv->exiting );
vlc_mutex_destroy( &priv->config_lock );
vlc_mutex_destroy( &priv->timer_lock );
return VLC_SUCCESS;
};
+/**
+ * Waits until the LibVLC instance gets an exit signal. Normally, this happens
+ * when the user "exits" an interface plugin.
+ */
+void libvlc_InternalWait( libvlc_int_t *p_libvlc )
+{
+ libvlc_priv_t *priv = libvlc_priv( p_libvlc );
+ vlc_object_internals_t *internals = vlc_internals( p_libvlc );
+
+ vlc_object_lock( p_libvlc );
+ while( vlc_object_alive( p_libvlc ) )
+ vlc_cond_wait( &priv->exiting, &internals->lock );
+ vlc_object_unlock( p_libvlc );
+}
+
+/**
+ * Posts an exit signal to LibVLC instance. This will normally initiate the
+ * cleanup and destroy process. It should only be called on behalf of the user.
+ */
+void libvlc_Quit( libvlc_int_t *p_libvlc )
+{
+ libvlc_priv_t *priv = libvlc_priv( p_libvlc );
+
+ vlc_object_kill( p_libvlc );
+ vlc_cond_signal( &priv->exiting ); /* OK, kill took care of the lock */
+}
+
#if defined( ENABLE_NLS ) && (defined (__APPLE__) || defined (WIN32)) && \
( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) )
/*****************************************************************************