Commit 421866e2 authored by Cyril Deguet's avatar Cyril Deguet

* all: skeleton of a coming-soon OpenGL visualization plugin, compatible

   with MilkDrop for winamp.
parent ce1924e3
......@@ -2,7 +2,8 @@
FEATURES="
SKINS skins
SKINS2 skins2
SKINS skins2
FAMILIAR familiar
WXWINDOWS wxwindows
OPIE opie
MACOSX macosx
......@@ -80,6 +81,7 @@ RELEASE release
SOUT sout
WITHFFMPEGMP3LAME ffmpeg-mp3lame
WITHFFMPEGFAAC ffmpeg-faac
GALAKTOS galaktos
"
PATHS="
WITHXML2CONFIGPATH xml2-config-path
......@@ -136,25 +138,17 @@ do
eval x="\$CONFIG_$1"
if [ "$x" == "y" ]
then
if [ "$1" == "WITHFFMPEGMP3LAME" ]
then
echo -n "--with-$2 " >> .cmd
else if [ "$1" == "WITHFFMPEGFAAC" ]
if [ "$1" == "WITHFFMPEGMP3LAME" ] || [ "$1" == "WITHFFMPEGFAAC" ]
then
echo -n "--with-$2 " >> .cmd
else
echo -n "--enable-$2 " >> .cmd
fi fi
fi
else
if [ "$1" == "WITHFFMPEGMP3LAME" ]
then
echo -n "--without-$2 " >> .cmd
else if [ "$1" == "WITHFFMPEGFAAC" ]
if [ "$1" != "WITHFFMPEGMP3LAME" ] && [ "$1" != "WITHFFMPEGFAAC" ]
then
echo -n "--without-$2 " >> .cmd
else
echo -n "--disable-$2 " >> .cmd
fi fi
fi
fi
shift; shift
done
......
......@@ -16,6 +16,7 @@ bool 'Skins2 module' CONFIG_SKINS2
if [ "$CONFIG_SKINS2" = "y" ]; then
string 'xml2-config path' CONFIG_WITHXML2CONFIGPATH ""
fi
bool 'Familiar GTK+ support' CONFIG_FAMILIAR
# TODO: --enable-pda
bool 'wxWindows support' CONFIG_WXWINDOWS
if [ "$CONFIG_WXWINDOWS" = "y" ]; then
......@@ -36,6 +37,7 @@ bool 'Goom visualization plugin' CONFIG_GOOM
if [ "$CONFIG_GOOM" = "y" ]; then
string 'goom tree for static linking' CONFIG_WITHGOOMTREE ""
fi
bool 'GaLaktos visualization plugin' CONFIG_GALAKTOS
bool 'SLP service discovery support' CONFIG_SLP
if [ "$CONFIG_SLP" = "y" ]; then
string 'libslp headers and libraries' CONFIG_WITHSLP ""
......
......@@ -3340,12 +3340,23 @@ dnl
dnl Visualisation plugin
dnl
AC_ARG_ENABLE(visual,
[ --enable-visual visualisation plugin (default enabled)])
[ --enable-visual visualisation plugin (default enabled)])
if test "${enable_visual}" != "no"
then
VLC_ADD_PLUGINS([visual])
fi
dnl
dnl OpenGL visualisation plugin
dnl
AC_ARG_ENABLE(galaktos,
[ --enable-galaktos OpenGL visualisation plugin (default disabled)])
if test "${enable_galaktos}" = "yes"
then
VLC_ADD_PLUGINS([galaktos])
VLC_ADD_LDFLAGS([galaktos],[-lGL -lGLU])
fi
dnl
dnl goom visualization plugin
dnl
......@@ -3855,6 +3866,7 @@ AC_CONFIG_FILES([
modules/video_output/x11/Makefile
modules/visualization/Makefile
modules/visualization/visual/Makefile
modules/visualization/galaktos/Makefile
])
AC_CONFIG_FILES([vlc-config], [chmod 0755 vlc-config])
......
SOURCES_galaktos = plugin.c \
plugin.h \
glx.c \
glx.h
/*****************************************************************************
* glx.c:
*****************************************************************************
* Copyright (C) 2004 VideoLAN
* $Id$
*
* Authors: Cyril Deguet <asmax@videolan.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
* (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.
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#include "glx.h"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <GL/glx.h>
/* Local prototypes */
static int CreateWindow( galaktos_thread_t *p_thread, int i_width,
int i_height );
typedef struct
{
Display *p_display;
GLXFBConfig fbconf;
Window wnd;
GLXWindow gwnd;
}
glx_data_t;
#define OS_DATA ((glx_data_t*)(p_thread->p_os_data))
int galaktos_glx_init( galaktos_thread_t *p_thread, int i_width, int i_height )
{
Display *p_display;
int i_opcode, i_evt, i_err;
int i_maj, i_min;
int i_nbelem;
GLXFBConfig *p_fbconfs, fbconf;
static const int p_attr[] = { GLX_RED_SIZE, 5, GLX_GREEN_SIZE, 5,
GLX_BLUE_SIZE, 5, GLX_DOUBLEBUFFER, True,
GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, 0 };
/* Initialize OS data */
p_thread->p_os_data = malloc( sizeof( glx_data_t ) );
/* Open the display */
OS_DATA->p_display = p_display = XOpenDisplay( NULL );
if( !p_display )
{
msg_Err( p_thread, "Cannot open display" );
return -1;
}
/* Check for GLX extension */
if( !XQueryExtension( p_display, "GLX", &i_opcode, &i_evt, &i_err ) )
{
msg_Err( p_thread, "GLX extension not supported" );
return -1;
}
if( !glXQueryExtension( p_display, &i_err, &i_evt ) )
{
msg_Err( p_thread, "glXQueryExtension failed" );
return -1;
}
/* Check GLX version */
if (!glXQueryVersion( p_display, &i_maj, &i_min ) )
{
msg_Err( p_thread, "glXQueryVersion failed" );
return -1;
}
if( i_maj <= 0 || ((i_maj == 1) && (i_min < 3)) )
{
msg_Err( p_thread, "GLX 1.3 is needed" );
return -1;
}
/* Get the FB configuration */
p_fbconfs = glXChooseFBConfig( p_display, 0, p_attr, &i_nbelem );
if( (i_nbelem <= 0) || !p_fbconfs )
{
msg_Err( p_thread, "Cannot get FB configurations");
if( p_fbconfs )
{
XFree( p_fbconfs );
}
return -1;
}
OS_DATA->fbconf = fbconf = p_fbconfs[0];
if( CreateWindow( p_thread, i_width, i_height ) == -1 )
{
XFree( p_fbconfs );
return -1;
}
msg_Err( p_thread, "NOT IMPLEMENTED YET ;)" );
return 0;
}
int CreateWindow( galaktos_thread_t *p_thread, int i_width, int i_height )
{
Display *p_display;
XVisualInfo *p_vi;
XSetWindowAttributes xattr;
Window wnd;
p_display = OS_DATA->p_display;
/* Get the X11 visual */
p_vi = glXGetVisualFromFBConfig( p_display, OS_DATA->fbconf );
if( !p_vi )
{
msg_Err( p_thread, "Cannot get X11 visual" );
return -1;
}
/* Create the window */
xattr.background_pixel = BlackPixel( p_display, DefaultScreen(p_display) );
xattr.border_pixel = 0;
OS_DATA->wnd = wnd = XCreateWindow( p_display, DefaultRootWindow(p_display),
0, 0, i_width, i_height, 0, p_vi->depth, InputOutput, p_vi->visual,
CWBackPixel | CWBorderPixel, &xattr);
XFree( p_vi );
/* Create the GLX window */
OS_DATA->gwnd = glXCreateWindow( p_display, OS_DATA->fbconf, wnd, NULL );
if( OS_DATA->gwnd == None )
{
msg_Err( p_thread, "Cannot create GLX window" );
return -1;
}
return 0;
}
/*****************************************************************************
* plugin.h:
*****************************************************************************
* Copyright (C) 2004 VideoLAN
* $Id$
*
* Authors: Cyril Deguet <asmax@videolan.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
* (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.
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#ifndef _GALAKTOS_GLX_H_
#define _GALAKTOS_GLX_H_
#include "plugin.h"
int galaktos_glx_init( galaktos_thread_t *p_thread, int i_width, int i_height );
#endif
This diff is collapsed.
/*****************************************************************************
* plugin.h:
*****************************************************************************
* Copyright (C) 2004 VideoLAN
* $Id$
*
* Authors: Cyril Deguet <asmax@videolan.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
* (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.
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#ifndef _GALAKTOS_PLUGIN_H_
#define _GALAKTOS_PLUGIN_H_
#include <vlc/vlc.h>
#include <vlc/aout.h>
#define MAX_BLOCKS 10
typedef struct
{
VLC_COMMON_MEMBERS
vout_thread_t *p_vout;
char *psz_title;
vlc_mutex_t lock;
vlc_cond_t wait;
/* Audio properties */
int i_channels;
/* Audio samples queue */
block_t *pp_blocks[MAX_BLOCKS];
int i_blocks;
audio_date_t date;
/* OS specific data */
void *p_os_data;
} galaktos_thread_t;
#endif
......@@ -122,6 +122,14 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input )
var_Change( p_aout, "visual", VLC_VAR_ADDCHOICE, &val, &text );
}
/* Look for galaktos plugin */
p_module = config_FindModule( VLC_OBJECT(p_aout), "galaktos" );
if( p_module )
{
val.psz_string = "galaktos"; text.psz_string = _("GaLaktos");
var_Change( p_aout, "visual", VLC_VAR_ADDCHOICE, &val, &text );
}
if( var_Get( p_aout, "effect-list", &val ) == VLC_SUCCESS )
{
var_Set( p_aout, "visual", val );
......@@ -563,6 +571,7 @@ static int VisualizationCallback( vlc_object_t *p_this, char const *psz_cmd,
{
ChangeFiltersString( p_aout, "goom", VLC_FALSE );
ChangeFiltersString( p_aout, "visual", VLC_FALSE );
ChangeFiltersString( p_aout, "galaktos", VLC_FALSE );
}
else
{
......@@ -570,6 +579,13 @@ static int VisualizationCallback( vlc_object_t *p_this, char const *psz_cmd,
{
ChangeFiltersString( p_aout, "visual", VLC_FALSE );
ChangeFiltersString( p_aout, "goom", VLC_TRUE );
ChangeFiltersString( p_aout, "galaktos", VLC_FALSE );
}
else if( !strcmp( "galaktos", psz_mode ) )
{
ChangeFiltersString( p_aout, "visual", VLC_FALSE );
ChangeFiltersString( p_aout, "goom", VLC_FALSE );
ChangeFiltersString( p_aout, "galaktos", VLC_TRUE );
}
else
{
......@@ -579,6 +595,7 @@ static int VisualizationCallback( vlc_object_t *p_this, char const *psz_cmd,
ChangeFiltersString( p_aout, "goom", VLC_FALSE );
ChangeFiltersString( p_aout, "visual", VLC_TRUE );
ChangeFiltersString( p_aout, "galaktos", VLC_FALSE );
}
}
......
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