From 9c1ca7282eba7499c604a5bdaa27b635261025a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20Ni=C3=9Fl?= Date: Sun, 11 May 2008 17:42:59 +0200 Subject: Extend xine_get_current_frame to provide cropping and interlacing information. Cropping information is necessary for frame formats like 1920x1080 which are coded as 1920x1088, i. e. 8 lines are cropped away at the bottom. The information whether a frame is interlaced is necessary for proper upscaling of 4:2:0 frame formats as it must be done per field when the frame is interlaced. Otherwise choma and luma won't match. Make input_vdr.c compile again due to changed xine_get_current_frame. --- src/xine-engine/xine.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index c51fdaaf7..7078a2e2c 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -1983,7 +1983,10 @@ int xine_get_pos_length (xine_stream_t *stream, int *pos_stream, static int _x_get_current_frame_impl (xine_stream_t *stream, int *width, int *height, int *ratio_code, int *format, - uint8_t **img, int *size, int alloc_img) { + uint8_t **img, int *size, int alloc_img, + int *interlaced, + int *crop_left, int *crop_right, + int *crop_top, int *crop_bottom) { vo_frame_t *frame; int required_size; @@ -2012,6 +2015,17 @@ static int _x_get_current_frame_impl (xine_stream_t *stream, int *width, int *he *format = frame->format; + if (interlaced) + *interlaced = frame->progressive_frame ? 0 : (2 - frame->top_field_first); + if (crop_left) + *crop_left = frame->crop_left; + if (crop_right) + *crop_right = frame->crop_right; + if (crop_top) + *crop_top = frame->crop_top; + if (crop_bottom) + *crop_bottom = frame->crop_bottom; + switch (*format) { case XINE_IMGFMT_YV12: @@ -2093,21 +2107,27 @@ static int _x_get_current_frame_impl (xine_stream_t *stream, int *width, int *he int xine_get_current_frame_alloc (xine_stream_t *stream, int *width, int *height, int *ratio_code, int *format, - uint8_t **img, int *size) { + uint8_t **img, int *size, + int *interlaced, + int *crop_left, int *crop_right, + int *crop_top, int *crop_bottom) { uint8_t *no_img = NULL; - return _x_get_current_frame_impl(stream, width, height, ratio_code, format, img ? img : &no_img, size, img != NULL); + return _x_get_current_frame_impl(stream, width, height, ratio_code, format, img ? img : &no_img, size, img != NULL, interlaced, crop_left, crop_right, crop_top, crop_bottom); } int xine_get_current_frame_s (xine_stream_t *stream, int *width, int *height, int *ratio_code, int *format, - uint8_t *img, int *size) { - return (!img || size) && _x_get_current_frame_impl(stream, width, height, ratio_code, format, &img, size, 0); + uint8_t *img, int *size, + int *interlaced, + int *crop_left, int *crop_right, + int *crop_top, int *crop_bottom) { + return (!img || size) && _x_get_current_frame_impl(stream, width, height, ratio_code, format, &img, size, 0, interlaced, crop_left, crop_right, crop_top, crop_bottom); } int xine_get_current_frame (xine_stream_t *stream, int *width, int *height, int *ratio_code, int *format, uint8_t *img) { - return _x_get_current_frame_impl(stream, width, height, ratio_code, format, &img, NULL, 0); + return _x_get_current_frame_impl(stream, width, height, ratio_code, format, &img, NULL, 0, NULL, NULL, NULL, NULL, NULL); } int xine_get_spu_lang (xine_stream_t *stream, int channel, char *lang) { -- cgit v1.2.3