Commit 5984bb6a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

XCB: remove -x11-shm option

We have reliable error detection with XCB, so this option has become
mostly useless. For testing/debugging, the developer can hack the
CheckSHM() function to return false if really needed.
parent dca2381b
...@@ -160,31 +160,26 @@ error: ...@@ -160,31 +160,26 @@ error:
} }
/** Check MIT-SHM shared memory support */ /** Check MIT-SHM shared memory support */
void CheckSHM (vlc_object_t *obj, xcb_connection_t *conn, bool *restrict pshm) bool CheckSHM (vlc_object_t *obj, xcb_connection_t *conn)
{ {
#ifdef HAVE_SYS_SHM_H #ifdef HAVE_SYS_SHM_H
bool shm = var_InheritBool (obj, "x11-shm") > 0; xcb_shm_query_version_cookie_t ck;
if (shm) xcb_shm_query_version_reply_t *r;
{
xcb_shm_query_version_cookie_t ck;
xcb_shm_query_version_reply_t *r;
ck = xcb_shm_query_version (conn); ck = xcb_shm_query_version (conn);
r = xcb_shm_query_version_reply (conn, ck, NULL); r = xcb_shm_query_version_reply (conn, ck, NULL);
if (!r) if (r != NULL)
{ {
msg_Err (obj, "shared memory (MIT-SHM) not available");
msg_Warn (obj, "display will be slow");
shm = false;
}
free (r); free (r);
return true;
} }
*pshm = shm; msg_Err (obj, "shared memory (MIT-SHM) not available");
msg_Warn (obj, "display will be slow");
#else #else
msg_Warn (obj, "shared memory (MIT-SHM) not implemented"); msg_Warn (obj, "shared memory (MIT-SHM) not implemented");
(void) conn; (void) conn;
*pshm = false;
#endif #endif
return false;
} }
/** /**
......
...@@ -37,10 +37,6 @@ ...@@ -37,10 +37,6 @@
#include "xcb_vlc.h" #include "xcb_vlc.h"
#define SHM_TEXT N_("Use shared memory")
#define SHM_LONGTEXT N_( \
"Use shared memory to communicate between VLC and the X server.")
static int Open (vlc_object_t *); static int Open (vlc_object_t *);
static void Close (vlc_object_t *); static void Close (vlc_object_t *);
...@@ -56,7 +52,7 @@ vlc_module_begin () ...@@ -56,7 +52,7 @@ vlc_module_begin ()
set_callbacks (Open, Close) set_callbacks (Open, Close)
add_shortcut ("xcb-x11", "x11", "xid") add_shortcut ("xcb-x11", "x11", "xid")
add_bool ("x11-shm", true, SHM_TEXT, SHM_LONGTEXT, true) add_obsolete_bool ("x11-shm") /* obsoleted since 1.2.0 */
vlc_module_end () vlc_module_end ()
/* It must be large enough to absorb the server display jitter but it is /* It must be large enough to absorb the server display jitter but it is
...@@ -310,7 +306,7 @@ static int Open (vlc_object_t *obj) ...@@ -310,7 +306,7 @@ static int Open (vlc_object_t *obj)
p_sys->visible = false; p_sys->visible = false;
CheckSHM (obj, p_sys->conn, &p_sys->shm); p_sys->shm = CheckSHM (obj, p_sys->conn);
/* */ /* */
vout_display_info_t info = vd->info; vout_display_info_t info = vd->info;
......
...@@ -48,7 +48,7 @@ struct vout_window_t *GetWindow (vout_display_t *obj, ...@@ -48,7 +48,7 @@ struct vout_window_t *GetWindow (vout_display_t *obj,
uint8_t *restrict pdepth); uint8_t *restrict pdepth);
int GetWindowSize (struct vout_window_t *wnd, xcb_connection_t *conn, int GetWindowSize (struct vout_window_t *wnd, xcb_connection_t *conn,
unsigned *restrict width, unsigned *restrict height); unsigned *restrict width, unsigned *restrict height);
void CheckSHM (vlc_object_t *obj, xcb_connection_t *conn, bool *restrict pshm); bool CheckSHM (vlc_object_t *obj, xcb_connection_t *conn);
xcb_cursor_t CreateBlankCursor (xcb_connection_t *, const xcb_screen_t *); xcb_cursor_t CreateBlankCursor (xcb_connection_t *, const xcb_screen_t *);
void RegisterMouseEvents (vlc_object_t *, xcb_connection_t *, xcb_window_t); void RegisterMouseEvents (vlc_object_t *, xcb_connection_t *, xcb_window_t);
......
...@@ -49,10 +49,6 @@ ...@@ -49,10 +49,6 @@
"XVideo image format id to use. By default, VLC will " \ "XVideo image format id to use. By default, VLC will " \
"try to use the best match for the video being played.") "try to use the best match for the video being played.")
#define SHM_TEXT N_("Use shared memory")
#define SHM_LONGTEXT N_( \
"Use shared memory to communicate between VLC and the X server.")
static int Open (vlc_object_t *); static int Open (vlc_object_t *);
static void Close (vlc_object_t *); static void Close (vlc_object_t *);
...@@ -71,8 +67,7 @@ vlc_module_begin () ...@@ -71,8 +67,7 @@ vlc_module_begin ()
ADAPTOR_TEXT, ADAPTOR_LONGTEXT, true) ADAPTOR_TEXT, ADAPTOR_LONGTEXT, true)
add_integer ("xvideo-format-id", 0, add_integer ("xvideo-format-id", 0,
FORMAT_TEXT, FORMAT_LONGTEXT, true) FORMAT_TEXT, FORMAT_LONGTEXT, true)
add_bool ("x11-shm", true, SHM_TEXT, SHM_LONGTEXT, true) add_obsolete_bool ("xvideo-shm") /* removed in 1.2.0 */
add_deprecated_alias ("xvideo-shm")
add_shortcut ("xcb-xv", "xv", "xvideo", "xid") add_shortcut ("xcb-xv", "xv", "xvideo", "xid")
vlc_module_end () vlc_module_end ()
...@@ -542,7 +537,7 @@ static int Open (vlc_object_t *obj) ...@@ -542,7 +537,7 @@ static int Open (vlc_object_t *obj)
/* Create cursor */ /* Create cursor */
p_sys->cursor = CreateBlankCursor (conn, screen); p_sys->cursor = CreateBlankCursor (conn, screen);
CheckSHM (obj, conn, &p_sys->shm); p_sys->shm = CheckSHM (obj, conn);
/* */ /* */
vout_display_info_t info = vd->info; vout_display_info_t info = vd->info;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment