Commit 2ad5cc2b authored by Antoine Cellerier's avatar Antoine Cellerier

Fix OSD display when vout crop is used (so that every thing stays on the displayed image).

parent eaba550e
...@@ -468,8 +468,8 @@ VLC_EXPORT( void,osd_Message, ( spu_t *, int, char *, ... ) ); ...@@ -468,8 +468,8 @@ VLC_EXPORT( void,osd_Message, ( spu_t *, int, char *, ... ) );
* object. The types are declared in the include file include/vlc_osd.h * object. The types are declared in the include file include/vlc_osd.h
* @see vlc_osd.h * @see vlc_osd.h
*/ */
VLC_EXPORT( int, osd_Slider, ( vlc_object_t *, spu_t *, int, int, int, int, short ) ); VLC_EXPORT( int, osd_Slider, ( vlc_object_t *, spu_t *, int, int, int, int, int, int, short ) );
VLC_EXPORT( int, osd_Icon, ( vlc_object_t *, spu_t *, int, int, int, short ) ); VLC_EXPORT( int, osd_Icon, ( vlc_object_t *, spu_t *, int, int, int, int, int, short ) );
/** /**
* Loading and parse the OSD Configuration file * Loading and parse the OSD Configuration file
......
...@@ -420,9 +420,9 @@ struct module_symbols_t ...@@ -420,9 +420,9 @@ struct module_symbols_t
void (*httpd_HandlerDelete_inner) (httpd_handler_t *); void (*httpd_HandlerDelete_inner) (httpd_handler_t *);
int (*__vlc_execve_inner) (vlc_object_t *p_object, int i_argc, char **pp_argv, char **pp_env, char *psz_cwd, char *p_in, int i_in, char **pp_data, int *pi_data); int (*__vlc_execve_inner) (vlc_object_t *p_object, int i_argc, char **pp_argv, char **pp_env, char *psz_cwd, char *p_in, int i_in, char **pp_data, int *pi_data);
httpd_handler_t * (*httpd_HandlerNew_inner) (httpd_host_t *, const char *psz_url, const char *psz_user, const char *psz_password, const vlc_acl_t *p_acl, httpd_handler_callback_t pf_fill, httpd_handler_sys_t *); httpd_handler_t * (*httpd_HandlerNew_inner) (httpd_host_t *, const char *psz_url, const char *psz_user, const char *psz_password, const vlc_acl_t *p_acl, httpd_handler_callback_t pf_fill, httpd_handler_sys_t *);
int (*osd_Slider_inner) (vlc_object_t *, spu_t *, int, int, int, int, short); int (*osd_Slider_inner) (vlc_object_t *, spu_t *, int, int, int, int, int, int, short);
int (*osd_ShowTextRelative_inner) (spu_t *, int, char *, text_style_t *, int, int, int, mtime_t); int (*osd_ShowTextRelative_inner) (spu_t *, int, char *, text_style_t *, int, int, int, mtime_t);
int (*osd_Icon_inner) (vlc_object_t *, spu_t *, int, int, int, short); int (*osd_Icon_inner) (vlc_object_t *, spu_t *, int, int, int, int, int, short);
void (*osd_Message_inner) (spu_t *, int, char *, ...); void (*osd_Message_inner) (spu_t *, int, char *, ...);
int (*osd_ShowTextAbsolute_inner) (spu_t *, int, char *, text_style_t *, int, int, int, mtime_t, mtime_t); int (*osd_ShowTextAbsolute_inner) (spu_t *, int, char *, text_style_t *, int, int, int, mtime_t, mtime_t);
char * (*config_GetUserDir_inner) (void); char * (*config_GetUserDir_inner) (void);
......
...@@ -213,6 +213,7 @@ subpicture_t *osd_CreateWidget( spu_t *p_spu, int i_channel ) ...@@ -213,6 +213,7 @@ subpicture_t *osd_CreateWidget( spu_t *p_spu, int i_channel )
*****************************************************************************/ *****************************************************************************/
int osd_Slider( vlc_object_t *p_this, spu_t *p_spu, int osd_Slider( vlc_object_t *p_this, spu_t *p_spu,
int i_render_width, int i_render_height, int i_render_width, int i_render_height,
int i_margin_left, int i_margin_bottom,
int i_channel, int i_position, short i_type ) int i_channel, int i_position, short i_type )
{ {
subpicture_t *p_subpic; subpicture_t *p_subpic;
...@@ -225,7 +226,9 @@ int osd_Slider( vlc_object_t *p_this, spu_t *p_spu, ...@@ -225,7 +226,9 @@ int osd_Slider( vlc_object_t *p_this, spu_t *p_spu,
} }
i_y_margin = i_render_height / 10; i_y_margin = i_render_height / 10;
i_x_margin = i_y_margin; i_x_margin = i_y_margin + i_margin_left;
i_y_margin += i_margin_bottom;
if( i_type == OSD_HOR_SLIDER ) if( i_type == OSD_HOR_SLIDER )
{ {
i_width = i_render_width - 2 * i_x_margin; i_width = i_render_width - 2 * i_x_margin;
...@@ -272,7 +275,8 @@ int osd_Slider( vlc_object_t *p_this, spu_t *p_spu, ...@@ -272,7 +275,8 @@ int osd_Slider( vlc_object_t *p_this, spu_t *p_spu,
* Types are: OSD_PLAY_ICON, OSD_PAUSE_ICON, OSD_SPEAKER_ICON, OSD_MUTE_ICON * Types are: OSD_PLAY_ICON, OSD_PAUSE_ICON, OSD_SPEAKER_ICON, OSD_MUTE_ICON
*****************************************************************************/ *****************************************************************************/
int osd_Icon( vlc_object_t *p_this, spu_t *p_spu, int osd_Icon( vlc_object_t *p_this, spu_t *p_spu,
int i_render_width, int i_render_height, int i_channel, short i_type ) int i_render_width, int i_render_height, int i_margin_right,
int i_margin_top, int i_channel, short i_type )
{ {
subpicture_t *p_subpic; subpicture_t *p_subpic;
int i_x_margin, i_y_margin, i_x, i_y, i_width, i_height; int i_x_margin, i_y_margin, i_x, i_y, i_width, i_height;
...@@ -284,7 +288,8 @@ int osd_Icon( vlc_object_t *p_this, spu_t *p_spu, ...@@ -284,7 +288,8 @@ int osd_Icon( vlc_object_t *p_this, spu_t *p_spu,
} }
i_y_margin = i_render_height / 15; i_y_margin = i_render_height / 15;
i_x_margin = i_y_margin; i_x_margin = i_y_margin + i_margin_right;
i_y_margin += i_margin_top;
i_width = i_render_width / 20; i_width = i_render_width / 20;
i_height = i_width; i_height = i_width;
i_x = i_render_width - i_x_margin - i_width; i_x = i_render_width - i_x_margin - i_width;
......
...@@ -129,7 +129,11 @@ void __vout_OSDMessage( vlc_object_t *p_caller, int i_channel, ...@@ -129,7 +129,11 @@ void __vout_OSDMessage( vlc_object_t *p_caller, int i_channel,
vasprintf( &psz_string, psz_format, args ); vasprintf( &psz_string, psz_format, args );
vout_ShowTextRelative( p_vout, i_channel, psz_string, NULL, vout_ShowTextRelative( p_vout, i_channel, psz_string, NULL,
OSD_ALIGN_TOP|OSD_ALIGN_RIGHT, 30,20,1000000 ); OSD_ALIGN_TOP|OSD_ALIGN_RIGHT,
30 + p_vout->fmt_in.i_width
- p_vout->fmt_in.i_visible_width
- p_vout->fmt_in.i_x_offset,
20 + p_vout->fmt_in.i_y_offset, 1000000 );
vlc_object_release( p_vout ); vlc_object_release( p_vout );
free( psz_string ); free( psz_string );
......
...@@ -44,7 +44,10 @@ void vout_OSDSlider( vlc_object_t *p_caller, int i_channel, int i_position, ...@@ -44,7 +44,10 @@ void vout_OSDSlider( vlc_object_t *p_caller, int i_channel, int i_position,
if( p_vout && ( config_GetInt( p_caller, "osd" ) || ( i_position >= 0 ) ) ) if( p_vout && ( config_GetInt( p_caller, "osd" ) || ( i_position >= 0 ) ) )
{ {
osd_Slider( p_caller, p_vout->p_spu, p_vout->render.i_width, osd_Slider( p_caller, p_vout->p_spu, p_vout->render.i_width,
p_vout->render.i_height, i_channel, i_position, i_type ); p_vout->render.i_height, p_vout->fmt_in.i_x_offset,
p_vout->fmt_in.i_height - p_vout->fmt_in.i_visible_height
- p_vout->fmt_in.i_y_offset,
i_channel, i_position, i_type );
} }
vlc_object_release( p_vout ); vlc_object_release( p_vout );
} }
...@@ -62,8 +65,14 @@ void vout_OSDIcon( vlc_object_t *p_caller, int i_channel, short i_type ) ...@@ -62,8 +65,14 @@ void vout_OSDIcon( vlc_object_t *p_caller, int i_channel, short i_type )
if( config_GetInt( p_caller, "osd" ) ) if( config_GetInt( p_caller, "osd" ) )
{ {
osd_Icon( p_caller, p_vout->p_spu, p_vout->render.i_width, osd_Icon( p_caller,
p_vout->render.i_height, i_channel, i_type ); p_vout->p_spu,
p_vout->render.i_width,
p_vout->render.i_height,
p_vout->fmt_in.i_width - p_vout->fmt_in.i_visible_width
- p_vout->fmt_in.i_x_offset,
p_vout->fmt_in.i_y_offset,
i_channel, i_type );
} }
vlc_object_release( p_vout ); vlc_object_release( p_vout );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment