]> git.sesse.net Git - vlc/blobdiff - modules/video_output/caca.c
vdr: clarify
[vlc] / modules / video_output / caca.c
index 08786a99410a083a9cda9c9a2a47c209c6046da7..2958abd9a6d431bc4f1a5d5560e9853d361577cc 100644 (file)
@@ -1,25 +1,25 @@
 /*****************************************************************************
  * caca.c: Color ASCII Art "vout display" module using libcaca
  *****************************************************************************
- * Copyright (C) 2003-2009 the VideoLAN team
+ * Copyright (C) 2003-2009 VLC authors and VideoLAN
  * $Id$
  *
  * Authors: Sam Hocevar <sam@zoy.org>
  *          Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
 #include <vlc_plugin.h>
 #include <vlc_vout_display.h>
 #include <vlc_picture_pool.h>
+#if !defined(_WIN32) && !defined(__APPLE__)
+# ifdef X_DISPLAY_MISSING
+#  error Xlib required due to XInitThreads
+# endif
+# include <vlc_xlib.h>
+#endif
 
 #include <caca.h>
 
@@ -57,7 +63,7 @@ vlc_module_end()
  *****************************************************************************/
 static picture_pool_t *Pool  (vout_display_t *, unsigned);
 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);
 
 /* */
@@ -82,7 +88,14 @@ static int Open(vlc_object_t *object)
     vout_display_t *vd = (vout_display_t *)object;
     vout_display_sys_t *sys;
 
-#if defined(WIN32) && !defined(UNDER_CE)
+#if !defined(__APPLE__) && !defined(_WIN32)
+# ifndef X_DISPLAY_MISSING
+    if (!vlc_xlib_init(object))
+        return VLC_EGENERIC;
+# endif
+#endif
+
+#if defined(_WIN32)
     CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
     SMALL_RECT rect;
     COORD coord;
@@ -180,7 +193,7 @@ static int Open(vlc_object_t *object)
 
     vd->pool    = Pool;
     vd->prepare = Prepare;
-    vd->display = Display;
+    vd->display = PictureDisplay;
     vd->control = Control;
     vd->manage  = Manage;
 
@@ -203,7 +216,7 @@ error:
 
         free(sys);
     }
-#if defined(WIN32) && !defined(UNDER_CE)
+#if defined(_WIN32)
     FreeConsole();
 #endif
     return VLC_EGENERIC;
@@ -224,7 +237,7 @@ static void Close(vlc_object_t *object)
     caca_free_display(sys->dp);
     cucul_free_canvas(sys->cv);
 
-#if defined(WIN32) && !defined(UNDER_CE)
+#if defined(_WIN32)
     FreeConsole();
 #endif
 
@@ -284,7 +297,7 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
 /**
  * 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);
     picture_Release(picture);