diff options
author | wm4 <wm4@nowhere> | 2012-12-24 01:10:57 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-01-13 20:04:11 +0100 |
commit | 5830d639b8d58b0911510db1ccb5de296adfcb4b (patch) | |
tree | 750496d0c09dc293a2ba7a8589a7679535edfc35 /video/out/vo_x11.c | |
parent | 3791c226b7f3bebbb63a96b61db67b9dc97ff9b8 (diff) | |
download | mpv-5830d639b8d58b0911510db1ccb5de296adfcb4b.tar.bz2 mpv-5830d639b8d58b0911510db1ccb5de296adfcb4b.tar.xz |
video: remove img_format compat hacks
Remove the strange things the old mp_image_setfmt() code did to the
image format parameters. This includes setting chroma shift to 31 for
gray (Y8) formats and more.
Y8 + vo_opengl_old didn't actually work for unknown reasons (regression
in this branch). Fix this. The difference is that Y8 is now interpreted
as gray RGB (LUMINANCE texture) instead of involving YUV (and levels)
conversion.
Get rid of distinguishing RGB and BGR. There wasn't really any good
reason for this.
Remove mp_get_chroma_shift() and IMGFMT_IS_YUVP16*(). mp_imgfmt_desc
gives the same information and more.
Diffstat (limited to 'video/out/vo_x11.c')
-rw-r--r-- | video/out/vo_x11.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c index 2ce28a4292..8b41a7afc3 100644 --- a/video/out/vo_x11.c +++ b/video/out/vo_x11.c @@ -524,15 +524,17 @@ static int query_format(struct vo *vo, uint32_t format) mp_msg(MSGT_VO, MSGL_DBG2, "vo_x11: query_format was called: %x (%s)\n", format, vo_format_name(format)); - if (IMGFMT_IS_BGR(format)) { - if (IMGFMT_BGR_DEPTH(format) < 8) - return 0; - if (IMGFMT_BGR_DEPTH(format) == vo->x11->depthonscreen) - return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | - VFCAP_OSD | VFCAP_FLIP; - else - return VFCAP_CSP_SUPPORTED | VFCAP_OSD | - VFCAP_FLIP; + if (IMGFMT_IS_RGB(format)) { + for (int n = 0; fmt2Xfmt[n].mpfmt; n++) { + if (fmt2Xfmt[n].mpfmt == format) { + if (IMGFMT_RGB_DEPTH(format) == vo->x11->depthonscreen) { + return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | + VFCAP_OSD | VFCAP_FLIP; + } else { + return VFCAP_CSP_SUPPORTED | VFCAP_OSD | VFCAP_FLIP; + } + } + } } switch (format) { |