summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-21 22:08:24 +0100
committerwm4 <wm4@nowhere>2015-01-21 22:08:24 +0100
commita1ed13869c1586897c323ebf65cfd3975092ffad (patch)
treeda92c9384cc192111ca54784713c4e9307dc9cef /video/out
parent2a691d1ede42e8466f1f880c390659d1f0145e94 (diff)
downloadmpv-a1ed13869c1586897c323ebf65cfd3975092ffad.tar.bz2
mpv-a1ed13869c1586897c323ebf65cfd3975092ffad.tar.xz
video: remove vfcap.h
And remove all uses of the VFCAP_CSP_SUPPORTED* constants. This is supposed to reduce conversions if many filters are used (with many incompatible pixel formats), and also for preferring the VO's natively supported pixel formats (as opposed to conversion). This is worthless by now. Not only do the main VOs not use software conversion, but also the way vf_lavfi and libavfilter work mostly break the way the old MPlayer mechanism worked. Other important filters like vf_vapoursynth do not support "proper" format negotation either. Part of this was already removed with the vf_scale cleanup from today. While I'm touching every single VO, also fix the query_format argument (it's not a FourCC anymore).
Diffstat (limited to 'video/out')
-rw-r--r--video/out/vo.c1
-rw-r--r--video/out/vo.h4
-rw-r--r--video/out/vo_caca.c8
-rw-r--r--video/out/vo_direct3d.c5
-rw-r--r--video/out/vo_image.c5
-rw-r--r--video/out/vo_lavc.c5
-rw-r--r--video/out/vo_null.c5
-rw-r--r--video/out/vo_opengl.c6
-rw-r--r--video/out/vo_opengl_cb.c5
-rw-r--r--video/out/vo_sdl.c6
-rw-r--r--video/out/vo_vaapi.c5
-rw-r--r--video/out/vo_vdpau.c8
-rw-r--r--video/out/vo_wayland.c7
-rw-r--r--video/out/vo_x11.c15
-rw-r--r--video/out/vo_xv.c6
15 files changed, 32 insertions, 59 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index 9ac35796c5..0d135c2842 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -44,7 +44,6 @@
#include "common/msg.h"
#include "common/global.h"
#include "video/mp_image.h"
-#include "video/vfcap.h"
#include "sub/osd.h"
#include "osdep/io.h"
#include "osdep/threads.h"
diff --git a/video/out/vo.h b/video/out/vo.h
index 5d136432e3..d943d4ad78 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -192,9 +192,9 @@ struct vo_driver {
/*
* Whether the given image format is supported and config() will succeed.
* format: one of IMGFMT_*
- * returns: 0 on not supported, otherwise a bitmask of VFCAP_* values
+ * returns: 0 on not supported, otherwise 1
*/
- int (*query_format)(struct vo *vo, uint32_t format);
+ int (*query_format)(struct vo *vo, int format);
/*
* Initialize or reconfigure the display driver.
diff --git a/video/out/vo_caca.c b/video/out/vo_caca.c
index bcef78534c..d9e478e055 100644
--- a/video/out/vo_caca.c
+++ b/video/out/vo_caca.c
@@ -37,7 +37,6 @@
#include "config.h"
#include "vo.h"
#include "video/mp_image.h"
-#include "video/vfcap.h"
#include "video/memcpy_pic.h"
#include "input/keycodes.h"
@@ -279,12 +278,9 @@ static int preinit(struct vo *vo)
return 0;
}
-static int query_format(struct vo *vo, uint32_t format)
+static int query_format(struct vo *vo, int format)
{
- if (format == IMGFMT_BGR24)
- return VFCAP_CSP_SUPPORTED;
-
- return 0;
+ return format == IMGFMT_BGR24;
}
static int control(struct vo *vo, uint32_t request, void *data)
diff --git a/video/out/vo_direct3d.c b/video/out/vo_direct3d.c
index 0ef9375e9c..293eff55fe 100644
--- a/video/out/vo_direct3d.c
+++ b/video/out/vo_direct3d.c
@@ -32,7 +32,6 @@
#include "options/m_option.h"
#include "talloc.h"
#include "vo.h"
-#include "video/vfcap.h"
#include "video/csputils.h"
#include "video/mp_image.h"
#include "video/img_format.h"
@@ -1127,13 +1126,13 @@ static bool init_rendering_mode(d3d_priv *priv, uint32_t fmt, bool initialize)
* @return 0 on failure, device capabilities (not probed
* currently) on success.
*/
-static int query_format(struct vo *vo, uint32_t movie_fmt)
+static int query_format(struct vo *vo, int movie_fmt)
{
d3d_priv *priv = vo->priv;
if (!init_rendering_mode(priv, movie_fmt, false))
return 0;
- return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
+ return 1;
}
/****************************************************************************
diff --git a/video/out/vo_image.c b/video/out/vo_image.c
index ccb8fba830..00f7bd6468 100644
--- a/video/out/vo_image.c
+++ b/video/out/vo_image.c
@@ -33,7 +33,6 @@
#include "common/msg.h"
#include "video/out/vo.h"
#include "video/csputils.h"
-#include "video/vfcap.h"
#include "video/mp_image.h"
#include "video/fmt-conversion.h"
#include "video/image_writer.h"
@@ -105,10 +104,10 @@ static void flip_page(struct vo *vo)
mp_image_unrefp(&p->current);
}
-static int query_format(struct vo *vo, uint32_t fmt)
+static int query_format(struct vo *vo, int fmt)
{
if (mp_sws_supported_format(fmt))
- return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
+ return 1;
return 0;
}
diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c
index 9bb3ebd866..032f58c0f1 100644
--- a/video/out/vo_lavc.c
+++ b/video/out/vo_lavc.c
@@ -26,7 +26,6 @@
#include "options/options.h"
#include "video/fmt-conversion.h"
#include "video/mp_image.h"
-#include "video/vfcap.h"
#include "talloc.h"
#include "vo.h"
@@ -191,7 +190,7 @@ error:
return -1;
}
-static int query_format(struct vo *vo, uint32_t format)
+static int query_format(struct vo *vo, int format)
{
enum AVPixelFormat pix_fmt = imgfmt2pixfmt(format);
@@ -201,7 +200,7 @@ static int query_format(struct vo *vo, uint32_t format)
pthread_mutex_lock(&vo->encode_lavc_ctx->lock);
int flags = 0;
if (encode_lavc_supports_pixfmt(vo->encode_lavc_ctx, pix_fmt))
- flags = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
+ flags = 1;
pthread_mutex_unlock(&vo->encode_lavc_ctx->lock);
return flags;
}
diff --git a/video/out/vo_null.c b/video/out/vo_null.c
index 2259e50c48..da9de61bf3 100644
--- a/video/out/vo_null.c
+++ b/video/out/vo_null.c
@@ -27,7 +27,6 @@
#include "config.h"
#include "common/msg.h"
#include "vo.h"
-#include "video/vfcap.h"
#include "video/mp_image.h"
static void draw_image(struct vo *vo, mp_image_t *mpi)
@@ -39,9 +38,9 @@ static void flip_page(struct vo *vo)
{
}
-static int query_format(struct vo *vo, uint32_t format)
+static int query_format(struct vo *vo, int format)
{
- return VFCAP_CSP_SUPPORTED;
+ return 1;
}
static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index 54da31f2e3..bfb1adbec8 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -40,7 +40,6 @@
#include "common/msg.h"
#include "options/m_config.h"
#include "vo.h"
-#include "video/vfcap.h"
#include "video/mp_image.h"
#include "sub/osd.h"
@@ -179,13 +178,12 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
mpgl_unlock(p->glctx);
}
-static int query_format(struct vo *vo, uint32_t format)
+static int query_format(struct vo *vo, int format)
{
struct gl_priv *p = vo->priv;
- int caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
if (!gl_video_check_format(p->renderer, format))
return 0;
- return caps;
+ return 1;
}
static void video_resize_redraw_callback(struct vo *vo, int w, int h)
diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c
index 4a0ba3dc54..3d5c16d8f2 100644
--- a/video/out/vo_opengl_cb.c
+++ b/video/out/vo_opengl_cb.c
@@ -17,7 +17,6 @@
#include "options/options.h"
#include "aspect.h"
#include "vo.h"
-#include "video/vfcap.h"
#include "video/mp_image.h"
#include "sub/osd.h"
@@ -387,7 +386,7 @@ static void flip_page(struct vo *vo)
pthread_mutex_unlock(&p->ctx->lock);
}
-static int query_format(struct vo *vo, uint32_t format)
+static int query_format(struct vo *vo, int format)
{
struct vo_priv *p = vo->priv;
@@ -396,7 +395,7 @@ static int query_format(struct vo *vo, uint32_t format)
if (format >= IMGFMT_START && format < IMGFMT_END)
ok = p->ctx->imgfmt_supported[format - IMGFMT_START];
pthread_mutex_unlock(&p->ctx->lock);
- return ok ? VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW : 0;
+ return ok;
}
static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c
index 693a543c94..bc5ddda5c6 100644
--- a/video/out/vo_sdl.c
+++ b/video/out/vo_sdl.c
@@ -41,7 +41,6 @@
#include "sub/osd.h"
#include "video/mp_image.h"
-#include "video/vfcap.h"
#include "win_state.h"
#include "config.h"
@@ -847,16 +846,15 @@ static int preinit(struct vo *vo)
return 0;
}
-static int query_format(struct vo *vo, uint32_t format)
+static int query_format(struct vo *vo, int format)
{
struct priv *vc = vo->priv;
int i, j;
- int cap = VFCAP_CSP_SUPPORTED;
for (i = 0; i < vc->renderer_info.num_texture_formats; ++i)
for (j = 0; j < sizeof(formats) / sizeof(formats[0]); ++j)
if (vc->renderer_info.texture_formats[i] == formats[j].sdl)
if (format == formats[j].mpv)
- return cap;
+ return 1;
return 0;
}
diff --git a/video/out/vo_vaapi.c b/video/out/vo_vaapi.c
index b51337c7d9..f8edd83b4e 100644
--- a/video/out/vo_vaapi.c
+++ b/video/out/vo_vaapi.c
@@ -37,7 +37,6 @@
#include "sub/img_convert.h"
#include "x11_common.h"
-#include "video/vfcap.h"
#include "video/mp_image.h"
#include "video/vaapi.h"
#include "video/hwdec.h"
@@ -175,11 +174,11 @@ static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
return 0;
}
-static int query_format(struct vo *vo, uint32_t imgfmt)
+static int query_format(struct vo *vo, int imgfmt)
{
struct priv *p = vo->priv;
if (imgfmt == IMGFMT_VAAPI || va_image_format_from_imgfmt(p->va_image_formats, imgfmt))
- return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
+ return 1;
return 0;
}
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index e1795e321f..640e16e1a8 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -46,7 +46,6 @@
#include "video/csputils.h"
#include "sub/osd.h"
#include "options/m_option.h"
-#include "video/vfcap.h"
#include "video/mp_image.h"
#include "osdep/timer.h"
#include "bitmap_packer.h"
@@ -915,15 +914,14 @@ static struct mp_image *get_window_screenshot(struct vo *vo)
return image;
}
-static int query_format(struct vo *vo, uint32_t format)
+static int query_format(struct vo *vo, int format)
{
struct vdpctx *vc = vo->priv;
- int flags = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
if (mp_vdpau_get_format(format, NULL, NULL))
- return flags;
+ return 1;
if (!vc->force_yuv && mp_vdpau_get_rgb_format(format, NULL))
- return flags;
+ return 1;
return 0;
}
diff --git a/video/out/vo_wayland.c b/video/out/vo_wayland.c
index 168763ed5c..770142ae9d 100644
--- a/video/out/vo_wayland.c
+++ b/video/out/vo_wayland.c
@@ -25,7 +25,6 @@
#include "config.h"
#include "vo.h"
-#include "video/vfcap.h"
#include "video/mp_image.h"
#include "video/sws_utils.h"
#include "video/memcpy_pic.h"
@@ -553,17 +552,17 @@ static void flip_page(struct vo *vo)
}
}
-static int query_format(struct vo *vo, uint32_t format)
+static int query_format(struct vo *vo, int format)
{
struct priv *p = vo->priv;
struct supported_format *sf;
wl_list_for_each_reverse(sf, &p->format_list, link) {
if (sf->format.mp_format == format)
- return VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_CSP_SUPPORTED;
+ return 1;
}
if (mp_sws_supported_format(format))
- return VFCAP_CSP_SUPPORTED;
+ return 1;
return 0;
}
diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c
index 419467279f..13fa0a3c9f 100644
--- a/video/out/vo_x11.c
+++ b/video/out/vo_x11.c
@@ -29,7 +29,6 @@
#include "vo.h"
#include "video/csputils.h"
#include "video/mp_image.h"
-#include "video/vfcap.h"
#include "video/filter/vf.h"
#include <X11/Xlib.h>
@@ -492,25 +491,19 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
}
}
-static int query_format(struct vo *vo, uint32_t format)
+static int query_format(struct vo *vo, int format)
{
- struct priv *p = vo->priv;
MP_DBG(vo, "query_format was called: %x (%s)\n", format,
vo_format_name(format));
if (IMGFMT_IS_RGB(format)) {
for (int n = 0; fmt2Xfmt[n].mpfmt; n++) {
- if (fmt2Xfmt[n].mpfmt == format) {
- if (IMGFMT_RGB_DEPTH(format) == p->ximage_depth) {
- return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
- } else {
- return VFCAP_CSP_SUPPORTED;
- }
- }
+ if (fmt2Xfmt[n].mpfmt == format)
+ return 1;
}
}
if (sws_isSupportedInput(imgfmt2pixfmt(format)))
- return VFCAP_CSP_SUPPORTED;
+ return 1;
return 0;
}
diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c
index 07495fb89e..202ba13735 100644
--- a/video/out/vo_xv.c
+++ b/video/out/vo_xv.c
@@ -48,7 +48,6 @@
#include "talloc.h"
#include "common/msg.h"
#include "vo.h"
-#include "video/vfcap.h"
#include "video/mp_image.h"
#include "video/img_fourcc.h"
#include "x11_common.h"
@@ -681,17 +680,16 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
}
}
-static int query_format(struct vo *vo, uint32_t format)
+static int query_format(struct vo *vo, int format)
{
struct xvctx *ctx = vo->priv;
uint32_t i;
- int flag = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
int fourcc = find_xv_format(format);
if (fourcc) {
for (i = 0; i < ctx->formats; i++) {
if (ctx->fo[i].id == fourcc)
- return flag;
+ return 1;
}
}
return 0;