#include <vlc/vlc.h>
-#ifndef WIN32
-#include <X11/Xlib.h>
-#endif
-
# ifdef __cplusplus
extern "C" {
# endif
*/
libvlc_instance_t * libvlc_new( int , char **, libvlc_exception_t *);
+/**
+ * returns a libvlc instance identifier for legacy APIs
+ * \param p_instance the instance to destroy
+ */
+int libvlc_get_vlc_id( libvlc_instance_t *p_instance );
+
/**
* Destroy a libvlc instance
* \param p_instance the instance to destroy
int libvlc_video_destroy( libvlc_input_t *, libvlc_exception_t *);
-#ifndef WIN32
-int libvlc_video_reparent( libvlc_input_t *, Drawable, libvlc_exception_t * );
-#endif
+/**
+* Downcast to this general type as placeholder for a platform specific one, such as:
+* Drawable on X11,
+* CGrafPort on MacOSX,
+* HWND on win32
+*/
+typedef int libvlc_drawable_t;
+int libvlc_video_reparent( libvlc_input_t *, libvlc_drawable_t, libvlc_exception_t * );
/** @} */
case VOUT_REPARENT:
vlc_mutex_lock( &p_vout->p_sys->lock );
- d = va_arg( args, Drawable );
+ d = (Drawable)va_arg( args, int );
if ( !d )
XReparentWindow( p_vout->p_sys->p_display,
p_vout->p_sys->original_window.base_window,
char *psz_format, ... )
{
va_list args;
+
+ /* does caller care about exceptions ? */
+ if( p_exception == NULL )
+ return;
+
+ /* remove previous exception if it wasn't cleared */
+ if( p_exception->b_raised && p_exception->psz_message )
+ {
+ free(p_exception->psz_message);
+ p_exception->psz_message = NULL;
+ }
+
va_start( args, psz_format );
vasprintf( &p_exception->psz_message, psz_format, args );
va_end( args );
- if( p_exception == NULL ) return;
p_exception->b_raised = 1;
}
VLC_CleanUp( p_instance->i_vlc_id );
VLC_Destroy( p_instance->i_vlc_id );
}
+
+int libvlc_get_vlc_id( libvlc_instance_t *p_instance )
+{
+ return p_instance->i_vlc_id;
+}
+
}
-#ifndef WIN32
-int libvlc_video_reparent( libvlc_input_t *p_input, Drawable d,
+int libvlc_video_reparent( libvlc_input_t *p_input, libvlc_drawable_t d,
libvlc_exception_t *p_e )
{
vout_thread_t *p_vout = GetVout( p_input, p_e );
return 0;
}
-#endif
int libvlc_video_destroy( libvlc_input_t *p_input,
libvlc_exception_t *p_e )