]> git.sesse.net Git - vlc/commitdiff
Fix OSD display when vout crop is used (so that every thing stays on the displayed...
authorAntoine Cellerier <dionoea@videolan.org>
Thu, 6 Apr 2006 22:41:06 +0000 (22:41 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Thu, 6 Apr 2006 22:41:06 +0000 (22:41 +0000)
include/vlc_osd.h
include/vlc_symbols.h
src/osd/osd_widgets.c
src/video_output/video_text.c
src/video_output/video_widgets.c

index 99db0757db02310d6e3786ab9b6ece390f793dbb..9fda7077bad64580ce8cc21d9feeca362fade62f 100644 (file)
@@ -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
  * @see vlc_osd.h
  */
-VLC_EXPORT( int, osd_Slider, ( vlc_object_t *, spu_t *, int, int, int, int, short ) );
-VLC_EXPORT( int, osd_Icon, ( vlc_object_t *, spu_t *, 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, int, int, short ) );
 
 /**
  * Loading and parse the OSD Configuration file
index 3e306030a55d99622d99fccc26e09494f07e24a5..a9b95722c87197cc919d6417ccc1305f8f00aa8a 100644 (file)
@@ -420,9 +420,9 @@ struct module_symbols_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);
     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_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 *, ...);
     int (*osd_ShowTextAbsolute_inner) (spu_t *, int, char *, text_style_t *, int, int, int, mtime_t, mtime_t);
     char * (*config_GetUserDir_inner) (void);
index 2a508c1bcc84b4c9f7aaceeb70a86d140ae67e32..c89ad56c7b56f1922aa6598cd73b67afbd242aec 100644 (file)
@@ -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 i_render_width, int i_render_height,
+    int i_margin_left, int i_margin_bottom,
     int i_channel, int i_position, short i_type )
 {
     subpicture_t *p_subpic;
@@ -225,7 +226,9 @@ int osd_Slider( vlc_object_t *p_this, spu_t *p_spu,
     }
 
     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 )
     {
         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,
  * 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 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;
     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,
     }
 
     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_height = i_width;
     i_x = i_render_width - i_x_margin - i_width;
index 3fcdc5b3663fa1eff0ea04f6658cebae910a88e2..80a1b7294677321056739c78beaf61b004e2b6e2 100644 (file)
@@ -129,7 +129,11 @@ void __vout_OSDMessage( vlc_object_t *p_caller, int i_channel,
         vasprintf( &psz_string, psz_format, args );
 
         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 );
         free( psz_string );
index 1bd5189ca9f59eec49937486ad8bec2e2c985e84..504c7d5ee815866bb23cf37d39c998abb867a2ef 100644 (file)
@@ -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 ) ) )
     {
         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 );
 }
@@ -62,8 +65,14 @@ void vout_OSDIcon( vlc_object_t *p_caller, int i_channel, short i_type )
 
     if( config_GetInt( p_caller, "osd" ) )
     {
-        osd_Icon( p_caller, p_vout->p_spu, p_vout->render.i_width,
-            p_vout->render.i_height, i_channel, i_type );
+        osd_Icon( p_caller,
+                  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 );
 }