#include <stdlib.h> /* free() */
#include <string.h> /* strerror() */
#include <fcntl.h> /* open() */
#include <stdlib.h> /* free() */
#include <string.h> /* strerror() */
#include <fcntl.h> /* open() */
- add_file( "fbosd-dev", "/dev/fb1", NULL, DEVICE_TEXT, DEVICE_LONGTEXT,
- false );
+ add_file( "fbosd-dev", "/dev/fb0", NULL, DEVICE_TEXT, DEVICE_LONGTEXT,
+ false )
add_string( "fbosd-aspect-ratio", "", NULL, ASPECT_RATIO_TEXT,
add_string( "fbosd-aspect-ratio", "", NULL, ASPECT_RATIO_TEXT,
add_string( "fbosd-image", NULL, NULL, FBOSD_IMAGE_TEXT,
add_string( "fbosd-image", NULL, NULL, FBOSD_IMAGE_TEXT,
add_string( "fbosd-text", NULL, NULL, FBOSD_TEXT,
add_string( "fbosd-text", NULL, NULL, FBOSD_TEXT,
add_integer_with_range( "fbosd-alpha", 255, 0, 255, NULL, ALPHA_TEXT,
add_integer_with_range( "fbosd-alpha", 255, 0, 255, NULL, ALPHA_TEXT,
set_section( N_("Position"), NULL )
add_integer( "fbosd-x", 0, NULL, POSX_TEXT,
set_section( N_("Position"), NULL )
add_integer( "fbosd-x", 0, NULL, POSX_TEXT,
add_integer( "fbosd-y", 0, NULL, POSY_TEXT,
add_integer( "fbosd-y", 0, NULL, POSY_TEXT,
add_integer( "fbosd-position", 8, NULL, POS_TEXT, POS_LONGTEXT, true )
change_integer_list( pi_pos_values, ppsz_pos_descriptions, NULL );
set_section( N_("Font"), NULL )
add_integer_with_range( "fbosd-font-opacity", 255, 0, 255, NULL,
add_integer( "fbosd-position", 8, NULL, POS_TEXT, POS_LONGTEXT, true )
change_integer_list( pi_pos_values, ppsz_pos_descriptions, NULL );
set_section( N_("Font"), NULL )
add_integer_with_range( "fbosd-font-opacity", 255, 0, 255, NULL,
add_integer( "fbosd-font-color", 0x00FFFFFF, NULL, COLOR_TEXT, COLOR_LONGTEXT,
add_integer( "fbosd-font-color", 0x00FFFFFF, NULL, COLOR_TEXT, COLOR_LONGTEXT,
change_integer_list( pi_color_values, ppsz_color_descriptions, NULL );
add_integer( "fbosd-font-size", -1, NULL, SIZE_TEXT, SIZE_LONGTEXT,
change_integer_list( pi_color_values, ppsz_color_descriptions, NULL );
add_integer( "fbosd-font-size", -1, NULL, SIZE_TEXT, SIZE_LONGTEXT,
set_section( N_("Commands"), NULL )
add_bool( "fbosd-clear", false, NULL, CLEAR_TEXT, CLEAR_LONGTEXT, true )
set_section( N_("Commands"), NULL )
add_bool( "fbosd-clear", false, NULL, CLEAR_TEXT, CLEAR_LONGTEXT, true )
return VLC_ENOMEM;
}
p_sys->i_alpha = var_CreateGetIntegerCommand( p_intf, "fbosd-alpha" );
var_AddCallback( p_intf, "fbosd-alpha", OverlayCallback, NULL );
return VLC_ENOMEM;
}
p_sys->i_alpha = var_CreateGetIntegerCommand( p_intf, "fbosd-alpha" );
var_AddCallback( p_intf, "fbosd-alpha", OverlayCallback, NULL );
}
msg_Dbg( p_intf, "using aspect ratio %d:%d",
atoi( psz_aspect ), atoi( psz_parser ) );
free( psz_aspect );
}
msg_Dbg( p_intf, "using aspect ratio %d:%d",
atoi( psz_aspect ), atoi( psz_parser ) );
free( psz_aspect );
psz_tmp = var_CreateGetNonEmptyStringCommand( p_intf, "fbosd-image" );
var_AddCallback( p_intf, "fbosd-image", OverlayCallback, NULL );
if( psz_tmp && *psz_tmp )
psz_tmp = var_CreateGetNonEmptyStringCommand( p_intf, "fbosd-image" );
var_AddCallback( p_intf, "fbosd-image", OverlayCallback, NULL );
if( psz_tmp && *psz_tmp )
var_AddCallback( p_intf, "fbosd-font-opacity", OverlayCallback, NULL );
for( i = 0; i < FBOSD_RENDER_MAX; i++ )
var_AddCallback( p_intf, "fbosd-font-opacity", OverlayCallback, NULL );
for( i = 0; i < FBOSD_RENDER_MAX; i++ )
p_sys->b_clear = var_CreateGetBoolCommand( p_intf, "fbosd-clear" );
p_sys->b_render = var_CreateGetBoolCommand( p_intf, "fbosd-render" );
p_sys->b_clear = var_CreateGetBoolCommand( p_intf, "fbosd-clear" );
p_sys->b_render = var_CreateGetBoolCommand( p_intf, "fbosd-render" );
vlc_object_attach( p_intf->p_sys->p_blend, p_intf );
p_intf->p_sys->p_blend->fmt_out.video.i_x_offset =
p_intf->p_sys->p_blend->fmt_out.video.i_y_offset = 0;
vlc_object_attach( p_intf->p_sys->p_blend, p_intf );
p_intf->p_sys->p_blend->fmt_out.video.i_x_offset =
p_intf->p_sys->p_blend->fmt_out.video.i_y_offset = 0;
- p_intf->p_sys->p_blend->fmt_out.video.i_aspect =
- p_intf->p_sys->fmt_out.i_aspect;
+ p_intf->p_sys->p_blend->fmt_out.video.i_sar_num =
+ p_intf->p_sys->fmt_out.i_sar_num;
+ p_intf->p_sys->p_blend->fmt_out.video.i_sar_den =
+ p_intf->p_sys->fmt_out.i_sar_den;
p_intf->p_sys->p_blend->p_module =
module_need( p_intf->p_sys->p_blend, "video blending", NULL, false );
p_intf->p_sys->p_blend->p_module =
module_need( p_intf->p_sys->p_blend, "video blending", NULL, false );
module_unneed( p_intf->p_sys->p_blend,
p_intf->p_sys->p_blend->p_module );
module_unneed( p_intf->p_sys->p_blend,
p_intf->p_sys->p_blend->p_module );
module_unneed( p_intf->p_sys->p_text,
p_intf->p_sys->p_text->p_module );
module_unneed( p_intf->p_sys->p_text,
p_intf->p_sys->p_text->p_module );
*****************************************************************************/
static picture_t *AllocatePicture( video_format_t *p_fmt )
{
*****************************************************************************/
static picture_t *AllocatePicture( video_format_t *p_fmt )
{
- picture_t *p_picture = picture_New( p_fmt->i_chroma,
- p_fmt->i_width, p_fmt->i_height,
- p_fmt->i_aspect );
+ picture_t *p_picture = picture_NewFromFormat( p_fmt );
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) ?
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) ?
p_begin = (uint8_t *)(*p_pic)->p[Y_PLANE].p_pixels;
p_end = (uint8_t *)(*p_pic)->p[Y_PLANE].p_pixels +
( fmt.i_height * (*p_pic)->p[Y_PLANE].i_pitch );
i_skip = 3;
break;
p_begin = (uint8_t *)(*p_pic)->p[Y_PLANE].p_pixels;
p_end = (uint8_t *)(*p_pic)->p[Y_PLANE].p_pixels +
( fmt.i_height * (*p_pic)->p[Y_PLANE].i_pitch );
i_skip = 3;
break;
p_begin = (uint8_t *)(*p_pic)->p[Y_PLANE].p_pixels;
p_end = (uint8_t *)(*p_pic)->p[Y_PLANE].p_pixels +
( fmt.i_height * (*p_pic)->p[Y_PLANE].i_pitch );
p_begin = (uint8_t *)(*p_pic)->p[Y_PLANE].p_pixels;
p_end = (uint8_t *)(*p_pic)->p[Y_PLANE].p_pixels +
( fmt.i_height * (*p_pic)->p[Y_PLANE].i_pitch );
static picture_t *RenderText( intf_thread_t *p_intf, const char *psz_string,
text_style_t *p_style, video_format_t *p_fmt )
{
static picture_t *RenderText( intf_thread_t *p_intf, const char *psz_string,
text_style_t *p_style, video_format_t *p_fmt )
{
- p_region->p_style = p_style;
- p_region->i_align = OSD_ALIGN_LEFT | OSD_ALIGN_TOP;
+ p_region->p_style = text_style_Duplicate( p_style );
+ p_region->i_align = SUBPICTURE_ALIGN_LEFT | SUBPICTURE_ALIGN_TOP;
picture_Copy( p_dest, p_region->p_picture );
#else
fmt_out.i_chroma = p_fmt->i_chroma;
picture_Copy( p_dest, p_region->p_picture );
#else
fmt_out.i_chroma = p_fmt->i_chroma;
&p_region->fmt, &fmt_out );
#endif
subpicture_region_Delete( p_region );
&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 )
{
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 )
{
*****************************************************************************/
static int Init( intf_thread_t *p_intf )
{
*****************************************************************************/
static int Init( intf_thread_t *p_intf )
{
/* Initialize the output structure: RGB with square pixels, whatever
* the input format is, since it's the only format we know */
switch( p_sys->var_info.bits_per_pixel )
{
case 8: /* FIXME: set the palette */
/* Initialize the output structure: RGB with square pixels, whatever
* the input format is, since it's the only format we know */
switch( p_sys->var_info.bits_per_pixel )
{
case 8: /* FIXME: set the palette */
default:
msg_Err( p_intf, "unknown screen depth %i",
p_sys->var_info.bits_per_pixel );
default:
msg_Err( p_intf, "unknown screen depth %i",
p_sys->var_info.bits_per_pixel );
- p_sys->fmt_out.i_aspect = ( p_sys->i_width
- * VOUT_ASPECT_FACTOR ) / p_sys->i_height;
+ p_sys->fmt_out.i_sar_num = 1;
+ p_sys->fmt_out.i_sar_den = 1;
+ }
+ else
+ {
+ p_sys->fmt_out.i_sar_num = p_sys->i_aspect * p_sys->i_height;
+ p_sys->fmt_out.i_sar_den = VOUT_ASPECT_FACTOR * p_sys->i_width;
*****************************************************************************/
static void End( intf_thread_t *p_intf )
{
*****************************************************************************/
static void End( intf_thread_t *p_intf )
{
*****************************************************************************/
static int OpenDisplay( intf_thread_t *p_intf )
{
*****************************************************************************/
static int OpenDisplay( intf_thread_t *p_intf )
{
char *psz_device; /* framebuffer device path */
struct fb_fix_screeninfo fix_info; /* framebuffer fix information */
/* Open framebuffer device */
char *psz_device; /* framebuffer device path */
struct fb_fix_screeninfo fix_info; /* framebuffer fix information */
/* Open framebuffer device */
- msg_Err( p_intf, "cannot open %s (%s)", psz_device, strerror(errno) );
+ msg_Err( p_intf, "cannot open %s (%m)", psz_device );
/* Get framebuffer device information */
if( ioctl( p_sys->i_fd, FBIOGET_VSCREENINFO, &p_sys->var_info ) )
{
/* Get framebuffer device information */
if( ioctl( p_sys->i_fd, FBIOGET_VSCREENINFO, &p_sys->var_info ) )
{
*****************************************************************************/
static void CloseDisplay( intf_thread_t *p_intf )
{
*****************************************************************************/
static void CloseDisplay( intf_thread_t *p_intf )
{
#if defined(FBOSD_BLENDING)
video_format_t fmt_in;
memset( &fmt_in, 0, sizeof(video_format_t) );
#if defined(FBOSD_BLENDING)
video_format_t fmt_in;
memset( &fmt_in, 0, sizeof(video_format_t) );
- p_text = RenderText( p_intf, render->psz_string, &render->text_style,
+ p_text = RenderText( p_intf, render->psz_string, render->p_text_style,
- p_text = RenderText( p_intf, render->psz_string, &render->text_style,
+ p_text = RenderText( p_intf, render->psz_string, render->p_text_style,
- vlc_memcpy( &render->text_style, &default_text_style,
- sizeof( text_style_t ) );
+ text_style_Delete( render->p_text_style );
+ render->p_text_style = text_style_New();
*****************************************************************************/
static void Run( intf_thread_t *p_intf )
{
*****************************************************************************/
static void Run( intf_thread_t *p_intf )
{
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
intf_thread_t *p_intf = (intf_thread_t *) p_this;
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
intf_thread_t *p_intf = (intf_thread_t *) p_this;
VLC_UNUSED(oldval); VLC_UNUSED(p_data);
if( !strncmp( psz_cmd, "fbosd-display", 13 ) )
VLC_UNUSED(oldval); VLC_UNUSED(p_data);
if( !strncmp( psz_cmd, "fbosd-display", 13 ) )