]> git.sesse.net Git - vlc/blobdiff - src/video_output/video_output.c
Commited BeOS changes by Richard Shepherd and Tony Castley.
[vlc] / src / video_output / video_output.c
index dd03d6f80ab77dacd22a80ab0bb3c74d00c9ca0f..57e49766b1e6eb599d2ff8992fc14a911fc9f0d6 100644 (file)
@@ -154,16 +154,17 @@ vout_thread_t * vout_CreateThread   ( int *pi_status )
     p_vout->i_bytes_per_pixel     = 2;
     p_vout->f_gamma               = VOUT_GAMMA;
     p_vout->b_need_render         = 1;
-
+    p_vout->b_YCbr                = 0;
+    
     p_vout->b_grayscale           = main_GetIntVariable( VOUT_GRAYSCALE_VAR,
                                                      VOUT_GRAYSCALE_DEFAULT );
     p_vout->b_info                = 0;
     p_vout->b_interface           = 0;
     p_vout->b_scale               = 1;
 
-    intf_DbgMsg( "wished configuration: %dx%d, %d/%d bpp (%d Bpl)",
-                 p_vout->i_width, p_vout->i_height, p_vout->i_screen_depth,
-                 p_vout->i_bytes_per_pixel * 8, p_vout->i_bytes_per_line );
+    intf_WarnMsg( 1, "wished configuration: %dx%d, %d/%d bpp (%d Bpl)",
+                  p_vout->i_width, p_vout->i_height, p_vout->i_screen_depth,
+                  p_vout->i_bytes_per_pixel * 8, p_vout->i_bytes_per_line );
 
     /* Initialize idle screen */
     p_vout->last_display_date   = 0;
@@ -199,12 +200,12 @@ vout_thread_t * vout_CreateThread   ( int *pi_status )
         free( p_vout );
         return( NULL );
     }
