2000-02-13 12:31:35 +08:00
|
|
|
/*****************************************************************************
|
2000-01-11 07:36:06 +08:00
|
|
|
* main.h: access to all program variables
|
|
|
|
* Declaration and extern access to global program object.
|
2000-03-03 15:03:34 +08:00
|
|
|
*****************************************************************************
|
|
|
|
* Copyright (C) 1999, 2000 VideoLAN
|
2002-04-28 06:11:22 +08:00
|
|
|
* $Id: main.h,v 1.35 2002/04/27 22:11:22 gbazin Exp $
|
2000-03-03 15:03:34 +08:00
|
|
|
*
|
2000-08-24 06:15:28 +08:00
|
|
|
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
2000-03-03 15:03:34 +08:00
|
|
|
*
|
|
|
|
* 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.
|
2000-05-25 06:39:44 +08:00
|
|
|
*
|
2000-03-03 15:03:34 +08:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2000-05-25 06:39:44 +08:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2000-03-03 15:03:34 +08:00
|
|
|
*
|
2000-05-25 06:39:44 +08:00
|
|
|
* 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.
|
2000-02-13 12:31:35 +08:00
|
|
|
*****************************************************************************/
|
2000-01-11 07:36:06 +08:00
|
|
|
|
2000-02-13 12:31:35 +08:00
|
|
|
/*****************************************************************************
|
2000-01-11 07:36:06 +08:00
|
|
|
* main_t, p_main (global variable)
|
2000-02-13 12:31:35 +08:00
|
|
|
*****************************************************************************
|
2000-01-11 07:36:06 +08:00
|
|
|
* This structure has an unique instance, declared in main and pointed by the
|
|
|
|
* only global variable of the program. It should allow access to any variable
|
|
|
|
* of the program, for user-interface purposes or more easier call of interface
|
|
|
|
* and common functions (example: the intf_*Msg functions). Please avoid using
|
|
|
|
* it when you can access the members you need in an other way. In fact, it
|
|
|
|
* should only be used by interface thread.
|
2000-02-13 12:31:35 +08:00
|
|
|
*****************************************************************************/
|
2000-07-04 10:37:21 +08:00
|
|
|
|
2001-05-31 01:03:13 +08:00
|
|
|
typedef struct main_s
|
2000-01-11 07:36:06 +08:00
|
|
|
{
|
2002-04-28 06:11:22 +08:00
|
|
|
/* Private data */
|
|
|
|
struct main_sys_s* p_sys; /* for system specific properties */
|
|
|
|
|
2000-01-11 07:36:06 +08:00
|
|
|
/* Global properties */
|
2000-02-13 12:31:35 +08:00
|
|
|
int i_argc; /* command line arguments count */
|
|
|
|
char ** ppsz_argv; /* command line arguments */
|
2000-07-30 09:59:50 +08:00
|
|
|
char * psz_arg0; /* program name (whithout path) */
|
2002-03-21 15:11:57 +08:00
|
|
|
char * psz_homedir; /* user's home directory */
|
Beginning of Interface II
---------------------------
* Plugins have completely disappeared, we now only use the new module API.
* All intf and vout modules are now independant. So far, only the Gnome
intf module and the SDL vout module have been ported. configure.in has
been modified to reflect the changes (x11 and dummy aren't compiled by
default anymore, while SDL and Gnome are).
Note that this is _not_ Interface II, it's just a step forward. For
instance, it lacks the whole message passing scheme.
Things that should work:
* Right-clicking on the SDL video output window brings the Gnome menu.
* Pause, Play, Exit, About work from the menu or from the interface window.
* The old SDL keys still work.
Things that are broken or may be broken:
* Xlib calls are not locked yet, which may lead to "Unexpected async reply"
errors, and make the vlc segfault.
* Sound only works for the first file.
* The SDL vout_sdl.c file is absolutely ugly and kludgey.
* The vlc immediately quits when no filename is given as an argument. Not
a real bug, but still annoying.
* The Gnome menu does not work in fullscreen mode.
Things that will come soon, maybe tomorrow:
* Complete navigation buttons (fast forward, slow, etc.).
* File/Open menu to add files to the playlist.
* Return of the X11 video output for those of us who do not have SDL.
* Textmode interface for those of us who do not have Gnome.
* aout and vout autospawn (maybe).
2001-02-11 09:15:12 +08:00
|
|
|
|
Some heavy changes today:
* Removed duplicate function checks from configure.in.
* Added extra magic to Makefile.modules so that the module Makefiles
are now ridiculously simple. And I mean *simple*. Check it! This will
make a possible switch to full autoconf/automake a lot easier.
* Added the vlc version name to the plugin symbols, to be sure we only load
plugins with the same version number. A nasty consequence is that you
need to rebuild your tree after midnight if you are using a CVS tree :-)
* Got rid of modules_export.h by #defining exported functions in the same
header as their prototype.
* Added modules_inner.h and other commonly used .h files to common.h so
there are less and less files to include, and renamed common.h to
<videolan/vlc.h>.
* First modifications to the module handling system towards my ultimate
goal to get rid of the *_Probe functions. Got rid of TestMethod and
TestCPU, as well as src/misc/tests.c.
* Wrote the chroma plugin handling functions. No YUV functions have been
ported yet because it'ls a lot of work, but the core system works, I
tried it with a naive yv12->rgb16 plugin (which will disappear when the
real functions are ready).
* Made a lot of functions in dvd_summary.c one-liners to avoid wasting
too many output lines.
* Fixed a segfault in input_dvd.c:DVDInit.
* Added a fixfiles.sh script in plugins/gtk to be run after Glade has
generated its C files.
* Did some work on the KDE interface to make it suck a bit less. It still
segfaults, but at least it runs and it looks less ugly.
* RGB SDL rendering works again, though in 16bpp only.
* Made plugins/vcd/linux_cdrom_tools.c independent of any vlc structure
so that it'll be easily put in a library. Maybe libdvdcss?
* Fixed VCD date display.
* Merged vout_xvideo.c, vout_x11.c and vout_common.c into xcommon.c.
* Wrote non-Shm XVideo output.
* Made X11 output work again. Still pretty unstable, only works for 16bpp.
* Additional french translation in po/fr.po. Any taker for the rest?
* Fixed a segfault in video_output.c when the allocated pictures were
not direct buffers.
* If $DISPLAY isn't set, don't try to run the Gtk+ interface.
* Replaced 48x48 .xpm images with 32x32 ones to conform to Debian policy
(Closes Debian bug #126939).
* Removed the automatic ./configure launch when running `make all' for
the first time.
Stuff currently more broken than it ought to be:
* The wall filter. Being fixed.
* x11 and sdl plugins for depth != 16bpp.
* Software YUV.
* gvlc, gnome-vlc, kvlc shortcuts. Use --intf instead for the moment.
2001-12-30 15:09:56 +08:00
|
|
|
u32 i_cpu_capabilities; /* CPU extensions */
|
Beginning of Interface II
---------------------------
* Plugins have completely disappeared, we now only use the new module API.
* All intf and vout modules are now independant. So far, only the Gnome
intf module and the SDL vout module have been ported. configure.in has
been modified to reflect the changes (x11 and dummy aren't compiled by
default anymore, while SDL and Gnome are).
Note that this is _not_ Interface II, it's just a step forward. For
instance, it lacks the whole message passing scheme.
Things that should work:
* Right-clicking on the SDL video output window brings the Gnome menu.
* Pause, Play, Exit, About work from the menu or from the interface window.
* The old SDL keys still work.
Things that are broken or may be broken:
* Xlib calls are not locked yet, which may lead to "Unexpected async reply"
errors, and make the vlc segfault.
* Sound only works for the first file.
* The SDL vout_sdl.c file is absolutely ugly and kludgey.
* The vlc immediately quits when no filename is given as an argument. Not
a real bug, but still annoying.
* The Gnome menu does not work in fullscreen mode.
Things that will come soon, maybe tomorrow:
* Complete navigation buttons (fast forward, slow, etc.).
* File/Open menu to add files to the playlist.
* Return of the X11 video output for those of us who do not have SDL.
* Textmode interface for those of us who do not have Gnome.
* aout and vout autospawn (maybe).
2001-02-11 09:15:12 +08:00
|
|
|
int i_warning_level; /* warning messages level */
|
2001-10-02 00:18:49 +08:00
|
|
|
boolean_t b_stats; /* display statistics ? */
|
2000-01-11 07:36:06 +08:00
|
|
|
|
|
|
|
/* Generic settings */
|
2000-02-13 12:31:35 +08:00
|
|
|
boolean_t b_audio; /* is audio output allowed ? */
|
|
|
|
boolean_t b_video; /* is video output allowed ? */
|
2002-02-25 04:51:10 +08:00
|
|
|
boolean_t b_stereo;
|
2002-02-14 06:10:40 +08:00
|
|
|
mtime_t i_desync; /* relative desync of the audio ouput */
|
2000-02-13 12:31:35 +08:00
|
|
|
|
2001-12-08 02:33:08 +08:00
|
|
|
/* Fast memcpy plugin used */
|
2002-02-15 21:32:54 +08:00
|
|
|
module_t * p_memcpy_module;
|
|
|
|
void* ( *pf_memcpy ) ( void *, const void *, size_t );
|
|
|
|
void* ( *pf_memset ) ( void *, int, size_t ); /* FIXME: unimplemented */
|
2001-12-04 00:18:37 +08:00
|
|
|
|
2000-01-11 07:36:06 +08:00
|
|
|
/* Unique threads */
|
2000-02-13 12:31:35 +08:00
|
|
|
p_intf_thread_t p_intf; /* main interface thread */
|
2000-01-11 07:36:06 +08:00
|
|
|
|
|
|
|
/* Shared data - these structures are accessed directly from p_main by
|
|
|
|
* several modules */
|
2001-01-06 02:06:33 +08:00
|
|
|
p_playlist_t p_playlist; /* playlist */
|
2000-02-13 12:31:35 +08:00
|
|
|
p_intf_msg_t p_msg; /* messages interface data */
|
2001-04-11 10:01:24 +08:00
|
|
|
p_input_channel_t p_channel; /* channel library data */
|
2002-03-16 09:40:58 +08:00
|
|
|
|
|
|
|
/* Locks */
|
|
|
|
vlc_mutex_t config_lock; /* lock for the config file */
|
2000-01-11 07:36:06 +08:00
|
|
|
} main_t;
|
|
|
|
|
2002-04-24 08:36:24 +08:00
|
|
|
#ifndef __PLUGIN__
|
2000-01-11 07:36:06 +08:00
|
|
|
extern main_t *p_main;
|
2001-12-10 12:53:11 +08:00
|
|
|
#else
|
|
|
|
# define p_main (p_symbols->p_main)
|
|
|
|
#endif
|
2000-01-11 07:36:06 +08:00
|
|
|
|
Some heavy changes today:
* Removed duplicate function checks from configure.in.
* Added extra magic to Makefile.modules so that the module Makefiles
are now ridiculously simple. And I mean *simple*. Check it! This will
make a possible switch to full autoconf/automake a lot easier.
* Added the vlc version name to the plugin symbols, to be sure we only load
plugins with the same version number. A nasty consequence is that you
need to rebuild your tree after midnight if you are using a CVS tree :-)
* Got rid of modules_export.h by #defining exported functions in the same
header as their prototype.
* Added modules_inner.h and other commonly used .h files to common.h so
there are less and less files to include, and renamed common.h to
<videolan/vlc.h>.
* First modifications to the module handling system towards my ultimate
goal to get rid of the *_Probe functions. Got rid of TestMethod and
TestCPU, as well as src/misc/tests.c.
* Wrote the chroma plugin handling functions. No YUV functions have been
ported yet because it'ls a lot of work, but the core system works, I
tried it with a naive yv12->rgb16 plugin (which will disappear when the
real functions are ready).
* Made a lot of functions in dvd_summary.c one-liners to avoid wasting
too many output lines.
* Fixed a segfault in input_dvd.c:DVDInit.
* Added a fixfiles.sh script in plugins/gtk to be run after Glade has
generated its C files.
* Did some work on the KDE interface to make it suck a bit less. It still
segfaults, but at least it runs and it looks less ugly.
* RGB SDL rendering works again, though in 16bpp only.
* Made plugins/vcd/linux_cdrom_tools.c independent of any vlc structure
so that it'll be easily put in a library. Maybe libdvdcss?
* Fixed VCD date display.
* Merged vout_xvideo.c, vout_x11.c and vout_common.c into xcommon.c.
* Wrote non-Shm XVideo output.
* Made X11 output work again. Still pretty unstable, only works for 16bpp.
* Additional french translation in po/fr.po. Any taker for the rest?
* Fixed a segfault in video_output.c when the allocated pictures were
not direct buffers.
* If $DISPLAY isn't set, don't try to run the Gtk+ interface.
* Replaced 48x48 .xpm images with 32x32 ones to conform to Debian policy
(Closes Debian bug #126939).
* Removed the automatic ./configure launch when running `make all' for
the first time.
Stuff currently more broken than it ought to be:
* The wall filter. Being fixed.
* x11 and sdl plugins for depth != 16bpp.
* Software YUV.
* gvlc, gnome-vlc, kvlc shortcuts. Use --intf instead for the moment.
2001-12-30 15:09:56 +08:00
|
|
|
/*****************************************************************************
|
|
|
|
* Fast memory operation module
|
|
|
|
*****************************************************************************/
|
2002-02-15 21:32:54 +08:00
|
|
|
#define FAST_MEMCPY p_main->pf_memcpy
|
|
|
|
#define FAST_MEMSET p_main->pf_memset
|