summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
Diffstat (limited to 'video')
-rw-r--r--video/fmt-conversion.c2
-rw-r--r--video/img_format.c6
-rw-r--r--video/img_format.h9
3 files changed, 6 insertions, 11 deletions
diff --git a/video/fmt-conversion.c b/video/fmt-conversion.c
index 71cd044169..d5dad6f244 100644
--- a/video/fmt-conversion.c
+++ b/video/fmt-conversion.c
@@ -48,8 +48,6 @@ static const struct {
{IMGFMT_BGR8, AV_PIX_FMT_BGR8},
{IMGFMT_BGR4, AV_PIX_FMT_BGR4},
{IMGFMT_PAL8, AV_PIX_FMT_PAL8},
- {IMGFMT_GBRP, AV_PIX_FMT_GBRP},
- {IMGFMT_GBRAP, AV_PIX_FMT_GBRAP},
{IMGFMT_YUYV, AV_PIX_FMT_YUYV422},
{IMGFMT_UYVY, AV_PIX_FMT_UYVY422},
{IMGFMT_NV12, AV_PIX_FMT_NV12},
diff --git a/video/img_format.c b/video/img_format.c
index 42b4df45ab..3535807993 100644
--- a/video/img_format.c
+++ b/video/img_format.c
@@ -275,12 +275,12 @@ struct mp_imgfmt_desc mp_imgfmt_get_desc(int mpfmt)
return desc;
}
-// Find a format that is MP_IMGFLAG_YUV_P with the following configuration.
-int mp_imgfmt_find_yuv_planar(int xs, int ys, int planes, int component_bits)
+// Find a format that has the given flags set with the following configuration.
+int mp_imgfmt_find(int xs, int ys, int planes, int component_bits, int flags)
{
for (int n = IMGFMT_START + 1; n < IMGFMT_END; n++) {
struct mp_imgfmt_desc desc = mp_imgfmt_get_desc(n);
- if (desc.id && (desc.flags & MP_IMGFLAG_YUV_P)) {
+ if (desc.id && ((desc.flags & flags) == flags)) {
if (desc.num_planes == planes && desc.chroma_xs == xs &&
desc.chroma_ys == ys && desc.plane_bits == component_bits &&
(desc.flags & MP_IMGFLAG_NE))
diff --git a/video/img_format.h b/video/img_format.h
index 8788f86c35..9dbc2eedf2 100644
--- a/video/img_format.h
+++ b/video/img_format.h
@@ -67,7 +67,8 @@
#define MP_IMGFLAG_HWACCEL 0x10000
// Set if the chroma resolution is lower than luma resolution. Unset for non-YUV.
#define MP_IMGFLAG_SUBSAMPLED 0x20000
-// Like MP_IMGFLAG_YUV_P, but RGB. The planes are organized as in IMGFMT_GBRP.
+// Like MP_IMGFLAG_YUV_P, but RGB. This can be e.g. AV_PIX_FMT_GBRP. The planes
+// are always shuffled (G - B - R [- A]).
#define MP_IMGFLAG_RGB_P 0x40000
// Exactly one of these bits is set in mp_imgfmt_desc.flags
@@ -195,10 +196,6 @@ enum mp_imgfmt {
// 256 entries, with each entry encoded like in IMGFMT_BGR32.
IMGFMT_PAL8,
- // Planar RGB (planes are shuffled: plane 0 is G, etc.)
- IMGFMT_GBRP,
- IMGFMT_GBRAP,
-
// XYZ colorspace, similar organization to RGB48. Even though it says "12",
// the components are stored as 16 bit, with lower 4 bits set to 0.
IMGFMT_XYZ12,
@@ -246,7 +243,7 @@ char **mp_imgfmt_name_list(void);
#define vo_format_name mp_imgfmt_to_name
-int mp_imgfmt_find_yuv_planar(int xs, int ys, int planes, int component_bits);
+int mp_imgfmt_find(int xs, int ys, int planes, int component_bits, int flags);
int mp_imgfmt_select_best(int dst1, int dst2, int src);