From 0f872a31541b655d5265da0801e5fae43faf511f Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Fri, 27 Apr 2001 23:51:52 +0000 Subject: fixed video output plugin handling, more cleanups, commented out not-working code CVS patchset: 37 CVS date: 2001/04/27 23:51:52 --- configure.in | 2 +- include/xine.h.tmpl.in | 88 +++++++++++--- src/audio_out/Makefile.am | 19 +-- src/demuxers/demux_avi.c | 6 +- src/video_out/video_out_xv.c | 56 +++------ src/xine-engine/load_plugins.c | 261 +++++++++++++++++++--------------------- src/xine-engine/video_out.h | 52 +++++--- src/xine-engine/xine_internal.h | 87 ++++++++++---- 8 files changed, 332 insertions(+), 239 deletions(-) diff --git a/configure.in b/configure.in index dab75d31c..73bed278b 100644 --- a/configure.in +++ b/configure.in @@ -12,7 +12,7 @@ AC_PREREQ(2.13) dnl dnl Require libtool minimum version 1.3.5 dnl -AC_PREREQ_LIBTOOL(1.3.5,,AC_MSG_ERROR(*** You should have libtool >= 1.3.5 installed ***)) +dnl AC_PREREQ_LIBTOOL(1.3.5,,AC_MSG_ERROR(*** You should have libtool >= 1.3.5 installed ***)) XINE_MAJOR=0 diff --git a/include/xine.h.tmpl.in b/include/xine.h.tmpl.in index 3e581d299..b91a5f4fd 100644 --- a/include/xine.h.tmpl.in +++ b/include/xine.h.tmpl.in @@ -29,7 +29,7 @@ \endverbatim */ /* - * $Id: xine.h.tmpl.in,v 1.9 2001/04/27 10:42:38 f1rmb Exp $ + * $Id: xine.h.tmpl.in,v 1.10 2001/04/27 23:51:52 guenter Exp $ * */ @@ -39,7 +39,7 @@ #include /** - * \defgroup versgroup Version contants + * \defgroup versgroup Version constants * @{ */ /** \brief Major version constant */ @@ -53,10 +53,44 @@ #ifndef DOC_HIDDEN typedef void vo_driver_t; typedef void ao_functions_t; -typedef void config_values_t; typedef void xine_t; #endif +typedef struct config_values_s config_values_t; + +struct config_values_s { + /* + * lookup config values + */ + char* (*lookup_str) (config_values_t *this, + char *key, char *str_default); + + int (*lookup_int) (config_values_t *this, + char *key, int n_default); + + /* + * set config values + */ + + void (*set_str) (config_values_t *this, + char *key, char *value) ; + + void (*set_int) (config_values_t *this, + char *key, int value) ; + + /* + * write config file to disk + */ + void (*save) (config_values_t *this); + + /* + * read config file from disk, ovverriding values in memory + * if you also want to clear values that are not in the file, + * use _init instead! + */ + void (*read) (config_values_t *this, char *filename); +}; + /** * \brief Current xine status function type * \param nStatus Current status @@ -321,24 +355,42 @@ char **xine_get_autoplay_mrls (xine_t *this, char *plugin_id); /** * @defgroup loadpluginsgroup Loading plugins + * output plugin load support functions * @{ */ -/* visual_type (see bellow) */ -#define VIDEO_OUTPUT_TYPE_GETID 0 -#define VIDEO_OUTPUT_TYPE_PROBE 1 -#define VIDEO_OUTPUT_TYPE_X11 2 -#define VIDEO_OUTPUT_TYPE_FB 3 + +#define VISUAL_TYPE_X11 1 +#define VISUAL_TYPE_FB 2 +#define VISUAL_TYPE_GTK 3 + +/** + * \fn char **list_video_output_plugins (int visual_type) + * \brief list available video output plugins + * \return a list of available video output plugins for the specified visual type - the list is sorted by plugin priority + */ +char **xine_list_video_output_plugins (int visual_type); + +/** + * \fn vo_driver_t *load_video_output_plugin(config_values_t *config, char *id, int visual_type, void *visual) + * \brief load a specific video output plugin + */ vo_driver_t *xine_load_video_output_plugin(config_values_t *config, - char *filename, char *id, - int visual_type, void *visual); -/* audio_type */ -#define AUDIO_OUTPUT_TYPE_GETID 0 -#define AUDIO_OUTPUT_TYPE_PROBE 1 -#define AUDIO_OUTPUT_TYPE_OSS 2 -#define AUDIO_OUTPUT_TYPE_ALSA 3 -#define AUDIO_OUTPUT_TYPE_ESD 4 -ao_functions_t *xine_load_audio_output_plugin(config_values_t *config, - char *filename, char *id); + char *id, int visual_type, void *visual); + +/** + * \fn char **list_audio_output_plugins () + * \brief generate a list of all available audio output plugins + * \return a list of available audio output plugins the list returned is sorted by plugin priority + */ + +char **xine_list_audio_output_plugins (); + +/** + * \fn ao_functions_t *load_audio_output_plugin(config_values_t *config, char *id) + * \brief load a specific audio output plugin + */ + +ao_functions_t *xine_load_audio_output_plugin(config_values_t *config, char *id); /** @} end of loadpluginsgroup */ diff --git a/src/audio_out/Makefile.am b/src/audio_out/Makefile.am index c8c82ee32..1b82e5da1 100644 --- a/src/audio_out/Makefile.am +++ b/src/audio_out/Makefile.am @@ -6,6 +6,10 @@ LIBTOOL = $(SHELL) $(top_builddir)/libtool-nofpic libdir = $(XINE_PLUGINDIR) +# +# alsa plugin is completely broken due to major api change +# on the alsa project side +# if HAVE_ALSA alsa_module = xineplug_ao_out_alsa.la endif @@ -20,18 +24,19 @@ endif # All of xine audio out plugins should be named like the # scheme "xineplug_ao_out_" # -lib_LTLIBRARIES = xineplug_ao_out_oss.la $(alsa_module) $(esd_module) +#lib_LTLIBRARIES = xineplug_ao_out_oss.la $(alsa_module) $(esd_module) +lib_LTLIBRARIES = xineplug_ao_out_oss.la xineplug_ao_out_oss_la_SOURCES = audio_oss_out.c resample.c xineplug_ao_out_oss_la_LDFLAGS = -avoid-version -module -xineplug_ao_out_alsa_la_SOURCES = audio_alsa_out.c resample.c -xineplug_ao_out_alsa_la_LIBADD = $(ALSA_LIBS) -xineplug_ao_out_alsa_la_LDFLAGS = -avoid-version -module +#xineplug_ao_out_alsa_la_SOURCES = audio_alsa_out.c resample.c +#xineplug_ao_out_alsa_la_LIBADD = $(ALSA_LIBS) +#xineplug_ao_out_alsa_la_LDFLAGS = -avoid-version -module -xineplug_ao_out_esd_la_SOURCES = audio_esd_out.c resample.c -xineplug_ao_out_esd_la_LIBADD = $(ESD_LIBS) -xineplug_ao_out_esd_la_LDFLAGS = -avoid-version -module +#xineplug_ao_out_esd_la_SOURCES = audio_esd_out.c resample.c +#xineplug_ao_out_esd_la_LIBADD = $(ESD_LIBS) +#xineplug_ao_out_esd_la_LDFLAGS = -avoid-version -module noinst_HEADERS = audio_oss_out.h audio_alsa_out.h audio_esd_out.h resample.h diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 4fdf68d2e..83cd44bf9 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_avi.c,v 1.4 2001/04/24 17:42:26 guenter Exp $ + * $Id: demux_avi.c,v 1.5 2001/04/27 23:51:52 guenter Exp $ * * demultiplexer for avi streams * @@ -968,10 +968,12 @@ demux_plugin_t *init_demux_plugin(int iface, config_values_t *config) { demux_avi_t *this = xmalloc (sizeof (demux_avi_t)); + xine_debug = config->lookup_int (config, "xine_debug", 0); + switch (iface) { case 1: - //FIXME xine_debug = xd; + this->demux_plugin.interface_version = DEMUXER_PLUGIN_IFACE_VERSION; this->demux_plugin.open = demux_avi_open; this->demux_plugin.start = demux_avi_start; diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index 1c5361d97..529b6c9a7 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_xv.c,v 1.4 2001/04/26 23:18:36 guenter Exp $ + * $Id: video_out_xv.c,v 1.5 2001/04/27 23:51:52 guenter Exp $ * * video_out_xv.c, X11 video extension interface for xine * @@ -51,13 +51,14 @@ #include #include +#include "monitor.h" #include "video_out.h" #include "xine_internal.h" -#define VO_OUT_XV_IFACE_VERSION 1 +uint32_t xine_debug; /* override xprintf definition */ -#define xprintf(LVL, FMT, ARGS...) { printf(FMT, ##ARGS); } +/* #define xprintf(LVL, FMT, ARGS...) { printf(FMT, ##ARGS); } */ typedef struct xv_property_s { int value; @@ -663,12 +664,8 @@ static void xv_check_capability (xv_driver_t *this, uint32_t capability, int pro xv_set_property (&this->vo_driver, property, this->config->lookup_int (this->config, str_prop, nDefault) ); } -static char *xv_get_identifier(void) { - return "X11_XV"; -} -vo_driver_t *init_video_out_plugin (int iface, config_values_t *config, - void *visual, int visual_type) { +vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual) { xv_driver_t *this; Display *display = NULL; @@ -688,32 +685,8 @@ vo_driver_t *init_video_out_plugin (int iface, config_values_t *config, XineramaScreenInfo *screeninfo = NULL; #endif - if(iface > VO_OUT_XV_IFACE_VERSION || iface <= 0) { - printf("%s: wrong interface version, current = %d, wanted = %d\n", - __FILE__, VIDEO_OUT_PLUGIN_IFACE_VERSION, iface); - return NULL; - } - - switch(visual_type) { - - case VIDEO_OUTPUT_TYPE_GETID: - this = malloc (sizeof (xv_driver_t)); - memset (this, 0, sizeof(xv_driver_t)); - this->vo_driver.interface_version = VO_OUT_XV_IFACE_VERSION; - this->vo_driver.get_identifier = xv_get_identifier; - - return &this->vo_driver; - break; - - case VIDEO_OUTPUT_TYPE_X11: - display = (Display *) visual; - break; - - default: - printf("%s: Wrong output type (%d)\n", __FILE__, visual_type); - return NULL; - break; - } + display = (Display *) visual; + xine_debug = config->lookup_int (config, "xine_debug", 0); /* * check for Xvideo support @@ -772,7 +745,6 @@ vo_driver_t *init_video_out_plugin (int iface, config_values_t *config, this->capabilities = 0; this->config = config; - this->vo_driver.interface_version = VO_OUT_XV_IFACE_VERSION; this->vo_driver.get_capabilities = xv_get_capabilities; this->vo_driver.alloc_frame = xv_alloc_frame; this->vo_driver.update_frame_format = xv_update_frame_format; @@ -784,7 +756,6 @@ vo_driver_t *init_video_out_plugin (int iface, config_values_t *config, this->vo_driver.get_window = xv_get_window; this->vo_driver.set_logo_mode = xv_set_logo_mode; this->vo_driver.exit = xv_exit; - this->vo_driver.get_identifier = xv_get_identifier; if (XAllocNamedColor (display, DefaultColormap (display, this->screen), "black", &this->black, &ignored) == 0) { @@ -944,4 +915,17 @@ vo_driver_t *init_video_out_plugin (int iface, config_values_t *config, return &this->vo_driver; } +static vo_info_t vo_info_xv = { + VIDEO_OUT_IFACE_VERSION, + "Xv", + "xine video output plugin using the MIT X video extension", + VISUAL_TYPE_X11, + 10 +}; + +vo_info_t *get_video_out_plugin_info() { + return &vo_info_xv; +} + + #endif diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 4ff20ecf2..fde565b03 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: load_plugins.c,v 1.10 2001/04/27 11:32:39 f1rmb Exp $ + * $Id: load_plugins.c,v 1.11 2001/04/27 23:51:52 guenter Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -41,11 +41,10 @@ #include "video_out.h" #include "metronom.h" #include "configfile.h" +#include "utils.h" #include "monitor.h" -/* - * - */ + void load_demux_plugins (xine_t *this, config_values_t *config, int iface_version) { DIR *dir; @@ -121,9 +120,7 @@ void load_demux_plugins (xine_t *this, this->cur_demuxer_plugin = NULL; } -/* - * - */ + void load_input_plugins (xine_t *this, config_values_t *config, int iface_version) { DIR *dir; @@ -323,105 +320,131 @@ void load_decoder_plugins (xine_t *this, } -void load_video_out_plugins (xine_t *this, - config_values_t *config, int iface_version) { +char **xine_list_video_output_plugins (int visual_type) { - if(this == NULL || config == NULL) { - printf("%s(%s@%d): parameter should be non null, exiting\n", - __FILE__, __FUNCTION__, __LINE__); - exit(1); - } + char **plugin_ids; + int num_plugins = 0; + DIR *dir; -} + plugin_ids = xmalloc (50 * sizeof (char *)); + plugin_ids[0] = NULL; -void load_audio_out_plugins (xine_t *this, - config_values_t *config, int iface_version) { + dir = opendir (XINE_PLUGINDIR); + + if (dir) { + struct dirent *dir_entry; + + while ((dir_entry = readdir (dir)) != NULL) { + char str[1024]; + void *plugin; + int nLen = strlen (dir_entry->d_name); + + if ((strncasecmp(dir_entry->d_name, + XINE_VIDEO_OUT_PLUGIN_PREFIXNAME, + XINE_VIDEO_OUT_PLUGIN_PREFIXNAME_LENGTH) == 0) && + ((dir_entry->d_name[nLen-3]=='.') + && (dir_entry->d_name[nLen-2]=='s') + && (dir_entry->d_name[nLen-1]=='o'))) { + + /*printf ("load_plugins: found a video output plugin: %s\n", + dir_entry->d_name); */ - if(this == NULL || config == NULL) { - printf("%s(%s@%d): parameter should be non null, exiting\n", - __FILE__, __FUNCTION__, __LINE__); - exit(1); - } + sprintf (str, "%s/%s", XINE_PLUGINDIR, dir_entry->d_name); + + /* + * now, see if we can open this plugin, + * check if it has got the right visual type + * and finally if all this went through get it's id + */ + + if(!(plugin = dlopen (str, RTLD_LAZY))) { + + /* printf("load_plugins: cannot load plugin %s (%s)\n", + str, dlerror()); */ + + } else { + + vo_info_t* (*getinfo) (); + vo_info_t *vo_info; + + if ((getinfo = dlsym(plugin, "get_video_out_plugin_info")) != NULL) { + vo_info = getinfo(); + + if ( (vo_info->visual_type == visual_type) + && (vo_info->interface_version == VIDEO_OUT_IFACE_VERSION) ) { + /* printf("video output plugin found : %s (%s)\n", + vo_info->id, vo_info->description); */ + + /* FIXME: sort the list by vo_info->priority */ + + plugin_ids[num_plugins] = vo_info->id; + num_plugins++; + plugin_ids[num_plugins] = NULL; + } + } else { + + printf("load_plugins: %s seems to be an invalid plugin (lacks get_video_out_plugin_info() function)\n", str); + } + } + } + } + } else { + perror ("load_plugins: get_available_video_output_plugins - cannot access plugin dir:"); + } + + return plugin_ids; } + vo_driver_t *xine_load_video_output_plugin(config_values_t *config, - char *filename, char *id, - int visual_type, void *visual) { + char *id, int visual_type, void *visual) { DIR *dir; - vo_driver_t *vod = NULL; - - if((filename == NULL && id == NULL) || visual == NULL || config == NULL) { - printf("%s(%s@%d): parameter(s) should be non null.\n", - __FILE__, __FUNCTION__, __LINE__); - return NULL; - } + vo_driver_t *vod; dir = opendir (XINE_PLUGINDIR); if (dir) { - struct dirent *pEntry; + struct dirent *dir_entry; - while ((pEntry = readdir (dir)) != NULL) { + while ((dir_entry = readdir (dir)) != NULL) { char str[1024]; void *plugin; - int nLen = strlen (pEntry->d_name); - vod = NULL; - memset(&str, 0, 1024); - - if ((strncasecmp(pEntry->d_name, + int nLen = strlen (dir_entry->d_name); + + if ((strncasecmp(dir_entry->d_name, XINE_VIDEO_OUT_PLUGIN_PREFIXNAME, XINE_VIDEO_OUT_PLUGIN_PREFIXNAME_LENGTH) == 0) && - ((pEntry->d_name[nLen-3]=='.') - - && (pEntry->d_name[nLen-2]=='s') - && (pEntry->d_name[nLen-1]=='o'))) { + ((dir_entry->d_name[nLen-3]=='.') + && (dir_entry->d_name[nLen-2]=='s') + && (dir_entry->d_name[nLen-1]=='o'))) { - sprintf (str, "%s/%s", XINE_PLUGINDIR, pEntry->d_name); - - if(filename) { /* load by name */ - if(!strncasecmp(filename, pEntry->d_name, strlen(pEntry->d_name))) { + sprintf (str, "%s/%s", XINE_PLUGINDIR, dir_entry->d_name); + + if(!(plugin = dlopen (str, RTLD_LAZY))) { + printf("load_plugins: video output plugin %s failed to link: %s\n", + str, dlerror()); + return NULL; + } else { + void *(*initplug) (config_values_t *, void *); + vo_info_t* (*getinfo) (); + vo_info_t *vo_info; + + if ((getinfo = dlsym(plugin, "get_video_out_plugin_info")) != NULL) { + vo_info = getinfo(); + + if (!strcmp(id, vo_info->id)) { - if(!(plugin = dlopen (str, RTLD_LAZY))) { - fprintf(stderr, "%s(%d): %s doesn't seem to be installed (%s)\n", - __FILE__, __LINE__, str, dlerror()); - exit(1); - } - else { - void *(*initplug) (int, config_values_t *, void *, int); - if((initplug = dlsym(plugin, "init_video_out_plugin")) != NULL) { - vod = (vo_driver_t *) initplug(VIDEO_OUT_PLUGIN_IFACE_VERSION, - config, visual, visual_type); + vod = (vo_driver_t *) initplug(config, visual); - printf("video output plugin found : %s(ID: %s, iface: %d)\n", - str, vod->get_identifier(), vod->interface_version); + if (vod) + printf("load_plugins: video output plugin %s sucessfully loaded.\n", str); + else + printf("load_plugins: video output plugin %s: init_video_out_plugin failed.\n", str); - return vod; - } - } - } - } - else { /* load by ID */ - if(!(plugin = dlopen (str, RTLD_LAZY))) { - fprintf(stderr, "%s(%d): %s doesn't seem to be installed (%s)\n", - __FILE__, __LINE__, str, dlerror()); - exit(1); - } - else { - void *(*initplug) (int, config_values_t *, void *, int); - - if((initplug = dlsym(plugin, "init_video_out_plugin")) != NULL) { - - vod = (vo_driver_t *) initplug(VIDEO_OUT_PLUGIN_IFACE_VERSION, - config, visual, visual_type); - - printf("video output plugin found : %s(ID: %s, iface: %d)\n", - str, vod->get_identifier(), vod->interface_version); - - if(!strcasecmp(id, vod->get_identifier())) { return vod; } } @@ -430,25 +453,16 @@ vo_driver_t *xine_load_video_output_plugin(config_values_t *config, } } } - return NULL; -} - -char **enum_video_output_plugins(int visual_type) { - // Not implemented + + printf ("load_plugins: failed to find video output plugin <%s>\n", id); return NULL; } ao_functions_t *xine_load_audio_output_plugin(config_values_t *config, - char *filename, char *id) { + char *id) { DIR *dir; ao_functions_t *aod = NULL; - if(filename == NULL && id == NULL) { - printf("%s(%s@%d): parameter(s) should be non null.\n", - __FILE__, __FUNCTION__, __LINE__); - return NULL; - } - dir = opendir (XINE_PLUGINDIR); if (dir) { @@ -471,49 +485,24 @@ ao_functions_t *xine_load_audio_output_plugin(config_values_t *config, sprintf (str, "%s/%s", XINE_PLUGINDIR, pEntry->d_name); - if(filename) { /* load by name */ - if(!strncasecmp(filename, pEntry->d_name, strlen(pEntry->d_name))) { - - if(!(plugin = dlopen (str, RTLD_LAZY))) { - fprintf(stderr, "%s(%d): %s doesn't seem to be installed (%s)\n", - __FILE__, __LINE__, str, dlerror()); - exit(1); - } - else { - void *(*initplug) (int, config_values_t *); - - if((initplug = dlsym(plugin, "init_audio_out_plugin")) != NULL) { - - aod = (ao_functions_t *) initplug(AUDIO_OUT_PLUGIN_IFACE_VERSION, config); - - printf("audio output plugin found : %s(ID: %s, iface: %d)\n", - str, aod->get_identifier(), aod->interface_version); - - return aod; - } - } - } + if(!(plugin = dlopen (str, RTLD_LAZY))) { + fprintf(stderr, "%s(%d): %s doesn't seem to be installed (%s)\n", + __FILE__, __LINE__, str, dlerror()); + exit(1); } - else { /* load by ID */ - if(!(plugin = dlopen (str, RTLD_LAZY))) { - fprintf(stderr, "%s(%d): %s doesn't seem to be installed (%s)\n", - __FILE__, __LINE__, str, dlerror()); - exit(1); - } - else { - void *(*initplug) (int, config_values_t *); + else { + void *(*initplug) (int, config_values_t *); + + if((initplug = dlsym(plugin, "init_audio_out_plugin")) != NULL) { - if((initplug = dlsym(plugin, "init_audio_out_plugin")) != NULL) { - - aod = (ao_functions_t *) initplug(AUDIO_OUT_PLUGIN_IFACE_VERSION, - config); - - printf("audio output plugin found : %s(ID: %s, iface: %d)\n", - str, aod->get_identifier(), aod->interface_version); - - if(!strcasecmp(id, aod->get_identifier())) { - return aod; - } + aod = (ao_functions_t *) initplug(AUDIO_OUT_PLUGIN_IFACE_VERSION, + config); + + printf("audio output plugin found : %s(ID: %s, iface: %d)\n", + str, aod->get_identifier(), aod->interface_version); + + if(!strcasecmp(id, aod->get_identifier())) { + return aod; } } } @@ -523,9 +512,9 @@ ao_functions_t *xine_load_audio_output_plugin(config_values_t *config, return NULL; } -char **enum_audio_output_plugins(int output_type) { +char **xine_list_audio_output_plugins() { - // Not implemented + printf ("load_plugins: FIXME: list_audio_output_plugins not implemented yet\n"); return NULL; } diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h index b26adb614..864132660 100644 --- a/src/xine-engine/video_out.h +++ b/src/xine-engine/video_out.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out.h,v 1.2 2001/04/26 11:31:36 f1rmb Exp $ + * $Id: video_out.h,v 1.3 2001/04/27 23:51:52 guenter Exp $ * * * xine version of video_out.h @@ -213,15 +213,11 @@ struct vo_instance_s { * from generic vo functions. */ +#define VIDEO_OUT_IFACE_VERSION 1 struct vo_driver_s { - /* - * plugin interface version, lower versions _may_ be supported - */ - int interface_version; - - uint32_t (*get_capabilities) (vo_driver_t *this); /* for constants see below */ + uint32_t (*get_capabilities) (vo_driver_t *this); /* for constants see above */ /* * allocate an vo_frame_t struct, @@ -255,10 +251,6 @@ struct vo_driver_s { void (*exit) (vo_driver_t *this); - /* - * return human readable identifier for this plugin - */ - char* (*get_identifier) (void); }; @@ -270,14 +262,40 @@ struct vo_driver_s { vo_instance_t *vo_new_instance (vo_driver_t *driver, metronom_t *metronom) ; /* - * init a video driver. The driver is selected either - * by auto-detection or (if given) by the driver_name + * to build a dynamic video output plugin + * you have to implement these functions: + * + * + * init_video_out_plugin init and set up driver so it is fully operational + * + * parameters: config - config object pointer + * visual - driver specific info (e.g. Display*) + * + * return value: video_driver_t* in case of success, + * NULL on failure (e.g. wrong interface version, wrong visual type...) + * + * vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual); + * + * + * get_video_out_plugin_info + * + * peek at some (static) information about the plugin without initializing it + * + * parameters: none + * + * return value: vo_info_t* : some information about the plugin + * vo_info_t *get_video_out_plugin_info (); */ -vo_instance_t *vo_init (char *driver_name); +typedef struct vo_info_s { + + int interface_version; /* plugin interface version */ + char *id; /* id of this plugin */ + char *description; /* human-readable description of this plugin */ + int visual_type; /* visual type supported by this plugin */ + int priority; /* priority of this plugin for auto-probing */ -/* returns a list of available drivers */ - -char *vo_get_available_drivers (); +} vo_info_t; #endif + diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index 0a5497757..fd2fc0d01 100644 --- a/src/xine-engine/xine_internal.h +++ b/src/xine-engine/xine_internal.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_internal.h,v 1.12 2001/04/27 10:42:38 f1rmb Exp $ + * $Id: xine_internal.h,v 1.13 2001/04/27 23:51:52 guenter Exp $ * */ @@ -315,7 +315,8 @@ void audio_decoder_shutdown (xine_t *this); /* * Load input/demux/audio_out/video_out plugins */ -/* plugin names scheme */ + +/* plugin naming scheme */ #define XINE_INPUT_PLUGIN_PREFIXNAME "xineplug_inp_" #define XINE_INPUT_PLUGIN_PREFIXNAME_LENGTH 13 @@ -331,31 +332,73 @@ void audio_decoder_shutdown (xine_t *this); #define XINE_DECODER_PLUGIN_PREFIXNAME "xineplug_decode_" #define XINE_DECODER_PLUGIN_PREFIXNAME_LENGTH 16 -/* prototypes of load_plugins.c functions. */ +/* + * load all available demuxer plugins + */ void load_demux_plugins (xine_t *this, config_values_t *config, int iface_version); + +/* + * load all available input plugins + */ + void load_input_plugins (xine_t *this, config_values_t *config, int iface_version); -void load_video_out_plugins (xine_t *this, - config_values_t *config, int iface_version); -void load_audio_out_plugins (xine_t *this, - config_values_t *config, int iface_version); + +/* + * load all available decoder plugins + */ void load_decoder_plugins (xine_t *this, config_values_t *config, int iface_version); -/* visual_type (see bellow) */ -#define VIDEO_OUTPUT_TYPE_GETID 0 -#define VIDEO_OUTPUT_TYPE_PROBE 1 -#define VIDEO_OUTPUT_TYPE_X11 2 -#define VIDEO_OUTPUT_TYPE_FB 3 + +/* + * output driver load support functions + */ + +/* video */ + +#define VISUAL_TYPE_X11 1 +#define VISUAL_TYPE_FB 2 +#define VISUAL_TYPE_GTK 3 + +/* + * list_video_output_plugins + * + * returns a list of available video output plugins for + * the specified visual type - the list is sorted by plugin + * priority + */ + +char **xine_list_video_output_plugins (int visual_type); + +/* + * load_video_output_plugin + * + * load a specific video output plugin + */ + vo_driver_t *xine_load_video_output_plugin(config_values_t *config, - char *filename, char *id, - int visual_type, void *visual); -#define AUDIO_OUTPUT_TYPE_GETID 0 -#define AUDIO_OUTPUT_TYPE_PROBE 1 -#define AUDIO_OUTPUT_TYPE_OSS 2 -#define AUDIO_OUTPUT_TYPE_ALSA 3 -#define AUDIO_OUTPUT_TYPE_ESD 4 -ao_functions_t *xine_load_audio_output_plugin(config_values_t *config, - char *filename, char *id); -#endif + char *id, int visual_type, void *visual); + +/* + * audio output plugin dynamic loading stuff + */ + +/* + * list_audio_output_plugins + * + * returns a list of available audio output plugins + * the list returned is sorted by plugin priority + */ + +char **xine_list_audio_output_plugins (); + +/* + * load_audio_output_plugin + * + * load a specific audio output plugin + */ +ao_functions_t *xine_load_audio_output_plugin(config_values_t *config, char *id); + +#endif -- cgit v1.2.3