vo_opengl: do not use vaapi-over-GLX

This backend is selected if vaapi is available, but vaapi-over-EGL is
not. This causes various issues around the forced RGB conversion, which
is done with fixed, usually incorrect parameters.

It seems the existing auto probing check is too weak, and doesn't really
prevent it from getting loaded. Fix this by adding a flag to not ever
load this during auto probing.

I'm still not deleting it, because it's useful for testing on nvidia
machines.

See #4555.
This commit is contained in:
wm4 2017-07-07 12:29:29 +02:00
parent 9c9d3e7b25
commit ae4c0134ed
3 changed files with 4 additions and 5 deletions

View File

@ -101,7 +101,7 @@ struct gl_hwdec *gl_hwdec_load_api(struct mp_log *log, GL *gl,
bool is_auto = HWDEC_IS_AUTO(api); bool is_auto = HWDEC_IS_AUTO(api);
for (int n = 0; mpgl_hwdec_drivers[n]; n++) { for (int n = 0; mpgl_hwdec_drivers[n]; n++) {
const struct gl_hwdec_driver *drv = mpgl_hwdec_drivers[n]; const struct gl_hwdec_driver *drv = mpgl_hwdec_drivers[n];
if (is_auto || api == drv->api) { if ((is_auto || api == drv->api) && !drv->testing_only) {
struct gl_hwdec *r = load_hwdec_driver(log, gl, g, devs, drv, is_auto); struct gl_hwdec *r = load_hwdec_driver(log, gl, g, devs, drv, is_auto);
if (r) if (r)
return r; return r;

View File

@ -42,6 +42,8 @@ struct gl_hwdec_driver {
// The hardware surface IMGFMT_ that must be passed to map_image later. // The hardware surface IMGFMT_ that must be passed to map_image later.
// If the test_format callback is set, this field is ignored! // If the test_format callback is set, this field is ignored!
int imgfmt; int imgfmt;
// Dosn't load this unless requested by name.
bool testing_only;
// Create the hwdec device. It must add it to hw->devs, if applicable. // Create the hwdec device. It must add it to hw->devs, if applicable.
int (*create)(struct gl_hwdec *hw); int (*create)(struct gl_hwdec *hw);
// Prepare for rendering video. (E.g. create textures.) // Prepare for rendering video. (E.g. create textures.)

View File

@ -74,10 +74,6 @@ static int create(struct gl_hwdec *hw)
Display *x11disp = glXGetCurrentDisplay(); Display *x11disp = glXGetCurrentDisplay();
if (!x11disp) if (!x11disp)
return -1; return -1;
if (hw->probing) {
MP_VERBOSE(hw, "Not using this by default.\n");
return -1;
}
int x11scr = DefaultScreen(x11disp); int x11scr = DefaultScreen(x11disp);
struct priv *p = talloc_zero(hw, struct priv); struct priv *p = talloc_zero(hw, struct priv);
hw->priv = p; hw->priv = p;
@ -205,6 +201,7 @@ const struct gl_hwdec_driver gl_hwdec_vaglx = {
.name = "vaapi-glx", .name = "vaapi-glx",
.api = HWDEC_VAAPI, .api = HWDEC_VAAPI,
.imgfmt = IMGFMT_VAAPI, .imgfmt = IMGFMT_VAAPI,
.testing_only = true,
.create = create, .create = create,
.reinit = reinit, .reinit = reinit,
.map_frame = map_frame, .map_frame = map_frame,