From ae4819e1242d4443346fab86aadcb0041ff1c508 Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Mon, 11 Jun 2012 12:59:44 +0300 Subject: Query max supported Xv image size --- src/video_out/video_out_xv.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src') diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index 2d709c599..4e37e154b 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -1224,6 +1224,8 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * XvAdaptorInfo *adaptor_info; unsigned int adaptor_num; xv_prefertype prefer_type; + unsigned int nencode = 0; + XvEncodingInfo *encodings = NULL; this = (xv_driver_t *) calloc(1, sizeof(xv_driver_t)); if (!this) @@ -1501,6 +1503,26 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * UNLOCK_DISPLAY(this); } + /* + * check max. supported image size + */ + + XvQueryEncodings(this->display, xv_port, &nencode, &encodings); + if (encodings) { + int n; + for (n = 0; n < nencode; n++) { + if (!strcmp(encodings[n].name, "XV_IMAGE")) { + xprintf(this->xine, XINE_VERBOSITY_LOG, + LOG_MODULE ": max XvImage size %li x %li\n", + encodings[n].width, encodings[n].height); + this->props[VO_PROP_MAX_VIDEO_WIDTH].value = encodings[n].width; + this->props[VO_PROP_MAX_VIDEO_HEIGHT].value = encodings[n].height; + break; + } + } + XvFreeEncodingInfo(encodings); + } + /* * try to create a shared image * to find out if MIT shm really works, using supported format -- cgit v1.2.3