]> git.sesse.net Git - vlc/blobdiff - src/osd/osd_widgets.c
Merge branch 1.0-bugfix
[vlc] / src / osd / osd_widgets.c
index 2992bf1f21f1c6ffef0d22fd114ee40907ab4e27..32af4b8428d210622dae10929429851985d4fb7f 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>                                                /* free() */
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
 #include <vlc_osd.h>
 #include <vlc_vout.h>
 #include <vlc_filter.h>
@@ -49,8 +52,8 @@ static void DrawRect( subpicture_t *p_subpic, int i_x1, int i_y1,
                       int i_x2, int i_y2, short fill )
 {
     int x, y;
-    uint8_t *p_a = p_subpic->p_region->picture.A_PIXELS;
-    int i_pitch = p_subpic->p_region->picture.Y_PITCH;
+    uint8_t *p_a = p_subpic->p_region->p_picture->A_PIXELS;
+    int i_pitch = p_subpic->p_region->p_picture->Y_PITCH;
 
     if( fill == STYLE_FILLED )
     {
@@ -85,8 +88,8 @@ static void DrawTriangle( subpicture_t *p_subpic, int i_x1, int i_y1,
                           int i_x2, int i_y2, short fill )
 {
     int x, y, i_mid, h;
-    uint8_t *p_a = p_subpic->p_region->picture.A_PIXELS;
-    int i_pitch = p_subpic->p_region->picture.Y_PITCH;
+    uint8_t *p_a = p_subpic->p_region->p_picture->A_PIXELS;
+    int i_pitch = p_subpic->p_region->p_picture->Y_PITCH;
 
     i_mid = i_y1 + ( ( i_y2 - i_y1 ) >> 1 );
 
@@ -156,12 +159,12 @@ static int CreatePicture( spu_t *p_spu, subpicture_t *p_subpic,
 
     /* Create a new subpicture region */
     memset( &fmt, 0, sizeof(video_format_t) );
-    fmt.i_chroma = VLC_FOURCC('Y','U','V','A');
+    fmt.i_chroma = VLC_CODEC_YUVA;
     fmt.i_aspect = 0;
     fmt.i_width = fmt.i_visible_width = i_width;
     fmt.i_height = fmt.i_visible_height = i_height;
     fmt.i_x_offset = fmt.i_y_offset = 0;
-    p_subpic->p_region = p_subpic->pf_create_region( VLC_OBJECT(p_spu), &fmt );
+    p_subpic->p_region = subpicture_region_New( &fmt );
     if( !p_subpic->p_region )
     {
         msg_Err( p_spu, "cannot allocate SPU region" );
@@ -170,11 +173,11 @@ static int CreatePicture( spu_t *p_spu, subpicture_t *p_subpic,
 
     p_subpic->p_region->i_x = i_x;
     p_subpic->p_region->i_y = i_y;
-    p_y = p_subpic->p_region->picture.Y_PIXELS;
-    p_u = p_subpic->p_region->picture.U_PIXELS;
-    p_v = p_subpic->p_region->picture.V_PIXELS;
-    p_a = p_subpic->p_region->picture.A_PIXELS;
-    i_pitch = p_subpic->p_region->picture.Y_PITCH;
+    p_y = p_subpic->p_region->p_picture->Y_PIXELS;
+    p_u = p_subpic->p_region->p_picture->U_PIXELS;
+    p_v = p_subpic->p_region->p_picture->V_PIXELS;
+    p_a = p_subpic->p_region->p_picture->A_PIXELS;
+    i_pitch = p_subpic->p_region->p_picture->Y_PITCH;
 
     /* Initialize the region pixels (only the alpha will be changed later) */
     memset( p_y, 0xff, i_pitch * p_subpic->p_region->fmt.i_height );
@@ -193,15 +196,17 @@ subpicture_t *osd_CreateWidget( spu_t *p_spu, int i_channel )
     subpicture_t *p_subpic;
     mtime_t i_now = mdate();
 
+    VLC_UNUSED(p_spu);
+
     /* Create and initialize a subpicture */
-    p_subpic = spu_CreateSubpicture( p_spu );
+    p_subpic = subpicture_New();
     if( p_subpic == NULL ) return NULL;
 
     p_subpic->i_channel = i_channel;
     p_subpic->i_start = i_now;
     p_subpic->i_stop = i_now + 1200000;
-    p_subpic->b_ephemer = VLC_TRUE;
-    p_subpic->b_fade = VLC_TRUE;
+    p_subpic->b_ephemer = true;
+    p_subpic->b_fade = true;
 
     return p_subpic;
 }
@@ -325,8 +330,8 @@ int osd_Icon( vlc_object_t *p_this, spu_t *p_spu,
                       STYLE_FILLED );
         if( i_type == OSD_MUTE_ICON )
         {
-            uint8_t *p_a = p_subpic->p_region->picture.A_PIXELS;
-            int i_pitch = p_subpic->p_region->picture.Y_PITCH;
+            uint8_t *p_a = p_subpic->p_region->p_picture->A_PIXELS;
+            int i_pitch = p_subpic->p_region->p_picture->Y_PITCH;
             int i;
             for( i = 1; i < i_pitch; i++ )
             {