diff options
Diffstat (limited to 'src/xine-engine')
-rw-r--r-- | src/xine-engine/post.c | 6 | ||||
-rw-r--r-- | src/xine-engine/post.h | 4 | ||||
-rw-r--r-- | src/xine-engine/video_decoder.h | 4 | ||||
-rw-r--r-- | src/xine-engine/video_out.c | 42 | ||||
-rw-r--r-- | src/xine-engine/video_out.h | 20 | ||||
-rw-r--r-- | src/xine-engine/vo_scale.c | 53 | ||||
-rw-r--r-- | src/xine-engine/vo_scale.h | 4 |
7 files changed, 44 insertions, 89 deletions
diff --git a/src/xine-engine/post.c b/src/xine-engine/post.c index 8c247e706..07c9c223d 100644 --- a/src/xine-engine/post.c +++ b/src/xine-engine/post.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: post.c,v 1.12 2003/05/31 18:33:31 miguelfreitas Exp $ + * $Id: post.c,v 1.13 2003/08/04 03:47:11 miguelfreitas Exp $ */ /* @@ -39,10 +39,10 @@ static void post_video_open(xine_video_port_t *port_gen, xine_stream_t *stream) } static vo_frame_t *post_video_get_frame(xine_video_port_t *port_gen, uint32_t width, - uint32_t height, int ratio_code, int format, int flags) { + uint32_t height, double ratio, int format, int flags) { post_video_port_t *port = (post_video_port_t *)port_gen; return port->original_port->get_frame(port->original_port, - width, height, ratio_code, format, flags); + width, height, ratio, format, flags); } static vo_frame_t *post_video_get_last_frame(xine_video_port_t *port_gen) { diff --git a/src/xine-engine/post.h b/src/xine-engine/post.h index 894ef9180..38dc3a75c 100644 --- a/src/xine-engine/post.h +++ b/src/xine-engine/post.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: post.h,v 1.9 2003/05/31 18:33:31 miguelfreitas Exp $ + * $Id: post.h,v 1.10 2003/08/04 03:47:11 miguelfreitas Exp $ * * post plugin definitions * @@ -38,7 +38,7 @@ # include <xine/xineutils.h> #endif -#define POST_PLUGIN_IFACE_VERSION 3 +#define POST_PLUGIN_IFACE_VERSION 4 typedef struct post_class_s post_class_t; diff --git a/src/xine-engine/video_decoder.h b/src/xine-engine/video_decoder.h index bf5936b70..e324e4b39 100644 --- a/src/xine-engine/video_decoder.h +++ b/src/xine-engine/video_decoder.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_decoder.h,v 1.9 2003/05/20 13:50:57 mroi Exp $ + * $Id: video_decoder.h,v 1.10 2003/08/04 03:47:11 miguelfreitas Exp $ * * xine video decoder plugin interface * @@ -34,7 +34,7 @@ # include <xine/buffer.h> #endif -#define VIDEO_DECODER_IFACE_VERSION 14 +#define VIDEO_DECODER_IFACE_VERSION 15 /* * generic xine video decoder plugin interface diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index bc3373b58..6797023fa 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.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.c,v 1.166 2003/07/13 15:27:34 guenter Exp $ + * $Id: video_out.c,v 1.167 2003/08/04 03:47:11 miguelfreitas Exp $ * * frame allocation / queuing / scheduling / output functions */ @@ -266,7 +266,7 @@ static void vo_frame_driver_copy(vo_frame_t *img) static vo_frame_t *vo_get_frame (xine_video_port_t *this_gen, uint32_t width, uint32_t height, - int ratio, int format, + double ratio, int format, int flags) { vo_frame_t *img; @@ -1116,34 +1116,16 @@ int xine_get_next_video_frame (xine_video_port_t *this_gen, img = vo_remove_from_img_buf_queue_int (this->display_img_buf_queue); pthread_mutex_unlock(&this->display_img_buf_queue->mutex); - frame->vpts = img->vpts; - frame->duration = img->duration; - frame->width = img->width; - frame->height = img->height; - frame->pos_stream = img->extra_info->input_pos; - frame->pos_time = img->extra_info->input_time; - - switch (img->ratio) { - case XINE_VO_ASPECT_ANAMORPHIC: /* anamorphic */ - case XINE_VO_ASPECT_PAN_SCAN: /* we display pan&scan as widescreen */ - frame->aspect_ratio = 16.0 /9.0; - break; - case XINE_VO_ASPECT_DVB: /* 2.11:1 */ - frame->aspect_ratio = 2.11/1.0; - break; - case XINE_VO_ASPECT_SQUARE: /* square pels */ - case XINE_VO_ASPECT_DONT_TOUCH: /* probably non-mpeg stream => don't touch aspect ratio */ - frame->aspect_ratio = (double) img->width / (double) img->height; - break; - case 0: /* forbidden -> 4:3 */ - default: - case XINE_VO_ASPECT_4_3: /* 4:3 */ - frame->aspect_ratio = 4.0 / 3.0; - break; - } - frame->colorspace = img->format; - frame->data = img->base[0]; - frame->xine_frame = img; + frame->vpts = img->vpts; + frame->duration = img->duration; + frame->width = img->width; + frame->height = img->height; + frame->pos_stream = img->extra_info->input_pos; + frame->pos_time = img->extra_info->input_time; + frame->aspect_ratio = img->ratio; + frame->colorspace = img->format; + frame->data = img->base[0]; + frame->xine_frame = img; return 1; } diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h index aeccdf01e..77517a9c8 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.92 2003/06/27 13:40:51 mroi Exp $ + * $Id: video_out.h,v 1.93 2003/08/04 03:47:11 miguelfreitas Exp $ * * * xine version of video_out.h @@ -129,7 +129,7 @@ struct vo_frame_s { /* additional information to be able to duplicate frames: */ int width, height; - int ratio; /* aspect ratio, codes see below */ + double ratio; /* aspect ratio */ int format; /* IMGFMT_YV12 or IMGFMT_YUY2 */ int drawn; /* used by decoder, frame has already been drawn */ @@ -175,7 +175,7 @@ struct xine_video_port_s { * flags == field/prediction flags */ vo_frame_t* (*get_frame) (xine_video_port_t *self, uint32_t width, - uint32_t height, int ratio_code, + uint32_t height, double ratio, int format, int flags); vo_frame_t* (*get_last_frame) (xine_video_port_t *self); @@ -245,16 +245,6 @@ struct xine_video_port_s { */ #define VO_NUM_RECENT_FRAMES 2 - -/* possible ratios for the VO_PROP_ASPECT_RATIO call */ - -#define ASPECT_AUTO 0 -#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 */ #define VO_TOP_FIELD 1 @@ -288,7 +278,7 @@ struct xine_video_port_s { * from generic vo functions. */ -#define VIDEO_OUT_DRIVER_IFACE_VERSION 15 +#define VIDEO_OUT_DRIVER_IFACE_VERSION 16 struct vo_driver_s { @@ -307,7 +297,7 @@ struct vo_driver_s { */ void (*update_frame_format) (vo_driver_t *self, vo_frame_t *img, uint32_t width, uint32_t height, - int ratio_code, int format, int flags); + double ratio, int format, int flags); /* display a given frame */ void (*display_frame) (vo_driver_t *self, vo_frame_t *vo_img); diff --git a/src/xine-engine/vo_scale.c b/src/xine-engine/vo_scale.c index 168d3e4fd..d113439eb 100644 --- a/src/xine-engine/vo_scale.c +++ b/src/xine-engine/vo_scale.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: vo_scale.c,v 1.21 2003/04/24 11:03:50 jstembridge Exp $ + * $Id: vo_scale.c,v 1.22 2003/08/04 03:47:11 miguelfreitas Exp $ * * Contains common code to calculate video scaling parameters. * In short, it will map frame dimensions to screen/window size. @@ -59,42 +59,24 @@ void vo_scale_compute_ideal_size (vo_scale_t *this) { image_ratio = (double) this->delivered_width / (double) this->delivered_height; switch (this->user_ratio) { - case ASPECT_AUTO: - switch (this->delivered_ratio_code) { - case XINE_VO_ASPECT_ANAMORPHIC: /* anamorphic */ - case XINE_VO_ASPECT_PAN_SCAN: /* we display pan&scan as widescreen */ - desired_ratio = 16.0 /9.0; - break; - case XINE_VO_ASPECT_DVB: /* 2.11:1 */ - desired_ratio = 2.11/1.0; - break; - case XINE_VO_ASPECT_SQUARE: /* square pels */ - case XINE_VO_ASPECT_DONT_TOUCH: /* probably non-mpeg stream => don't touch aspect ratio */ - desired_ratio = image_ratio; - break; - case 0: /* forbidden -> 4:3 */ - printf ("vo_scale: invalid ratio, using 4:3\n"); - default: - if (!warning_issued) { - printf ("vo_scale: unknown aspect ratio (%d) in stream => using 4:3\n", - this->delivered_ratio_code); - warning_issued = 1; - } - case XINE_VO_ASPECT_4_3: /* 4:3 */ - desired_ratio = 4.0 / 3.0; - break; + case XINE_VO_ASPECT_AUTO: + if (this->delivered_ratio <= 0.0) { + /* no way, that's crazy */ + desired_ratio = image_ratio; + } else { + desired_ratio = this->delivered_ratio; } break; - case ASPECT_ANAMORPHIC: + case XINE_VO_ASPECT_ANAMORPHIC: desired_ratio = 16.0 / 9.0; break; - case ASPECT_DVB: + case XINE_VO_ASPECT_DVB: desired_ratio = 2.0 / 1.0; break; - case ASPECT_SQUARE: + case XINE_VO_ASPECT_SQUARE: desired_ratio = image_ratio; break; - case ASPECT_FULL: + case XINE_VO_ASPECT_4_3: default: desired_ratio = 4.0 / 3.0; } @@ -325,15 +307,15 @@ void vo_scale_translate_gui2video(vo_scale_t *this, char *vo_scale_aspect_ratio_name(int a) { switch (a) { - case ASPECT_AUTO: + case XINE_VO_ASPECT_AUTO: return "auto"; - case ASPECT_SQUARE: + case XINE_VO_ASPECT_SQUARE: return "square"; - case ASPECT_FULL: + case XINE_VO_ASPECT_4_3: return "4:3"; - case ASPECT_ANAMORPHIC: + case XINE_VO_ASPECT_ANAMORPHIC: return "16:9"; - case ASPECT_DVB: + case XINE_VO_ASPECT_DVB: return "2:1"; default: return "unknown"; @@ -373,7 +355,8 @@ void vo_scale_init(vo_scale_t *this, int support_zoom, int scaling_disabled, this->zoom_factor_x = 1.0; this->zoom_factor_y = 1.0; this->gui_pixel_aspect = 1.0; - this->user_ratio = ASPECT_AUTO; + this->user_ratio = XINE_VO_ASPECT_AUTO; + this->delivered_ratio = 0.0; this->output_horizontal_position = config->register_range(config, "video.horizontal_position", 50, 0, 100, diff --git a/src/xine-engine/vo_scale.h b/src/xine-engine/vo_scale.h index 16d44f3f2..f53f6b852 100644 --- a/src/xine-engine/vo_scale.h +++ b/src/xine-engine/vo_scale.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: vo_scale.h,v 1.8 2003/05/20 13:50:57 mroi Exp $ + * $Id: vo_scale.h,v 1.9 2003/08/04 03:47:11 miguelfreitas Exp $ * * vo_scale.h * @@ -64,7 +64,7 @@ struct vo_scale_s { */ int delivered_width; int delivered_height; - int delivered_ratio_code; + double delivered_ratio; /* * displayed part of delivered images, |