]> git.sesse.net Git - vlc/commitdiff
API vout_DateImage (mais �a ne marche pas)
authorVincent Seguin <seguin@videolan.org>
Wed, 19 Jan 2000 12:28:25 +0000 (12:28 +0000)
committerVincent Seguin <seguin@videolan.org>
Wed, 19 Jan 2000 12:28:25 +0000 (12:28 +0000)
Suite nettoyage

include/config.h
include/video.h
include/video_output.h
src/interface/interface.c
src/video_output/video_output.c

index 73254fe5700ab30a45515ece0e55450926c7e834..b6c94e9b75032574bbb0e6d4f7336a65a5a65bf5 100644 (file)
 
 /* Step for changing gamma, and minimum and maximum values */
 #define INTF_GAMMA_STEP                 .1
-#define INTF_GAMMA_MAX                  3
+#define INTF_GAMMA_LIMIT                3
 
-/* Factor for changing aspect ratio, and minimum and maximum values */
-#define INTF_RATIO_FACTOR               1.1
-#define INTF_RATIO_MIN                  .1
-#define INTF_RATIO_MAX                  10
+/* Scaling modifier limits */
+#define INTF_SCALE_LIMIT                10
 
 /*
  * X11 settings
index 1d6ec44ca5c92faab2fb29e21b1dbbdade27a4fb..23340ab2139364b15e3930d24374a094564ab415 100644 (file)
@@ -30,6 +30,11 @@ typedef struct picture_s
     int             i_type;                                    /* picture type */
     int             i_status;                                 /* picture flags */
     int             i_matrix_coefficients;       /* in YUV type, encoding type */    
+
+    /* Picture management properties - these properties can be modified using
+     * the video output thread API, but should ne be written directly */
+    int             i_refcount;                      /* link reference counter */
+    mtime_t         date;                                      /* display date */
     
     /* Picture static properties - those properties are fixed at initialization
      * and should NOT be modified */
@@ -45,20 +50,11 @@ typedef struct picture_s
     int             i_display_height;                 /* useful picture height */
     int             i_aspect_ratio;                            /* aspect ratio */  
     
-    /* Link reference counter - it can be modified using vout_Link and 
-     * vout_Unlink functions, or directly if the picture is independant */
-    int             i_refcount;                      /* link reference counter */
-
     /* Macroblock counter - the decoder use it to verify if it has
      * decoded all the macroblocks of the picture */
     int             i_deccount;
     vlc_mutex_t     lock_deccount;
     
-    /* Video properties - those properties should not be modified once 
-     * the picture is in a heap, but can be freely modified if it is 
-     * independant */
-    mtime_t         date;                                      /* display date */
-
     /* Picture data - data can always be freely modified. p_data itself 
      * (the pointer) should NEVER be modified. In YUV format, the p_y, p_u and
      * p_v data pointers refers to different areas of p_data, and should not
index 639a1cf3a1c95358da7d477daa94fc77cc76b4a3..3f37e5d0647331f58ca913c3b6033804b74d4790 100644 (file)
@@ -50,26 +50,26 @@ typedef void (vout_convert_t)( p_vout_thread_t p_vout, void *p_pic,
                                int i_scale, int i_matrix_coefficients );
 
 /*******************************************************************************
- * vout_scale_t: scaling function
+ * vout_scale_t: horizontal scaling function
  *******************************************************************************
- * When a picture can't be scaled unsing the fast i_y_scale parameter of a
- * transformation, it is rendered in a temporary buffer then scaled using a
- * totally accurate (but also very slow) method.
- * This is the prototype common to all scaling functions. The types of p_buffer
- * and p_pic will change depending of the screen depth treated.
+ * The convertion function only perform a vertical scaling. Horizontal scaling
+ * is done later using this function.
  * Parameters:
  *      p_vout                  video output thread
- *      p_pic                   picture address (start address in picture)
- *      p_buffer                source picture
- *      i_width                 buffer width
- *      i_height                buffer height
- *      i_eol                   number of pixels to reach next buffer line
- *      i_pic_eol               number of pixels to reach next picture line
- *      f_alpha, f_beta         horizontal and vertical scaling factors
+ *      p_src                   source address (start address in picture)
+ *      p_dst                   destination address (start address in picture)
+ *      i_width                 source width
+ *      i_height                source height
+ *      i_line_width            source total pixels per line              
+ *      i_dst_line_width        destination total pixels per line          
+ *      i_scale                 if non 0, horizontal scaling is 1 - 1/i_scale
+ * Conditions:      
+ *      i_height % 16
+ *      i_scale < 0             if p_src == p_dst
  *******************************************************************************/
