* osd.h : Constants for use with osd modules
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: osd.h,v 1.6 2003/12/08 17:48:13 yoann Exp $
+ * $Id: osd.h,v 1.7 2004/02/15 18:22:26 sigmunau Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
VLC_EXPORT( subpicture_t *, vout_ShowTextRelative, ( vout_thread_t *, char *, text_style_t *, int, int, int, mtime_t ) );
VLC_EXPORT( void, vout_ShowTextAbsolute, ( vout_thread_t *, char *, text_style_t *, int, int, int, mtime_t, mtime_t ) );
-VLC_EXPORT( void, vout_OSDMessage, ( vlc_object_t *, char * ) );
+VLC_EXPORT( void, __vout_OSDMessage, ( vlc_object_t *, char *, ... ) );
+/**
+ * Same as __vlc_OSDMessage() but with automatic casting
+ */
+#if defined(HAVE_VARIADIC_MACROS)
+# define vout_OSDMessage( obj, fmt, args...) __vout_OSDMessage( VLC_OBJECT(obj), fmt, ## args )
+#else
+# define vout_OSDMessage __vout_OSDMessage
+#endif
* video_text.c : text manipulation functions
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
- * $Id: video_text.c,v 1.50 2004/01/06 12:02:06 zorglub Exp $
+ * $Id: video_text.c,v 1.51 2004/02/15 18:22:26 sigmunau Exp $
*
* Author: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
* \param p_caller The object that called the function.
* \param psz_string The text to be shown
**/
-void vout_OSDMessage( vlc_object_t *p_caller, char *psz_string )
+void __vout_OSDMessage( vlc_object_t *p_caller, char *psz_format, ... )
{
vout_thread_t *p_vout;
+ char *psz_string;
+ va_list args;
if( !config_GetInt( p_caller, "osd" ) ) return;
if( p_vout )
{
+ va_start( args, psz_format );
+ vasprintf( &psz_string, psz_format, args );
vlc_mutex_lock( &p_vout->change_lock );
if( p_vout->p_last_osd_message )
vlc_mutex_unlock( &p_vout->change_lock );
vlc_object_release( p_vout );
+ free( psz_string );
+ va_end( args );
}
}