set_category( CAT_INTERFACE )
set_subcategory( SUBCAT_INTERFACE_MAIN )
- add_file( "fbosd-dev", "/dev/fb1", NULL, DEVICE_TEXT, DEVICE_LONGTEXT,
+ add_file( "fbosd-dev", "/dev/fb0", NULL, DEVICE_TEXT, DEVICE_LONGTEXT,
false )
add_string( "fbosd-aspect-ratio", "", NULL, ASPECT_RATIO_TEXT,
ASPECT_RATIO_LONGTEXT, true )
int i;
/* Allocate instance and initialize some members */
- p_intf->p_sys = p_sys = malloc( sizeof( intf_sys_t ) );
+ p_intf->p_sys = p_sys = calloc( 1, sizeof( intf_sys_t ) );
if( !p_intf->p_sys )
return VLC_ENOMEM;
- memset( p_sys, 0, sizeof(intf_sys_t) );
p_sys->p_style = malloc( sizeof( text_style_t ) );
if( !p_sys->p_style )
p_sys->p_image = image_HandlerCreate( p_this );
if( !p_sys->p_image )
{
- free( p_intf->p_sys->p_style );
- free( p_intf->p_sys );
+ free( p_sys->p_style );
+ free( p_sys );
return VLC_ENOMEM;
}
atoi( psz_aspect ), atoi( psz_parser ) );
free( psz_aspect );
- psz_aspect = NULL;
}
/* Use PAL by default */
static void Destroy( vlc_object_t *p_this )
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
- intf_sys_t *p_sys = (intf_sys_t *) p_intf->p_sys;
+ intf_sys_t *p_sys = p_intf->p_sys;
int i;
+
p_sys->b_need_update = false;
p_sys->b_render = false;
p_sys->b_clear = false;
static void SetOverlayTransparency( intf_thread_t *p_intf,
bool b_transparent )
{
- intf_sys_t *p_sys = (intf_sys_t *) p_intf->p_sys;
+ intf_sys_t *p_sys = p_intf->p_sys;
size_t i_size = p_sys->fmt_out.i_width * p_sys->fmt_out.i_height
* p_sys->i_bytes_per_pixel;
size_t i_page_size = (p_sys->i_page_size > i_size) ?
video_format_t *p_fmt_dst, picture_t *p_pic_src,
picture_t *p_pic_dst )
{
- intf_sys_t *p_sys = (intf_sys_t *) p_intf->p_sys;
+ intf_sys_t *p_sys = p_intf->p_sys;
if( p_sys->p_blend && p_sys->p_blend->p_module )
{
int i_x_offset = p_sys->i_x;
static picture_t *RenderText( intf_thread_t *p_intf, const char *psz_string,
text_style_t *p_style, video_format_t *p_fmt )
{
- intf_sys_t *p_sys = (intf_sys_t *) p_intf->p_sys;
+ intf_sys_t *p_sys = p_intf->p_sys;
subpicture_region_t *p_region;
picture_t *p_dest = NULL;
picture_Copy( p_dest, p_region->p_picture );
#else
fmt_out.i_chroma = p_fmt->i_chroma;
- p_dest = ConvertImage( p_intf, &p_region->p_picture,
+ p_dest = ConvertImage( p_intf, p_region->p_picture,
&p_region->fmt, &fmt_out );
#endif
subpicture_region_Delete( p_region );
static picture_t *ConvertImage( intf_thread_t *p_intf, picture_t *p_pic,
video_format_t *p_fmt_in, video_format_t *p_fmt_out )
{
- intf_sys_t *p_sys = (intf_sys_t *) p_intf->p_sys;
+ intf_sys_t *p_sys = p_intf->p_sys;
picture_t *p_old = NULL;
if( p_sys->p_image )
*****************************************************************************/
static int Init( intf_thread_t *p_intf )
{
- intf_sys_t *p_sys = (intf_sys_t *) p_intf->p_sys;
+ intf_sys_t *p_sys = p_intf->p_sys;
/* Initialize the output structure: RGB with square pixels, whatever
* the input format is, since it's the only format we know */
*****************************************************************************/
static void End( intf_thread_t *p_intf )
{
- intf_sys_t *p_sys = (intf_sys_t *) p_intf->p_sys;
+ intf_sys_t *p_sys = p_intf->p_sys;
/* CleanUp */
SetOverlayTransparency( p_intf, false );
*****************************************************************************/
static int OpenDisplay( intf_thread_t *p_intf )
{
- intf_sys_t *p_sys = (intf_sys_t *) p_intf->p_sys;
+ intf_sys_t *p_sys = p_intf->p_sys;
char *psz_device; /* framebuffer device path */
struct fb_fix_screeninfo fix_info; /* framebuffer fix information */
*****************************************************************************/
static void CloseDisplay( intf_thread_t *p_intf )
{
- intf_sys_t *p_sys = (intf_sys_t *) p_intf;
+ intf_sys_t *p_sys = p_intf->p_sys;
/* Restore palette */
if( p_sys->var_info.bits_per_pixel == 8 )
static void Render( intf_thread_t *p_intf, struct fbosd_render_t *render )
{
- intf_sys_t *p_sys = (intf_sys_t*) p_intf->p_sys;
+ intf_sys_t *p_sys = p_intf->p_sys;
if( render->i_state != FBOSD_STATE_RENDER ) return;
if( !render->psz_string ) return;
static void RenderClear( intf_thread_t *p_intf, struct fbosd_render_t *render )
{
- intf_sys_t *p_sys = (intf_sys_t*) p_intf->p_sys;
+ intf_sys_t *p_sys = p_intf->p_sys;
vlc_memcpy( &render->text_style, &default_text_style,
sizeof( text_style_t ) );
static bool isRendererReady( intf_thread_t *p_intf )
{
- intf_sys_t *p_sys = (intf_sys_t*) p_intf->p_sys;
+ intf_sys_t *p_sys = p_intf->p_sys;
int i;
/* Check if there are more items to render */
*****************************************************************************/
static void Run( intf_thread_t *p_intf )
{
- intf_sys_t *p_sys = (intf_sys_t*) p_intf->p_sys;
+ intf_sys_t *p_sys = p_intf->p_sys;
int canc = vlc_savecancel();
while( vlc_object_alive( p_intf ) )
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
intf_thread_t *p_intf = (intf_thread_t *) p_this;
- intf_sys_t *p_sys = (intf_sys_t*) p_intf->p_sys;
+ intf_sys_t *p_sys = p_intf->p_sys;
VLC_UNUSED(oldval); VLC_UNUSED(p_data);
if( !strncmp( psz_cmd, "fbosd-display", 13 ) )