mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 20:03:10 +02:00
vo_vaapi_wayland: remove vaapi format query as formats are never used
This code was taken from the older vo_vaapi driver, which does use the vaapi format list, but the new driver has no use for these formats, as it is only interested in va surfaces that can be mapped to wl buffers. The format doesn't enter into it at all.
This commit is contained in:
parent
45ff20986d
commit
b29878e3a1
@ -31,11 +31,6 @@
|
||||
|
||||
#define VA_POOL_NUM_ALLOCATED_INIT 30
|
||||
|
||||
struct va_image_formats {
|
||||
VAImageFormat *entries;
|
||||
int num;
|
||||
};
|
||||
|
||||
struct va_pool_entry {
|
||||
/* key */
|
||||
VASurfaceID surface;
|
||||
@ -62,7 +57,6 @@ struct priv {
|
||||
|
||||
VADisplay display;
|
||||
struct mp_vaapi_ctx *mpvaapi;
|
||||
struct va_image_formats *image_formats;
|
||||
struct wl_shm_pool *solid_buffer_pool;
|
||||
struct wl_buffer *solid_buffer;
|
||||
struct va_pool *va_pool;
|
||||
@ -210,22 +204,6 @@ static struct va_pool_entry *va_pool_alloc_entry(struct vo *vo, struct va_pool *
|
||||
return entry;
|
||||
}
|
||||
|
||||
static void va_get_formats(struct priv *ctx)
|
||||
{
|
||||
struct va_image_formats *formats = talloc_ptrtype(ctx, formats);
|
||||
|
||||
formats->num = vaMaxNumImageFormats(ctx->display);
|
||||
formats->entries = talloc_array(formats, VAImageFormat, formats->num);
|
||||
VAStatus status = vaQueryImageFormats(ctx->display, formats->entries,
|
||||
&formats->num);
|
||||
if (!CHECK_VA_STATUS(ctx, "vaQueryImageFormats()"))
|
||||
return;
|
||||
MP_VERBOSE(ctx, "%d image formats available:\n", formats->num);
|
||||
for (int i = 0; i < formats->num; i++)
|
||||
MP_VERBOSE(ctx, " %s\n", mp_tag_str(formats->entries[i].fourcc));
|
||||
ctx->image_formats = formats;
|
||||
}
|
||||
|
||||
static void uninit(struct vo *vo)
|
||||
{
|
||||
struct priv *p = vo->priv;
|
||||
@ -255,20 +233,19 @@ static int preinit(struct vo *vo)
|
||||
p->log = vo->log;
|
||||
if (!vo_wayland_init(vo))
|
||||
return VO_ERROR;
|
||||
|
||||
p->display = vaGetDisplayWl(vo->wl->display);
|
||||
if (!p->display) {
|
||||
MP_ERR(vo, "Unable to get the VA Display.\n");
|
||||
return VO_ERROR;
|
||||
}
|
||||
|
||||
p->mpvaapi = va_initialize(p->display, p->log, false);
|
||||
if (!p->mpvaapi) {
|
||||
vaTerminate(p->display);
|
||||
p->display = NULL;
|
||||
goto fail;
|
||||
}
|
||||
va_get_formats(p);
|
||||
if (!p->image_formats)
|
||||
goto fail;
|
||||
|
||||
vo->hwdec_devs = hwdec_devices_create();
|
||||
hwdec_devices_add(vo->hwdec_devs, &p->mpvaapi->hwctx);
|
||||
|
Loading…
Reference in New Issue
Block a user