Commit 982e367a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

caca: add Xlib initialization

(cherry picked from commit 760668e7a6accb3046207b7ae426e509cf73dc7f)
parent 6abd243f
...@@ -135,6 +135,9 @@ libvlc_LTLIBRARIES += $(LTLIBegl) ...@@ -135,6 +135,9 @@ libvlc_LTLIBRARIES += $(LTLIBegl)
libcaca_plugin_la_SOURCES = caca.c libcaca_plugin_la_SOURCES = caca.c
libcaca_plugin_la_CFLAGS = $(AM_CFLAGS) $(CACA_CFLAGS) libcaca_plugin_la_CFLAGS = $(AM_CFLAGS) $(CACA_CFLAGS)
libcaca_plugin_la_LIBADD = $(AM_LIBADD) $(CACA_LIBS) libcaca_plugin_la_LIBADD = $(AM_LIBADD) $(CACA_LIBS)
if !HAVE_WIN32
libcaca_plugin_la_LIBADD += $(X_LIBS) $(X_PRE_LIBS) -lX11
endif
libcaca_plugin_la_DEPENDENCIES = libcaca_plugin_la_DEPENDENCIES =
EXTRA_LTLIBRARIES += libcaca_plugin.la EXTRA_LTLIBRARIES += libcaca_plugin.la
libvlc_LTLIBRARIES += $(LTLIBcaca) libvlc_LTLIBRARIES += $(LTLIBcaca)
......
...@@ -34,6 +34,12 @@ ...@@ -34,6 +34,12 @@
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_vout_display.h> #include <vlc_vout_display.h>
#include <vlc_picture_pool.h> #include <vlc_picture_pool.h>
#ifndef WIN32
# ifdef X_DISPLAY_MISSING
# error Xlib required due to XInitThreads
# endif
# include <vlc_xlib.h>
#endif
#include <caca.h> #include <caca.h>
...@@ -57,7 +63,7 @@ vlc_module_end() ...@@ -57,7 +63,7 @@ vlc_module_end()
*****************************************************************************/ *****************************************************************************/
static picture_pool_t *Pool (vout_display_t *, unsigned); static picture_pool_t *Pool (vout_display_t *, unsigned);
static void Prepare(vout_display_t *, picture_t *, subpicture_t *); static void Prepare(vout_display_t *, picture_t *, subpicture_t *);
static void Display(vout_display_t *, picture_t *, subpicture_t *); static void PictureDisplay(vout_display_t *, picture_t *, subpicture_t *);
static int Control(vout_display_t *, int, va_list); static int Control(vout_display_t *, int, va_list);
/* */ /* */
...@@ -82,6 +88,10 @@ static int Open(vlc_object_t *object) ...@@ -82,6 +88,10 @@ static int Open(vlc_object_t *object)
vout_display_t *vd = (vout_display_t *)object; vout_display_t *vd = (vout_display_t *)object;
vout_display_sys_t *sys; vout_display_sys_t *sys;
#ifndef X_DISPLAY_MISSING
if (!vlc_xlib_init(object))
return VLC_EGENERIC;
#endif
#if defined(WIN32) && !defined(UNDER_CE) #if defined(WIN32) && !defined(UNDER_CE)
CONSOLE_SCREEN_BUFFER_INFO csbiInfo; CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
SMALL_RECT rect; SMALL_RECT rect;
...@@ -180,7 +190,7 @@ static int Open(vlc_object_t *object) ...@@ -180,7 +190,7 @@ static int Open(vlc_object_t *object)
vd->pool = Pool; vd->pool = Pool;
vd->prepare = Prepare; vd->prepare = Prepare;
vd->display = Display; vd->display = PictureDisplay;
vd->control = Control; vd->control = Control;
vd->manage = Manage; vd->manage = Manage;
...@@ -284,7 +294,7 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic ...@@ -284,7 +294,7 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
/** /**
* Display a picture * Display a picture
*/ */
static void Display(vout_display_t *vd, picture_t *picture, subpicture_t *subpicture) static void PictureDisplay(vout_display_t *vd, picture_t *picture, subpicture_t *subpicture)
{ {
Refresh(vd); Refresh(vd);
picture_Release(picture); picture_Release(picture);
......
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