[vlc-devel] [PATCH 06/10] vdpau: don't require a display module to call vlc_xcb_parent_Create
Steve Lhomme
robux4 at ycbcr.xyz
Fri Nov 22 14:12:34 CET 2019
---
modules/hw/vdpau/display.c | 3 ++-
modules/video_output/xcb/events.c | 10 +++++-----
modules/video_output/xcb/events.h | 2 +-
modules/video_output/xcb/render.c | 3 ++-
modules/video_output/xcb/x11.c | 3 ++-
5 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/modules/hw/vdpau/display.c b/modules/hw/vdpau/display.c
index 63dcc2291bc..d0817e7af65 100644
--- a/modules/hw/vdpau/display.c
+++ b/modules/hw/vdpau/display.c
@@ -311,7 +311,8 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
return VLC_ENOMEM;
const xcb_screen_t *screen;
- if (vlc_xcb_parent_Create(vd, cfg->window, &sys->conn, &screen) != VLC_SUCCESS)
+ if (vlc_xcb_parent_Create(VLC_OBJECT(vd), cfg->window,
+ &sys->conn, &screen) != VLC_SUCCESS)
{
free(sys);
return VLC_EGENERIC;
diff --git a/modules/video_output/xcb/events.c b/modules/video_output/xcb/events.c
index 559f8da7459..1cc52a252e5 100644
--- a/modules/video_output/xcb/events.c
+++ b/modules/video_output/xcb/events.c
@@ -101,17 +101,17 @@ static const xcb_screen_t *FindScreen (vlc_object_t *obj,
return NULL;
}
-int vlc_xcb_parent_Create(vout_display_t *vd, const vout_window_t *wnd,
+int vlc_xcb_parent_Create(vlc_object_t *obj, const vout_window_t *wnd,
xcb_connection_t **restrict pconn,
const xcb_screen_t **restrict pscreen)
{
if (wnd->type != VOUT_WINDOW_TYPE_XID)
{
- msg_Err (vd, "window not available");
+ msg_Err (obj, "window not available");
return VLC_EBADVAR;
}
- xcb_connection_t *conn = Connect (VLC_OBJECT(vd), wnd->display.x11);
+ xcb_connection_t *conn = Connect (obj, wnd->display.x11);
if (conn == NULL)
goto error;
*pconn = conn;
@@ -121,11 +121,11 @@ int vlc_xcb_parent_Create(vout_display_t *vd, const vout_window_t *wnd,
NULL);
if (geo == NULL)
{
- msg_Err (vd, "window not valid");
+ msg_Err (obj, "window not valid");
goto error;
}
- const xcb_screen_t *screen = FindScreen (VLC_OBJECT(vd), conn, geo->root);
+ const xcb_screen_t *screen = FindScreen (obj, conn, geo->root);
free (geo);
if (screen == NULL)
goto error;
diff --git a/modules/video_output/xcb/events.h b/modules/video_output/xcb/events.h
index f3e6ef53142..c53e5614d43 100644
--- a/modules/video_output/xcb/events.h
+++ b/modules/video_output/xcb/events.h
@@ -40,7 +40,7 @@ int vlc_xcb_error_Check(vout_display_t *, xcb_connection_t *conn,
* Creates a VLC video X window object, connects to the corresponding X server,
* finds the corresponding X server screen.
*/
-int vlc_xcb_parent_Create(vout_display_t *obj, const vout_window_t *wnd,
+int vlc_xcb_parent_Create(vlc_object_t *obj, const vout_window_t *wnd,
xcb_connection_t **connp,
const xcb_screen_t **screenp);
/**
diff --git a/modules/video_output/xcb/render.c b/modules/video_output/xcb/render.c
index c3e71933f35..2b56a8b11db 100644
--- a/modules/video_output/xcb/render.c
+++ b/modules/video_output/xcb/render.c
@@ -563,7 +563,8 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
xcb_connection_t *conn;
const xcb_screen_t *screen;
- if (vlc_xcb_parent_Create(vd, cfg->window, &conn, &screen) != VLC_SUCCESS)
+ if (vlc_xcb_parent_Create(VLC_OBJECT(vd), cfg->window,
+ &conn, &screen) != VLC_SUCCESS)
return VLC_EGENERIC;
sys->conn = conn;
diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
index 05e012f3897..a00a92b35e6 100644
--- a/modules/video_output/xcb/x11.c
+++ b/modules/video_output/xcb/x11.c
@@ -265,7 +265,8 @@ static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg,
/* Get window, connect to X server */
xcb_connection_t *conn;
const xcb_screen_t *scr;
- if (vlc_xcb_parent_Create(vd, cfg->window, &conn, &scr) != VLC_SUCCESS)
+ if (vlc_xcb_parent_Create(VLC_OBJECT(vd), cfg->window,
+ &conn, &scr) != VLC_SUCCESS)
{
free (sys);
return VLC_EGENERIC;
--
2.17.1
More information about the vlc-devel
mailing list