-    intf_DbgMsg( "actual configuration: %dx%d, %d/%d bpp (%d Bpl), "
-                 "masks: 0x%x/0x%x/0x%x",
-                 p_vout->i_width, p_vout->i_height, p_vout->i_screen_depth,
-                 p_vout->i_bytes_per_pixel * 8, p_vout->i_bytes_per_line,
-                 p_vout->i_red_mask, p_vout->i_green_mask,
-                 p_vout->i_blue_mask );
+    intf_WarnMsg( 1, "actual configuration: %dx%d, %d/%d bpp (%d Bpl), "
+                  "masks: 0x%x/0x%x/0x%x",
+                  p_vout->i_width, p_vout->i_height, p_vout->i_screen_depth,
+                  p_vout->i_bytes_per_pixel * 8, p_vout->i_bytes_per_line,
+                  p_vout->i_red_mask, p_vout->i_green_mask,
+                  p_vout->i_blue_mask );
 
     /* Calculate shifts from system-updated masks */
     MaskToShift( &p_vout->i_red_lshift, &p_vout->i_red_rshift,
@@ -222,11 +223,7 @@ vout_thread_t * vout_CreateThread   ( int *pi_status )
 
     /* Load fonts - fonts must be initialized after the system method since
      * they may be dependant on screen depth and other thread properties */
-    p_vout->p_default_font = vout_LoadFont( DATA_PATH "/" VOUT_DEFAULT_FONT );
-    if( p_vout->p_default_font == NULL )
-    {
-        p_vout->p_default_font = vout_LoadFont( "share/" VOUT_DEFAULT_FONT );
-    }
+    p_vout->p_default_font = vout_LoadFont( VOUT_DEFAULT_FONT );
     if( p_vout->p_default_font == NULL )
     {
         intf_ErrMsg( "vout error: could not load default font" );
@@ -234,11 +231,8 @@ vout_thread_t * vout_CreateThread   ( int *pi_status )
         free( p_vout );
         return( NULL );
     }
-    p_vout->p_large_font = vout_LoadFont( DATA_PATH "/" VOUT_LARGE_FONT );
-    if( p_vout->p_large_font == NULL )
-    {
-        p_vout->p_large_font = vout_LoadFont( "share/" VOUT_LARGE_FONT );
-    }
+
+    p_vout->p_large_font = vout_LoadFont( VOUT_LARGE_FONT );
     if( p_vout->p_large_font == NULL )
     {
         intf_ErrMsg( "vout error: could not load large font" );
@@ -681,6 +675,9 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout, int i_type,
             p_free_picture->i_width                     = i_width;
             p_free_picture->i_height                    = i_height;
             p_free_picture->i_chroma_width              = i_chroma_width;
+            p_free_picture->i_size                      = i_width * i_height;
+            p_free_picture->i_chroma_size               = i_chroma_width
+                                                            * i_height;
             p_free_picture->i_display_horizontal_offset = 0;
             p_free_picture->i_display_vertical_offset   = 0;
             p_free_picture->i_display_width             = i_width;
@@ -857,23 +854,23 @@ static int BinaryLog(u32 i)
 
     if(i & 0xffff0000)
     {
-       i_log += 16;
+        i_log += 16;
     }
     if(i & 0xff00ff00)
     {
-       i_log += 8;
+        i_log += 8;
     }
     if(i & 0xf0f0f0f0)
     {
-       i_log += 4;
+        i_log += 4;
     }
     if(i & 0xcccccccc)
     {
-       i_log += 2;
+        i_log += 2;
     }
     if(i & 0xaaaaaaaa)
     {
-       i_log += 1;
+        i_log += 1;
     }
 
     if (i != ((u32)1 << i_log))
@@ -930,14 +927,11 @@ static int InitThread( vout_thread_t *p_vout )
         return( 1 );
     }
 
-    if( p_vout->b_need_render )
+    /* Initialize convertion tables and functions */
+    if( vout_InitYUV( p_vout ) )
     {
-        /* Initialize convertion tables and functions */
-        if( vout_InitYUV( p_vout ) )
-        {
-            intf_ErrMsg("vout error: can't allocate YUV translation tables");
-            return( 1 );
-        }
+        intf_ErrMsg("vout error: can't allocate YUV translation tables");
+        return( 1 );
     }
 
     /* Mark thread as running and return */
@@ -1481,7 +1475,7 @@ static void SetBufferArea( vout_thread_t *p_vout, int i_x, int i_y, int i_w, int
             if( i_area_copy != i_area )
             {
                 /* Merge with last possible areas */
-                p_buffer->pi_area_end[i_area] = MAX( i_h, p_buffer->pi_area_end[i_area_copy] );
+                //p_buffer->pi_area_end[i_area] = MAX( i_h, p_buffer->pi_area_end[i_area_copy] );
 
                 /* Shift lower areas upward */
                 i_area_shift = i_area_copy - i_area;
@@ -1693,28 +1687,28 @@ static void RenderPicture( vout_thread_t *p_vout, picture_t *p_pic )
     switch( p_pic->i_type )
     {
     case YUV_420_PICTURE:
-        p_vout->yuv.p_Convert420( p_vout, p_pic_data,
-                                  p_pic->p_y, p_pic->p_u, p_pic->p_v,
-                                  p_pic->i_width, p_pic->i_height,
-                                  p_buffer->i_pic_width, p_buffer->i_pic_height,
-                                  p_vout->i_bytes_per_line / p_vout->i_bytes_per_pixel,
-                                  p_pic->i_matrix_coefficients );
+        p_vout->yuv.pf_yuv420( p_vout, p_pic_data,
+                               p_pic->p_y, p_pic->p_u, p_pic->p_v,
+                               p_pic->i_width, p_pic->i_height,
+                               p_buffer->i_pic_width, p_buffer->i_pic_height,
+                               p_vout->i_bytes_per_line / p_vout->i_bytes_per_pixel,
+                               p_pic->i_matrix_coefficients );
         break;
     case YUV_422_PICTURE:
-        p_vout->yuv.p_Convert422( p_vout, p_pic_data,
-                                  p_pic->p_y, p_pic->p_u, p_pic->p_v,
-                                  p_pic->i_width, p_pic->i_height,
-                                  p_buffer->i_pic_width, p_buffer->i_pic_height,
-                                  p_vout->i_bytes_per_line / p_vout->i_bytes_per_pixel,
-                                  p_pic->i_matrix_coefficients );
+        p_vout->yuv.pf_yuv422( p_vout, p_pic_data,
+                               p_pic->p_y, p_pic->p_u, p_pic->p_v,
+                               p_pic->i_width, p_pic->i_height,
+                               p_buffer->i_pic_width, p_buffer->i_pic_height,
+                               p_vout->i_bytes_per_line / p_vout->i_bytes_per_pixel,
+                               p_pic->i_matrix_coefficients );
         break;
     case YUV_444_PICTURE:
-        p_vout->yuv.p_Convert444( p_vout, p_pic_data,
-                                  p_pic->p_y, p_pic->p_u, p_pic->p_v,
-                                  p_pic->i_width, p_pic->i_height,
-                                  p_buffer->i_pic_width, p_buffer->i_pic_height,
-                                  p_vout->i_bytes_per_line / p_vout->i_bytes_per_pixel,
-                                  p_pic->i_matrix_coefficients );
+        p_vout->yuv.pf_yuv444( p_vout, p_pic_data,
+                               p_pic->p_y, p_pic->p_u, p_pic->p_v,
+                               p_pic->i_width, p_pic->i_height,
+                               p_buffer->i_pic_width, p_buffer->i_pic_height,
+                               p_vout->i_bytes_per_line / p_vout->i_bytes_per_pixel,
+                               p_pic->i_matrix_coefficients );
         break;
 #ifdef DEBUG
     default: