From b49089c65f7cfa2293cb432606d0ac13cb9353f3 Mon Sep 17 00:00:00 2001 From: Juergen Keil Date: Wed, 26 Sep 2001 17:19:48 +0000 Subject: - Trying to fix video window size for mpeg streams with aspect_ratio_information==1 ("square source pels") - Add aspect_ratio_information==4 (2.21:1) - Aspect ratio switching ('a' key) now cycles through "square source pels", too. CVS patchset: 698 CVS date: 2001/09/26 17:19:48 --- src/video_out/video_out_aa.c | 4 ++-- src/video_out/video_out_syncfb.c | 13 +++++++++---- src/video_out/video_out_xshm.c | 17 ++++++++++++----- src/video_out/video_out_xv.c | 15 +++++++++++---- src/xine-engine/video_out.h | 4 +++- 5 files changed, 37 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/video_out/video_out_aa.c b/src/video_out/video_out_aa.c index a96d089d7..52b67f65a 100644 --- a/src/video_out/video_out_aa.c +++ b/src/video_out/video_out_aa.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_aa.c,v 1.11 2001/07/24 12:57:30 guenter Exp $ + * $Id: video_out_aa.c,v 1.12 2001/09/26 17:19:49 jkeil Exp $ * * video_out_aa.c, ascii-art output plugin for xine * @@ -249,7 +249,7 @@ static int aa_set_property (vo_driver_t *this_gen, aa_driver_t *this = (aa_driver_t*) this_gen; if ( property == VO_PROP_ASPECT_RATIO) { - if (value>ASPECT_DVB) + if (value>=NUM_ASPECT_RATIOS) value = ASPECT_AUTO; this->user_ratio = value; diff --git a/src/video_out/video_out_syncfb.c b/src/video_out/video_out_syncfb.c index 8df8ba5c6..9084dffa1 100644 --- a/src/video_out/video_out_syncfb.c +++ b/src/video_out/video_out_syncfb.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_syncfb.c,v 1.12 2001/08/20 11:16:40 joachim_koenig Exp $ + * $Id: video_out_syncfb.c,v 1.13 2001/09/26 17:19:49 jkeil Exp $ * * video_out_syncfb.c, Matrox G400 video extension interface for xine * @@ -415,16 +415,19 @@ printf("new frame format width %d height %d ratio %d format %x\n",width,height,r fprintf (stderr, "invalid ratio\n"); exit (1); break; - case 1: /* "square" => 4:3 */ case 2: aspect_ratio = 4.0 / 3.0; break; case 3: aspect_ratio = 16.0 / 9.0; break; + case 4: + aspect_ratio = 2.11/1.0; + break; case 42: /* some stupid stream => don't touch aspect ratio */ default: xprintf (VIDEO, "unknown aspect ratio (%d) in stream. untouched.\n", _mga_priv.ratio); + case 1: /* "square" source pels */ aspect_ratio = (double)_mga_priv.image_width / (double)_mga_priv.image_height; break; } @@ -432,8 +435,10 @@ printf("new frame format width %d height %d ratio %d format %x\n",width,height,r aspect_ratio = 16.0 / 9.0; } else if (_mga_priv.user_ratio == ASPECT_DVB) { aspect_ratio = 2.0 / 1.0; + } else if (_mga_priv.user_ratio == ASPECT_SQUARE) { + aspect_ratio = (double)_mga_priv.image_width / (double)_mga_priv.image_height; } else { - aspect_ratio = 1.0; + aspect_ratio = 4.0 / 3.0; } aspect_ratio *= display_ratio; if (_mga_priv.image_height * aspect_ratio >= _mga_priv.image_width) { @@ -741,7 +746,7 @@ printf("set property %d value %d\n",property,value); } return value; case VO_PROP_ASPECT_RATIO: - if (value > ASPECT_DVB) + if (value >= NUM_ASPECT_RATIOS) value = ASPECT_AUTO; if (value != _mga_priv.user_ratio) { _mga_priv.user_ratio = value; diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c index 250852521..e957dc478 100644 --- a/src/video_out/video_out_xshm.c +++ b/src/video_out/video_out_xshm.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_xshm.c,v 1.39 2001/09/25 18:39:36 jkeil Exp $ + * $Id: video_out_xshm.c,v 1.40 2001/09/26 17:19:49 jkeil Exp $ * * video_out_xshm.c, X11 shared memory extension interface for xine * @@ -459,16 +459,19 @@ static void xshm_calc_output_size (xshm_driver_t *this) { case 3: /* anamorphic */ desired_ratio = 16.0 /9.0; break; + case 4: /* 2.11:1 */ + desired_ratio = 2.11/1.0; + break; + case 1: /* square pels */ case 42: /* probably non-mpeg stream => don't touch aspect ratio */ desired_ratio = image_ratio; break; - case 0: /* forbidden */ + case 0: /* forbidden -> 4:3 */ fprintf (stderr, "invalid ratio, using 4:3\n"); - case 1: /* "square" => 4:3 */ - case 2: /* 4:3 */ default: xprintf (VIDEO, "unknown aspect ratio (%d) in stream => using 4:3\n", this->delivered_ratio_code); + case 2: /* 4:3 */ desired_ratio = 4.0 / 3.0; break; } @@ -479,6 +482,10 @@ static void xshm_calc_output_size (xshm_driver_t *this) { case ASPECT_DVB: desired_ratio = 2.0 / 1.0; break; + case ASPECT_SQUARE: + desired_ratio = image_ratio; + break; + case ASPECT_FULL: default: desired_ratio = 4.0 / 3.0; } @@ -817,7 +824,7 @@ static int xshm_set_property (vo_driver_t *this_gen, xshm_driver_t *this = (xshm_driver_t *) this_gen; if ( property == VO_PROP_ASPECT_RATIO) { - if (value>ASPECT_DVB) + if (value>=NUM_ASPECT_RATIOS) value = ASPECT_AUTO; this->user_ratio = value; this->gui_changed |= GUI_ASPECT_CHANGED; diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index 9b9446637..bd377c9b0 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_xv.c,v 1.62 2001/09/19 23:12:24 miguelfreitas Exp $ + * $Id: video_out_xv.c,v 1.63 2001/09/26 17:19:49 jkeil Exp $ * * video_out_xv.c, X11 video extension interface for xine * @@ -546,16 +546,19 @@ static void xv_calc_format (xv_driver_t *this, case 3: /* anamorphic */ desired_ratio = 16.0 /9.0; break; + case 4: /* 2.11:1 */ + desired_ratio = 2.11/1.0; + break; + case 1: /* "square" source pels */ case 42: /* probably non-mpeg stream => don't touch aspect ratio */ desired_ratio = image_ratio; break; case 0: /* forbidden */ fprintf (stderr, "invalid ratio, using 4:3\n"); - case 1: /* "square" => 4:3 */ - case 2: /* 4:3 */ default: xprintf (VIDEO, "unknown aspect ratio (%d) in stream => using 4:3\n", ratio_code); + case 2: /* 4:3 */ desired_ratio = 4.0 / 3.0; break; } @@ -566,6 +569,10 @@ static void xv_calc_format (xv_driver_t *this, case ASPECT_DVB: desired_ratio = 2.0 / 1.0; break; + case ASPECT_SQUARE: + desired_ratio = image_ratio; + break; + case ASPECT_FULL: default: desired_ratio = 4.0 / 3.0; } @@ -738,7 +745,7 @@ static int xv_set_property (vo_driver_t *this_gen, break; case VO_PROP_ASPECT_RATIO: - if (value>ASPECT_DVB) + if (value>=NUM_ASPECT_RATIOS) value = ASPECT_AUTO; this->props[property].value = value; diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h index 087f177a3..48e85e56b 100644 --- a/src/xine-engine/video_out.h +++ b/src/xine-engine/video_out.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out.h,v 1.21 2001/09/26 01:18:19 guenter Exp $ + * $Id: video_out.h,v 1.22 2001/09/26 17:19:49 jkeil Exp $ * * * xine version of video_out.h @@ -192,6 +192,8 @@ struct vo_instance_s { #define ASPECT_ANAMORPHIC 1 /* 16:9 */ #define ASPECT_FULL 2 /* 4:3 */ #define ASPECT_DVB 3 /* 1:2 */ +#define ASPECT_SQUARE 4 /* square pels */ +#define NUM_ASPECT_RATIOS 5 /* get_frame flags */ -- cgit v1.2.3