#include "video.h"
#include "video_output.h"
#include "video_text.h"
+#include "video_spu.h"
#include "video_yuv.h"
#include "intf_msg.h"
/* Load fonts - fonts must be initialized after the system method since
* they may be dependant on screen depth and other thread properties */
- p_vout->p_default_font = vout_LoadFont( VOUT_DEFAULT_FONT );
+ p_vout->p_default_font = vout_LoadFont( DATA_PATH "/" VOUT_DEFAULT_FONT );
+ if( p_vout->p_default_font == NULL )
+ {
+ p_vout->p_default_font = vout_LoadFont( "share/" VOUT_DEFAULT_FONT );
+ }
if( p_vout->p_default_font == NULL )
{
p_vout->p_sys_destroy( p_vout );
free( p_vout );
return( NULL );
}
- p_vout->p_large_font = vout_LoadFont( VOUT_LARGE_FONT );
+ p_vout->p_large_font = vout_LoadFont( DATA_PATH "/" VOUT_LARGE_FONT );
+ if( p_vout->p_large_font == NULL )
+ {
+ p_vout->p_large_font = vout_LoadFont( "share/" VOUT_LARGE_FONT );
+ }
if( p_vout->p_large_font == NULL )
{
vout_UnloadFont( p_vout->p_default_font );
if( (p_vout->p_subpicture[i_subpic].i_type == i_type) &&
(p_vout->p_subpicture[i_subpic].i_size >= i_size) )
{
- /* Memory size do match or is smaller : memory will not be reallocated,
- * and function can end immediately - this is the best possible case,
- * since no memory allocation needs to be done */
+ /* Memory size do match or is smaller : memory will not be
+ * reallocated, and function can end immediately - this is
+ * the best possible case, since no memory allocation needs
+ * to be done */
p_vout->p_subpicture[i_subpic].i_status = RESERVED_SUBPICTURE;
#ifdef DEBUG_VIDEO
intf_DbgMsg("subpicture %p (in destroyed subpicture slot)\n",
/* If no free subpicture is available, use a destroyed subpicture */
if( (p_free_subpic == NULL) && (p_destroyed_subpic != NULL ) )
{
- /* No free subpicture or matching destroyed subpicture has been found, but
- * a destroyed subpicture is still avalaible */
+ /* No free subpicture or matching destroyed subpicture has been
+ * found, but a destroyed subpicture is still avalaible */
free( p_destroyed_subpic->p_data );
p_free_subpic = p_destroyed_subpic;
}
case TEXT_SUBPICTURE: /* text subpicture */
p_free_subpic->p_data = malloc( i_size + 1 );
break;
+ case DVD_SUBPICTURE: /* DVD subpicture unit */
+ p_free_subpic->p_data = malloc( i_size );
+ break;
#ifdef DEBUG
default:
intf_DbgMsg("error: unknown subpicture type %d\n", i_type );
}
if( p_free_subpic->p_data != NULL )
- { /* Copy subpicture informations, set some default values */
+ { /* Copy subpicture informations, set some default values */
p_free_subpic->i_type = i_type;
p_free_subpic->i_status = RESERVED_SUBPICTURE;
p_free_subpic->i_size = i_size;
#endif
if( display_date > current_date + VOUT_DISPLAY_DELAY )
{
- /* A picture is ready to be rendered, but its rendering date is
- * far from the current one so the thread will perform an empty loop
- * as if no picture were found. The picture state is unchanged */
+ /* A picture is ready to be rendered, but its rendering date
+ * is far from the current one so the thread will perform an
+ * empty loop as if no picture were found. The picture state
+ * is unchanged */
p_pic = NULL;
display_date = 0;
}
}
}
/*
- * Find the subpicture to display - this operation does not need lock, since
- * only READY_SUBPICTURES are handled. If no picture has been selected,
- * display_date will depend on the subpicture
+ * Find the subpictures to display - this operation does not need
+ * lock, since only READY_SUBPICTURE are handled. If no picture
+ * has been selected, display_date will depend on the subpicture
*/
- /* XXX?? */
+ /* FIXME: we should find *all* subpictures to display, and
+ * check their displaying date as well */
+ for( i_index = 0; i_index < VOUT_MAX_PICTURES; i_index++ )
+ {
+ if( p_vout->p_subpicture[i_index].i_status == READY_SUBPICTURE )
+ {
+ p_subpic = &p_vout->p_subpicture[i_index];
+ break;
+ }
+ }
/*
* Perform rendering, sleep and display rendered picture
}
/* Remove subpicture from heap */
- vlc_mutex_lock( &p_vout->subpicture_lock );
+ /*vlc_mutex_lock( &p_vout->subpicture_lock );
p_subpic->i_status = DESTROYED_SUBPICTURE;
- vlc_mutex_unlock( &p_vout->subpicture_lock );
+ vlc_mutex_unlock( &p_vout->subpicture_lock );*/
}
}
+#if 0
else if( p_subpic ) /* subpicture alone */
{
b_display = p_vout->b_active;
}
/* Remove subpicture from heap */
- vlc_mutex_lock( &p_vout->subpicture_lock );
+ /*vlc_mutex_lock( &p_vout->subpicture_lock );
p_subpic->i_status = DESTROYED_SUBPICTURE;
- vlc_mutex_unlock( &p_vout->subpicture_lock );
+ vlc_mutex_unlock( &p_vout->subpicture_lock );*/
}
+#endif
else if( p_vout->b_active ) /* idle or interface screen alone */
{
if( p_vout->b_interface && 0 /* && XXX?? intf_change */ )
/*****************************************************************************
* EndThread: thread destruction
*****************************************************************************
- * This function is called when the thread ends after a sucessfull
+ * This function is called when the thread ends after a sucessful
* initialization. It frees all ressources allocated by InitThread.
*****************************************************************************/
static void EndThread( vout_thread_t *p_vout )
switch( p_subpic->i_type )
{
+ case DVD_SUBPICTURE: /* DVD subpicture unit */
+ vout_RenderSPU( p_subpic->p_data, p_subpic->type.spu.i_offset,
+ p_subpic->type.spu.i_x1, p_subpic->type.spu.i_y1,
+ p_vout->p_buffer[ p_vout->i_buffer_index ].p_data,
+ p_vout->i_bytes_per_pixel, p_vout->i_bytes_per_line );
+ break;
case TEXT_SUBPICTURE: /* single line text */
/* Select default font if not specified */
p_font = p_subpic->type.text.p_font;
p_font = p_vout->p_default_font;
}
- /* Computes text size (width and height fields are ignored) and print it */
+ /* Compute text size (width and height fields are ignored)
+ * and print it */
vout_TextSize( p_font, p_subpic->type.text.i_style, p_subpic->p_data, &i_width, &i_height );
if( !Align( p_vout, &p_subpic->i_x, &p_subpic->i_y, i_width, i_height,
p_subpic->i_horizontal_align, p_subpic->i_vertical_align ) )