From e5f2072364ac450e0f593f534ddee2ae1a8f2176 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 10 Jan 2015 19:11:28 +0100 Subject: command: change properties added in previous commit Make their meaning more exact, and don't pretend that there's a reasonable definition for "bits-per-pixel". Also make unset fields unavailable. average_depth still might be inconsistent: for example, 10 bit 4:2:0 is identified as 24 bits, but RGB 4:4:4 as 12 bits. So YUV formats seemingly drop the per-component padding, while RGB formats do not. Internally it's consistent though: 10 bit YUV components are read as 16 bit, and the padding must be 0 (it's basically like an odd fixed- point representation, rather than a bitfield). --- video/img_format.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'video') diff --git a/video/img_format.c b/video/img_format.c index 7df0923cfe..9f7bf32779 100644 --- a/video/img_format.c +++ b/video/img_format.c @@ -240,8 +240,10 @@ struct mp_imgfmt_desc mp_imgfmt_get_desc(int mpfmt) if ((desc.bpp[0] % 8) != 0) desc.align_x = 8 / desc.bpp[0]; // expect power of 2 - if (pd->flags & AV_PIX_FMT_FLAG_HWACCEL) + if (pd->flags & AV_PIX_FMT_FLAG_HWACCEL) { desc.flags |= MP_IMGFLAG_HWACCEL; + desc.plane_bits = 8; // usually restricted to 8 bit; may change + } return desc; } -- cgit v1.2.3