-typedef void (vout_scale_t)( p_vout_thread_t p_vout, void *p_pic, void *p_buffer
-                             int i_width, int i_height, int i_eol, int i_pic_eol,
-                             float f_alpha, float f_beta );
+typedef void (vout_scale_t)( p_vout_thread_t p_vout, void *p_src, void *p_dst
+                             int i_width, int i_height, int i_line_width, 
+                             int i_dst_line_width, int i_scale );
 
 /*******************************************************************************
  * vout_thread_t: video output thread descriptor
@@ -99,8 +99,8 @@ typedef struct vout_thread_s
     int                 i_bytes_per_line;/* bytes per line (including virtual) */
     int                 i_screen_depth;                      /* bits per pixel */
     int                 i_bytes_per_pixel;                /* real screen depth */
-    float               f_x_ratio;                 /* horizontal display ratio */
-    float               f_y_ratio;                   /* vertical display ratio */
+    int                 i_horizontal_scale;        /* horizontal display scale */
+    int                 i_vertical_scale;            /* vertical display scale */
     float               f_gamma;                                      /* gamma */
 
 #ifdef STATS    
@@ -146,6 +146,7 @@ picture_t *     vout_CreatePicture      ( vout_thread_t *p_vout, int i_type,
                                           int i_width, int i_height );
 void            vout_DestroyPicture     ( vout_thread_t *p_vout, picture_t *p_pic );
 void            vout_DisplayPicture     ( vout_thread_t *p_vout, picture_t *p_pic );
+void            vout_DatePicture        ( vout_thread_t *p_vout, picture_t *p_pic, mtime_t date );
 void            vout_LinkPicture        ( vout_thread_t *p_vout, picture_t *p_pic );
 void            vout_UnlinkPicture      ( vout_thread_t *p_vout, picture_t *p_pic );
 subtitle_t *    vout_CreateSubtitle     ( vout_thread_t *p_vout, int i_type, int i_size );
index 16e702d12cf014054c507a8a251d0907b3e178ff..5243f65c665b2faaa4d98b1f03d1dd217597ee27 100644 (file)
@@ -196,7 +196,7 @@ int intf_ProcessKey( intf_thread_t *p_intf, int i_key )
         // ??
         break;     
     case 'g':                                                       /* gamma - */
-        if( (p_intf->p_vout != NULL) && (p_intf->p_vout->f_gamma > -INTF_GAMMA_MAX) )
+        if( (p_intf->p_vout != NULL) && (p_intf->p_vout->f_gamma > -INTF_GAMMA_LIMIT) )
         {
             vlc_mutex_lock( &p_intf->p_vout->change_lock );
             p_intf->p_vout->f_gamma   -= INTF_GAMMA_STEP;                        
@@ -205,7 +205,7 @@ int intf_ProcessKey( intf_thread_t *p_intf, int i_key )
         }                    
         break;                                        
     case 'G':                                                       /* gamma + */
-        if( (p_intf->p_vout != NULL) && (p_intf->p_vout->f_gamma < INTF_GAMMA_MAX) )
+        if( (p_intf->p_vout != NULL) && (p_intf->p_vout->f_gamma < INTF_GAMMA_LIMIT) )
         {       
             vlc_mutex_lock( &p_intf->p_vout->change_lock );
             p_intf->p_vout->f_gamma   += INTF_GAMMA_STEP;
@@ -223,37 +223,37 @@ int intf_ProcessKey( intf_thread_t *p_intf, int i_key )
         }
         break;  
     case 'x':                                     /* horizontal aspect ratio - */
