summaryrefslogtreecommitdiffstats
path: root/video/img_format.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-04 22:26:31 +0100
committerwm4 <wm4@nowhere>2014-11-05 01:41:34 +0100
commitffe9c0350259efa81bc5500226c65315cd8b936d (patch)
treec59af3382c2458735f9f7d089d3f589bb78cc8cf /video/img_format.c
parent5e9dfe932f8319c89cff0e0d93a2d3fe723b0429 (diff)
downloadmpv-ffe9c0350259efa81bc5500226c65315cd8b936d.tar.bz2
mpv-ffe9c0350259efa81bc5500226c65315cd8b936d.tar.xz
video: get hwaccel flag from pixdesc
Diffstat (limited to 'video/img_format.c')
-rw-r--r--video/img_format.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/video/img_format.c b/video/img_format.c
index e838b5ca55..2f45787c5a 100644
--- a/video/img_format.c
+++ b/video/img_format.c
@@ -121,7 +121,8 @@ static struct mp_imgfmt_desc mp_only_imgfmt_desc(int mpfmt)
return (struct mp_imgfmt_desc) {
.id = mpfmt,
.avformat = AV_PIX_FMT_NONE,
- .flags = MP_IMGFLAG_BE | MP_IMGFLAG_LE | MP_IMGFLAG_RGB,
+ .flags = MP_IMGFLAG_BE | MP_IMGFLAG_LE | MP_IMGFLAG_RGB |
+ MP_IMGFLAG_HWACCEL,
};
}
return (struct mp_imgfmt_desc) {0};
@@ -224,6 +225,9 @@ 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)
+ desc.flags |= MP_IMGFLAG_HWACCEL;
+
return desc;
}