/* 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
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 */
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
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
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
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 );
// ??
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;
}
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;
}
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 );
}
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 */
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;
*******************************************************************************
* 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 )
{
#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.
*******************************************************************************
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