-        if( (p_intf->p_vout != NULL) && (p_intf->p_vout->f_x_ratio > INTF_RATIO_MIN) )
+        if( (p_intf->p_vout != NULL) && (p_intf->p_vout->i_horizontal_scale > -INTF_SCALE_LIMIT) )
         {
             vlc_mutex_lock( &p_intf->p_vout->change_lock );
-            p_intf->p_vout->f_x_ratio /= INTF_RATIO_FACTOR;                        
+            p_intf->p_vout->i_horizontal_scale--;                        
             p_intf->p_vout->i_changes |= VOUT_RATIO_CHANGE;
             vlc_mutex_unlock( &p_intf->p_vout->change_lock );
         }                    
         break;                                        
     case 'X':                                     /* horizontal aspect ratio + */
-        if( (p_intf->p_vout != NULL) && (p_intf->p_vout->f_x_ratio < INTF_RATIO_MAX) )
+        if( (p_intf->p_vout != NULL) && (p_intf->p_vout->i_horizontal_scale < INTF_SCALE_LIMIT) )
         {       
             vlc_mutex_lock( &p_intf->p_vout->change_lock );
-            p_intf->p_vout->f_x_ratio *= INTF_RATIO_FACTOR;
+            p_intf->p_vout->i_horizontal_scale++;
             p_intf->p_vout->i_changes |= VOUT_RATIO_CHANGE;
             vlc_mutex_unlock( &p_intf->p_vout->change_lock );
         }                    
         break;  
     case 'y':                                       /* vertical aspect ratio - */
-        if( (p_intf->p_vout != NULL) && (p_intf->p_vout->f_y_ratio > INTF_RATIO_MIN) )
+        if( (p_intf->p_vout != NULL) && (p_intf->p_vout->i_vertical_scale > -INTF_SCALE_LIMIT) )
         {
             vlc_mutex_lock( &p_intf->p_vout->change_lock );
-            p_intf->p_vout->f_y_ratio /= INTF_RATIO_FACTOR;                        
+            p_intf->p_vout->i_vertical_scale--;
             p_intf->p_vout->i_changes |= VOUT_RATIO_CHANGE;
             vlc_mutex_unlock( &p_intf->p_vout->change_lock );
         }                    
         break;                                        
     case 'Y':                                     /* horizontal aspect ratio + */
-        if( (p_intf->p_vout != NULL) && (p_intf->p_vout->f_y_ratio < INTF_RATIO_MAX) )
+        if( (p_intf->p_vout != NULL) && (p_intf->p_vout->i_vertical_scale < INTF_SCALE_LIMIT) )
         {       
             vlc_mutex_lock( &p_intf->p_vout->change_lock );
-            p_intf->p_vout->f_y_ratio *= INTF_RATIO_FACTOR;
+            p_intf->p_vout->i_vertical_scale++;
             p_intf->p_vout->i_changes |= VOUT_RATIO_CHANGE;
             vlc_mutex_unlock( &p_intf->p_vout->change_lock );
         }
