summaryrefslogtreecommitdiffstats
path: root/video/img_format.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-05 21:59:26 +0100
committerwm4 <wm4@nowhere>2013-11-05 22:05:23 +0100
commitd6de87d1d3aa4ecddf5a4e523c0410be2ab517aa (patch)
tree771d7e243ae3bfd064bbd2a10a4e907ff81a3e84 /video/img_format.h
parent890d8ea19466b41a88c63c61a4cfd735c3de668f (diff)
downloadmpv-d6de87d1d3aa4ecddf5a4e523c0410be2ab517aa.tar.bz2
mpv-d6de87d1d3aa4ecddf5a4e523c0410be2ab517aa.tar.xz
video: make IMGFMT_RGB0 etc. exist even if libavutil doesn't support it
These formats are helpful for distinguishing surfaces with and without alpha. Unfortunately, Libav and older version of FFmpeg don't support them, so code will break. Fix this by treating these formats specially on the mpv side, mapping them to RGBA on Libav, and unseting the alpha bit in the mp_imgfmt_desc struct.
Diffstat (limited to 'video/img_format.h')
-rw-r--r--video/img_format.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/video/img_format.h b/video/img_format.h
index 4d876304a0..1cfe4465ec 100644
--- a/video/img_format.h
+++ b/video/img_format.h
@@ -78,7 +78,7 @@ struct mp_imgfmt_desc {
int8_t ys[MP_MAX_PLANES];
};
-struct mp_imgfmt_desc mp_imgfmt_get_desc(unsigned int out_fmt);
+struct mp_imgfmt_desc mp_imgfmt_get_desc(int imgfmt);
enum mp_imgfmt {
IMGFMT_NONE = 0,
@@ -176,13 +176,9 @@ enum mp_imgfmt {
// Byte accessed (low address to high address)
IMGFMT_ARGB,
- IMGFMT_0RGB, // "0" is a padding byte (as opposed to alpha)
IMGFMT_BGRA,
- IMGFMT_BGR0,
IMGFMT_ABGR,
- IMGFMT_0BGR,
IMGFMT_RGBA,
- IMGFMT_RGB0,
IMGFMT_BGR24, // 3 bytes per pixel
IMGFMT_RGB24,
IMGFMT_RGB48_LE, // 6 bytes per pixel, uint16_t channels
@@ -192,6 +188,15 @@ enum mp_imgfmt {
IMGFMT_BGRA64_LE,
IMGFMT_BGRA64_BE,
+ // Like e.g. IMGFMT_ARGB, but has a padding byte instead of alpha
+ IMGFMT_0RGB,
+ IMGFMT_BGR0,
+ IMGFMT_0BGR,
+ IMGFMT_RGB0,
+
+ IMGFMT_RGB0_START = IMGFMT_0RGB,
+ IMGFMT_RGB0_END = IMGFMT_RGB0,
+
// Accessed with bit-shifts (components ordered from LSB to MSB)
IMGFMT_RGB8, // r3 g3 b2
IMGFMT_BGR8,