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
|
|
|
*****************************************************************************
|
2005-07-09 14:17:09 +08:00
|
|
|
* Copyright (C) 1999, 2000, 2001, 2002 the VideoLAN team
|
2004-07-01 00:26:48 +08:00
|
|
|
* $Id$
|
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.
|
2004-01-26 02:17:08 +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
|
2006-01-13 07:10:04 +08:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
|
2000-02-13 12:31:35 +08:00
|
|
|
*****************************************************************************/
|
2000-01-11 07:36:06 +08:00
|
|
|
|
2006-12-03 21:48:21 +08:00
|
|
|
#if !defined( __LIBVLC__ )
|
|
|
|
#error You are not libvlc or one of its plugins. You cannot include this file
|
|
|
|
#endif
|
|
|
|
|
2000-02-13 12:31:35 +08:00
|
|
|
/*****************************************************************************
|
2006-09-15 22:31:51 +08:00
|
|
|
* libvlc_global_data_t (global variable)
|
2000-02-13 12:31:35 +08:00
|
|
|
*****************************************************************************
|
2002-10-03 21:21:55 +08:00
|
|
|
* This structure has an unique instance, statically allocated in main and
|
2006-09-15 22:31:51 +08:00
|
|
|
* never accessed from the outside. It stores once-initialized data such as
|
2002-10-03 21:21:55 +08:00
|
|
|
* the CPU capabilities or the global lock.
|
|
|
|
*****************************************************************************/
|
2006-09-15 22:31:51 +08:00
|
|
|
struct libvlc_global_data_t
|
2002-10-03 21:21:55 +08:00
|
|
|
{
|
|
|
|
VLC_COMMON_MEMBERS
|
|
|
|
|
2006-06-22 18:03:32 +08:00
|
|
|
vlc_bool_t b_ready; ///< Initialization boolean
|
|
|
|
uint32_t i_cpu; ///< CPU extensions
|
2006-10-01 22:24:44 +08:00
|
|
|
|
2006-09-18 23:35:55 +08:00
|
|
|
/* Object structure data */
|
2006-06-22 18:03:32 +08:00
|
|
|
int i_counter; ///< object counter
|
|
|
|
int i_objects; ///< Attached objects count
|
|
|
|
vlc_object_t ** pp_objects; ///< Array of all objects
|
|
|
|
|
|
|
|
module_bank_t * p_module_bank; ///< The module bank
|
2006-09-15 22:31:51 +08:00
|
|
|
intf_thread_t *p_probe; ///< Devices prober
|
2006-01-14 18:57:44 +08:00
|
|
|
|
2002-10-03 21:21:55 +08:00
|
|
|
/* Arch-specific variables */
|
2004-07-01 00:26:48 +08:00
|
|
|
#if !defined( WIN32 )
|
|
|
|
vlc_bool_t b_daemon;
|
2005-12-15 19:37:45 +08:00
|
|
|
#endif
|
2002-10-03 21:21:55 +08:00
|
|
|
#if defined( SYS_BEOS )
|
|
|
|
vlc_object_t * p_appthread;
|
2003-01-19 11:16:24 +08:00
|
|
|
char * psz_vlcpath;
|
2006-02-01 21:01:06 +08:00
|
|
|
#elif defined( __APPLE__ )
|
2003-01-19 11:16:24 +08:00
|
|
|
char * psz_vlcpath;
|
2005-08-05 03:09:15 +08:00
|
|
|
vlc_iconv_t iconv_macosx; /* for HFS+ file names */
|
|
|
|
vlc_mutex_t iconv_lock;
|
2002-11-11 02:04:24 +08:00
|
|
|
#elif defined( WIN32 ) && !defined( UNDER_CE )
|
2002-10-03 21:21:55 +08:00
|
|
|
SIGNALOBJECTANDWAIT SignalObjectAndWait;
|
|
|
|
vlc_bool_t b_fast_mutex;
|
|
|
|
int i_win9x_cv;
|
2003-02-17 13:50:31 +08:00
|
|
|
char * psz_vlcpath;
|
2004-10-05 00:03:30 +08:00
|
|
|
#elif defined( UNDER_CE )
|
|
|
|
char * psz_vlcpath;
|
2002-10-03 21:21:55 +08:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
/*****************************************************************************
|
2006-09-15 22:31:51 +08:00
|
|
|
* libvlc_internal_instance_t
|
2002-10-03 21:21:55 +08:00
|
|
|
*****************************************************************************
|
2006-09-15 22:31:51 +08:00
|
|
|
* This structure is a LibVLC instance, for use by libvlc core and plugins
|
2000-02-13 12:31:35 +08:00
|
|
|
*****************************************************************************/
|
2006-09-15 22:31:51 +08:00
|
|
|
struct libvlc_int_t
|
2000-01-11 07:36:06 +08:00
|
|
|
{
|
* ALL: the first libvlc commit.
As for video output 4, this breaks almost everything, but I'll slowly
do what remains to be fixed during the weekend.
Changes in vlc:
===============
* vlc is now a very small program (20 lines) which uses the libvlc API;
it is quite simple for the moment but can be extended in the future.
* interfaces, decoders, video outputs, etc. are now almost the same
objects (yes, I know, this is C++ redone in C) and are structured in
a tree. More about this later, but basically it allows the following
nice features:
- several interfaces
- several playlists with several outputs
- input plugins spawning helper interfaces (will be used for DVD menus)
- anything spawning anything; I swear there are useful uses for this!
* libvlc can be used in other programs; I'm currently writing a Mozilla
plugin for my employer.
Things currently broken:
========================
* most interfaces, most ports
* the playlist handling (almost finished rewriting this though). This means
no file can be played from the GUI, you need to use the commandline. This
also means it segfaults at EOF, when exiting the program, and it sometimes
refuses to open a file when asked to.
2002-06-01 20:32:02 +08:00
|
|
|
VLC_COMMON_MEMBERS
|
|
|
|
|
2000-01-11 07:36:06 +08:00
|
|
|
/* Global properties */
|
2006-09-16 00:18:08 +08:00
|
|
|
int i_argc; ///< command line arguments count
|
|
|
|
char ** ppsz_argv; ///< command line arguments
|
|
|
|
char * psz_homedir; ///< configuration directory
|
|
|
|
char * psz_userdir; ///< user's home directory
|
|
|
|
char * psz_configfile; ///< location of config file
|
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
|
|
|
|
2006-09-16 00:18:08 +08:00
|
|
|
playlist_t *p_playlist; ///< playlist object
|
2001-12-04 00:18:37 +08:00
|
|
|
|
2006-09-18 23:35:55 +08:00
|
|
|
/* Messages */
|
|
|
|
msg_bank_t msg_bank; ///< The message bank
|
|
|
|
int i_verbose; ///< info messages
|
|
|
|
vlc_bool_t b_color; ///< color messages?
|
|
|
|
|
2006-09-16 00:18:08 +08:00
|
|
|
module_t * p_memcpy_module; ///< Fast memcpy plugin used
|
|
|
|
void* ( *pf_memcpy ) ( void *, const void *, size_t ); ///< fast memcpy
|
|
|
|
void* ( *pf_memset ) ( void *, int, size_t ); ///< fast memset
|
|
|
|
|
|
|
|
vlc_bool_t b_stats; ///< Should we collect stats ?
|
2006-09-15 23:10:25 +08:00
|
|
|
vlc_mutex_t timer_lock; ///< Lock to protect timers
|
|
|
|
int i_timers; ///< Number of timers
|
|
|
|
counter_t **pp_timers; ///< Array of all timers
|
2002-03-16 09:40:58 +08:00
|
|
|
|
2006-09-16 00:18:08 +08:00
|
|
|
vlc_mutex_t config_lock; ///< Lock for the config file
|
2006-02-01 21:01:06 +08:00
|
|
|
#ifdef __APPLE__
|
2006-09-16 00:18:08 +08:00
|
|
|
vlc_mutex_t quicktime_lock; ///< QT is not thread safe on OSX
|
2003-05-21 23:40:03 +08:00
|
|
|
#endif
|
2003-10-29 09:33:27 +08:00
|
|
|
|
|
|
|
/* Structure storing the action name / key associations */
|
|
|
|
struct hotkey
|
|
|
|
{
|
|
|
|
const char *psz_action;
|
|
|
|
int i_action;
|
|
|
|
int i_key;
|
2005-12-15 19:37:45 +08:00
|
|
|
|
2005-08-09 22:27:23 +08:00
|
|
|
/* hotkey accounting information */
|
|
|
|
mtime_t i_delta_date;/*< minimum delta time between two key presses */
|
|
|
|
mtime_t i_last_date; /*< last date key was pressed */
|
|
|
|
int i_times; /*< n times pressed within delta date*/
|
2003-10-29 09:33:27 +08:00
|
|
|
} *p_hotkeys;
|
* ALL: the first libvlc commit.
As for video output 4, this breaks almost everything, but I'll slowly
do what remains to be fixed during the weekend.
Changes in vlc:
===============
* vlc is now a very small program (20 lines) which uses the libvlc API;
it is quite simple for the moment but can be extended in the future.
* interfaces, decoders, video outputs, etc. are now almost the same
objects (yes, I know, this is C++ redone in C) and are structured in
a tree. More about this later, but basically it allows the following
nice features:
- several interfaces
- several playlists with several outputs
- input plugins spawning helper interfaces (will be used for DVD menus)
- anything spawning anything; I swear there are useful uses for this!
* libvlc can be used in other programs; I'm currently writing a Mozilla
plugin for my employer.
Things currently broken:
========================
* most interfaces, most ports
* the playlist handling (almost finished rewriting this though). This means
no file can be played from the GUI, you need to use the commandline. This
also means it segfaults at EOF, when exiting the program, and it sometimes
refuses to open a file when asked to.
2002-06-01 20:32:02 +08:00
|
|
|
};
|
2000-01-11 07:36:06 +08:00
|
|
|
|