index 36186e5255494f6220e131b20e326b62c53ff978..a047133b4994c25047ad726e5e727c6d2af66748 100644 (file)
@@ -83,13 +83,13 @@ vout_thread_t * vout_CreateThread               ( char *psz_display, int i_root_
     p_vout->i_bytes_per_line    = i_width * 2;    
     p_vout->i_screen_depth      = 15;
     p_vout->i_bytes_per_pixel   = 2;
-    p_vout->f_x_ratio           = 1;
-    p_vout->f_y_ratio           = 1;
+    p_vout->i_horizontal_scale  = 0;
+    p_vout->i_vertical_scale    = 0;
     p_vout->f_gamma             = VOUT_GAMMA;    
-    intf_DbgMsg("wished configuration: %dx%d,%d (%d bytes/pixel, %d bytes/line), ratio %.2f:%.2f, gray=%d\n",
+    intf_DbgMsg("wished configuration: %dx%d,%d (%d bytes/pixel, %d bytes/line), scaling %+d:%+d, gray=%d\n",
                 p_vout->i_width, p_vout->i_height, p_vout->i_screen_depth,
                 p_vout->i_bytes_per_pixel, p_vout->i_bytes_per_line,
-                p_vout->f_x_ratio, p_vout->f_y_ratio, p_vout->b_grayscale );
+                p_vout->i_horizontal_scale, p_vout->i_vertical_scale, p_vout->b_grayscale );
    
     /* Create and initialize system-dependant method - this function issues its
      * own error messages */
@@ -98,11 +98,11 @@ vout_thread_t * vout_CreateThread               ( char *psz_display, int i_root_
       free( p_vout );
       return( NULL );
     }
-    intf_DbgMsg("actual configuration: %dx%d,%d (%d bytes/pixel, %d bytes/line), ratio %.2f:%.2f, gray=%d\n",
+    intf_DbgMsg("actual configuration: %dx%d,%d (%d bytes/pixel, %d bytes/line), scaling %+d:%+d, gray=%d\n",
                 p_vout->i_width, p_vout->i_height, p_vout->i_screen_depth,
                 p_vout->i_bytes_per_pixel, p_vout->i_bytes_per_line,
-                p_vout->f_x_ratio, p_vout->f_y_ratio, p_vout->b_grayscale );
-
+                p_vout->i_horizontal_scale, p_vout->i_vertical_scale, p_vout->b_grayscale );
 #ifdef STATS
     /* Initialize statistics fields */
     p_vout->render_time           = 0;    
@@ -253,7 +253,8 @@ void vout_DestroySubtitle( vout_thread_t *p_vout, subtitle_t *p_sub )
  *******************************************************************************
  * Remove the reservation flag of a picture, which will cause it to be ready for
  * display. The picture does not need to be locked, since it is ignored by
- * the output thread if is reserved.
+ * the output thread if is reserved. The picture won't be displayed until 
+ * vout_DatePicture has been called.
  *******************************************************************************/
 void  vout_DisplayPicture( vout_thread_t *p_vout, picture_t *p_pic )
 {
@@ -279,6 +280,19 @@ void  vout_DisplayPicture( vout_thread_t *p_vout, picture_t *p_pic )
 #endif
 }
 
+/*******************************************************************************
+ * vout_DatePicture: date a picture
+ *******************************************************************************
+ * Remove the reservation flag of a picture, which will cause it to be ready for
+ * display. The picture does not need to be locked, since it is ignored by
+ * the output thread if is reserved. The picture won't be displayed until
+ * vout_DisplayPicture has been called.
+ *******************************************************************************/
+void  vout_DatePicture( vout_thread_t *p_vout, picture_t *p_pic, mtime_t date )
+{
+    //??
+}
+
 /*******************************************************************************
  * vout_CreatePicture: allocate a picture in the video output heap.
  *******************************************************************************
@@ -996,11 +1010,11 @@ static int RenderInfo( vout_thread_t *p_vout, boolean_t b_blank )
             break;            
         }        
     }
-    sprintf( psz_buffer, "%s %dx%d:%d %.2f:%.2f g%+.2f   pic: %d/%d/%d", 
+    sprintf( psz_buffer, "%s %dx%d:%d scaling %+d:%+d g%+.2f   pic: %d/%d/%d", 
              p_vout->b_grayscale ? "gray" : "rgb", 
-             p_vout->i_width, p_vout->i_height,
-             p_vout->i_screen_depth, p_vout->f_x_ratio, p_vout->f_y_ratio, p_vout->f_gamma,
-             i_reserved_pic, i_ready_pic,
+             p_vout->i_width, p_vout->i_height, p_vout->i_screen_depth, 
+             p_vout->i_horizontal_scale, p_vout->i_vertical_scale, 
+             p_vout->f_gamma, i_reserved_pic, i_ready_pic,
              VOUT_MAX_PICTURES );
     vout_SysPrint( p_vout, 0, p_vout->i_height, -1, 1, psz_buffer );    
 #endif