*found_port = false;
- for (unsigned int i = 0; i < XScreenCount(dpy); ++i) {
+ for (int i = 0; i < XScreenCount(dpy); ++i) {
ret = XvQueryAdaptors(dpy, XRootWindow(dpy, i), &num_adaptors, &adaptor_info);
if (ret != Success)
return ret;
return BadAlloc;
}
- for (unsigned int l = 0; l < num_types && !found_surface; ++l) {
+ for (int l = 0; l < num_types && !found_surface; ++l) {
if (surface_info[l].surface_type_id != surface_type_id)
continue;
Status ret;
struct vl_screen *vscreen;
struct pipe_context *pipe;
- struct pipe_video_codec templat = {};
+ struct pipe_video_codec templat = {0};
XvMCContextPrivate *context_priv;
vl_csc_matrix csc;
return BadAlloc;
/* TODO: Reuse screen if process creates another context */
- vscreen = vl_screen_create(dpy, scrn);
+ vscreen = vl_dri3_screen_create(dpy, scrn);
+ if (!vscreen)
+ vscreen = vl_dri2_screen_create(dpy, scrn);
if (!vscreen) {
XVMC_MSG(XVMC_ERR, "[XvMC] Could not create VL screen.\n");
return BadAlloc;
}
- pipe = vscreen->pscreen->context_create(vscreen->pscreen, vscreen);
+ pipe = vscreen->pscreen->context_create(vscreen->pscreen, NULL, 0);
if (!pipe) {
XVMC_MSG(XVMC_ERR, "[XvMC] Could not create VL context.\n");
- vl_screen_destroy(vscreen);
+ vscreen->destroy(vscreen);
FREE(context_priv);
return BadAlloc;
}
if (!context_priv->decoder) {
XVMC_MSG(XVMC_ERR, "[XvMC] Could not create VL decoder.\n");
pipe->destroy(pipe);
- vl_screen_destroy(vscreen);
+ vscreen->destroy(vscreen);
FREE(context_priv);
return BadAlloc;
}
XVMC_MSG(XVMC_ERR, "[XvMC] Could not create VL compositor.\n");
context_priv->decoder->destroy(context_priv->decoder);
pipe->destroy(pipe);
- vl_screen_destroy(vscreen);
+ vscreen->destroy(vscreen);
FREE(context_priv);
return BadAlloc;
}
vl_compositor_cleanup(&context_priv->compositor);
context_priv->decoder->destroy(context_priv->decoder);
pipe->destroy(pipe);
- vl_screen_destroy(vscreen);
+ vscreen->destroy(vscreen);
FREE(context_priv);
return BadAlloc;
}
context_priv->color_standard,
&context_priv->procamp, true, &csc
);
- vl_compositor_set_csc_matrix(&context_priv->cstate, (const vl_csc_matrix *)&csc);
+ vl_compositor_set_csc_matrix(&context_priv->cstate, (const vl_csc_matrix *)&csc, 1.0f, 0.0f);
context_priv->vscreen = vscreen;
context_priv->pipe = pipe;
vl_compositor_cleanup_state(&context_priv->cstate);
vl_compositor_cleanup(&context_priv->compositor);
context_priv->pipe->destroy(context_priv->pipe);
- vl_screen_destroy(context_priv->vscreen);
+ context_priv->vscreen->destroy(context_priv->vscreen);
FREE(context_priv);
context->privData = NULL;