diff options
-rw-r--r-- | include/xine.h | 10 | ||||
-rw-r--r-- | src/vdr/input_vdr.c | 21 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 32 |
3 files changed, 47 insertions, 16 deletions
diff --git a/include/xine.h b/include/xine.h index 6eaac8975..47580fd5d 100644 --- a/include/xine.h +++ b/include/xine.h @@ -411,12 +411,18 @@ int xine_get_current_frame (xine_stream_t *stream, int xine_get_current_frame_s (xine_stream_t *stream, int *width, int *height, int *ratio_code, int *format, - uint8_t *img, int *size) XINE_PROTECTED; + uint8_t *img, int *size, + int *interlaced, + int *crop_left, int *crop_right, + int *crop_top, int *crop_bottom) XINE_PROTECTED; int xine_get_current_frame_alloc (xine_stream_t *stream, int *width, int *height, int *ratio_code, int *format, - uint8_t **img, int *size) XINE_PROTECTED; + uint8_t **img, int *size, + int *interlaced, + int *crop_left, int *crop_right, + int *crop_top, int *crop_bottom) XINE_PROTECTED; /* xine image formats */ #define XINE_IMGFMT_YV12 (('2'<<24)|('1'<<16)|('V'<<8)|'Y') diff --git a/src/vdr/input_vdr.c b/src/vdr/input_vdr.c index ade2ecfa1..5a2b70568 100644 --- a/src/vdr/input_vdr.c +++ b/src/vdr/input_vdr.c @@ -964,16 +964,21 @@ fprintf(stderr, "ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß\n"); READ_DATA_OR_FAIL(grab_image, lprintf("got GRABIMAGE\n")); { - off_t ret_val = -1; + off_t ret_val = -1; - uint8_t *img = 0; - int frame_size = 0; - int width = 0; - int height = 0; - int ratio_code = 0; - int format = 0; + uint8_t *img = 0; + int frame_size = 0; + int width = 0; + int height = 0; + int ratio_code = 0; + int format = 0; + int interlaced = 0; + int crop_left = 0; + int crop_right = 0; + int crop_top = 0; + int crop_bottom = 0; - if (xine_get_current_frame_alloc(this->stream, &width, &height, &ratio_code, &format, &img, &frame_size)) + if (xine_get_current_frame_alloc(this->stream, &width, &height, &ratio_code, &format, &img, &frame_size, &interlaced, &crop_left, &crop_right, &crop_top, &crop_bottom)) { if (ratio_code == XINE_VO_ASPECT_SQUARE) ratio_code = 10000; 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) { |