diff options
-rw-r--r-- | src/input/input_dvd.c | 94 | ||||
-rw-r--r-- | src/input/input_file.c | 79 | ||||
-rw-r--r-- | src/input/input_net.c | 71 | ||||
-rw-r--r-- | src/input/input_plugin.h | 22 | ||||
-rw-r--r-- | src/input/input_rtp.c | 103 | ||||
-rw-r--r-- | src/input/input_stdin_fifo.c | 74 | ||||
-rw-r--r-- | src/input/input_vcd.c | 94 | ||||
-rw-r--r-- | src/xine-engine/load_plugins.c | 22 |
8 files changed, 286 insertions, 273 deletions
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index 968af4ce2..e095e5461 100644 --- a/src/input/input_dvd.c +++ b/src/input/input_dvd.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: input_dvd.c,v 1.11 2001/06/23 14:05:47 f1rmb Exp $ + * $Id: input_dvd.c,v 1.12 2001/07/01 23:37:04 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -554,57 +554,57 @@ static int dvd_plugin_get_optional_data (input_plugin_t *this_gen, * */ input_plugin_t *init_input_plugin (int iface, config_values_t *config) { + dvd_input_plugin_t *this; + int i; xine_debug = config->lookup_int (config, "xine_debug", 0); - switch (iface) { - case 1: { - int i; - - this = (dvd_input_plugin_t *) malloc (sizeof (dvd_input_plugin_t)); + if (iface != 2) { + printf("vcd input plugin doesn't support plugin API version %d.\n" + "PLUGIN DISABLED.\n" + "This means there's a version mismatch between xine and this input" + "plugin.\nInstalling current input plugins should help.\n", + iface); + return NULL; + } - for (i = 0; i < MAX_DIR_ENTRIES; i++) { - this->filelist[i] = (char *) malloc (256); - this->filelist2[i] = (char *) malloc (256); - this->mrls[i] = (mrl_t *) malloc(sizeof(mrl_t)); + + this = (dvd_input_plugin_t *) malloc (sizeof (dvd_input_plugin_t)); + + for (i = 0; i < MAX_DIR_ENTRIES; i++) { + this->filelist[i] = (char *) malloc (256); + this->filelist2[i] = (char *) malloc (256); + this->mrls[i] = (mrl_t *) malloc(sizeof(mrl_t)); this->mrls[i]->mrl = (char *) malloc (256); - } - - this->mrls_allocated_entries = MAX_DIR_ENTRIES; - - this->input_plugin.interface_version = INPUT_PLUGIN_IFACE_VERSION; - this->input_plugin.get_capabilities = dvd_plugin_get_capabilities; - this->input_plugin.open = dvd_plugin_open; - this->input_plugin.read = dvd_plugin_read; - this->input_plugin.read_block = dvd_plugin_read_block; - this->input_plugin.seek = dvd_plugin_seek; - this->input_plugin.get_current_pos = dvd_plugin_get_current_pos; - this->input_plugin.get_length = dvd_plugin_get_length; - this->input_plugin.get_blocksize = dvd_plugin_get_blocksize; - this->input_plugin.eject_media = dvd_plugin_eject_media; - this->input_plugin.close = dvd_plugin_close; - this->input_plugin.get_identifier = dvd_plugin_get_identifier; - this->input_plugin.get_description = dvd_plugin_get_description; - this->input_plugin.get_dir = dvd_plugin_get_dir; - this->input_plugin.get_mrl = dvd_plugin_get_mrl; - this->input_plugin.get_autoplay_list = dvd_plugin_get_autoplay_list; - this->input_plugin.get_optional_data = dvd_plugin_get_optional_data; - - // this->fh = -1; - this->mrl = NULL; - this->config = config; - - return (input_plugin_t *) this; - } - break; - default: - fprintf(stderr, - "Dvd input plugin doesn't support plugin API version %d.\n" - "PLUGIN DISABLED.\n" - "This means there's a version mismatch between xine and this input" - "plugin.\nInstalling current input plugins should help.\n", - iface); - return NULL; } + + this->mrls_allocated_entries = MAX_DIR_ENTRIES; + + this->input_plugin.interface_version = INPUT_PLUGIN_IFACE_VERSION; + this->input_plugin.get_capabilities = dvd_plugin_get_capabilities; + this->input_plugin.open = dvd_plugin_open; + this->input_plugin.read = dvd_plugin_read; + this->input_plugin.read_block = dvd_plugin_read_block; + this->input_plugin.seek = dvd_plugin_seek; + this->input_plugin.get_current_pos = dvd_plugin_get_current_pos; + this->input_plugin.get_length = dvd_plugin_get_length; + this->input_plugin.get_blocksize = dvd_plugin_get_blocksize; + this->input_plugin.eject_media = dvd_plugin_eject_media; + this->input_plugin.close = dvd_plugin_close; + this->input_plugin.get_identifier = dvd_plugin_get_identifier; + this->input_plugin.get_description = dvd_plugin_get_description; + this->input_plugin.get_dir = dvd_plugin_get_dir; + this->input_plugin.get_mrl = dvd_plugin_get_mrl; + this->input_plugin.get_autoplay_list = dvd_plugin_get_autoplay_list; + this->input_plugin.get_optional_data = dvd_plugin_get_optional_data; + this->input_plugin.handle_input_event= NULL; + this->input_plugin.is_branch_possible= NULL; + + this->mrl = NULL; + this->config = config; + this->dvd_fd = -1; + this->raw_fd = -1; + + return (input_plugin_t *) this; } diff --git a/src/input/input_file.c b/src/input/input_file.c index e7e7f6ecc..6a6bbfba9 100644 --- a/src/input/input_file.c +++ b/src/input/input_file.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: input_file.c,v 1.14 2001/06/23 20:47:29 f1rmb Exp $ + * $Id: input_file.c,v 1.15 2001/07/01 23:37:04 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -395,46 +395,43 @@ input_plugin_t *init_input_plugin (int iface, config_values_t *config) { xine_debug = config->lookup_int (config, "xine_debug", 0); - switch (iface) { - case 1: - this = (file_input_plugin_t *) malloc (sizeof (file_input_plugin_t)); - - this->input_plugin.interface_version = INPUT_PLUGIN_IFACE_VERSION; - this->input_plugin.get_capabilities = file_plugin_get_capabilities; - this->input_plugin.open = file_plugin_open; - this->input_plugin.read = file_plugin_read; - this->input_plugin.read_block = file_plugin_read_block; - this->input_plugin.seek = file_plugin_seek; - this->input_plugin.get_current_pos = file_plugin_get_current_pos; - this->input_plugin.get_length = file_plugin_get_length; - this->input_plugin.get_blocksize = file_plugin_get_blocksize; - this->input_plugin.get_dir = file_plugin_get_dir; - this->input_plugin.eject_media = file_plugin_eject_media; - this->input_plugin.get_mrl = file_plugin_get_mrl; - this->input_plugin.close = file_plugin_close; - this->input_plugin.get_description = file_plugin_get_description; - this->input_plugin.get_identifier = file_plugin_get_identifier; - this->input_plugin.get_autoplay_list = NULL; - this->input_plugin.get_optional_data = file_plugin_get_optional_data; - - this->fh = -1; - this->mrl = NULL; - this->config = config; - - this->mrls = (mrl_t **) malloc(sizeof(mrl_t)); - this->mrls_allocated_entries = 0; - - return (input_plugin_t *) this; - break; - default: - fprintf(stderr, - "File input plugin doesn't support plugin API version %d.\n" - "PLUGIN DISABLED.\n" - "This means there's a version mismatch between xine and this input" - "plugin.\nInstalling current input plugins should help.\n", - iface); + if (iface != 2) { + printf("file input plugin doesn't support plugin API version %d.\n" + "PLUGIN DISABLED.\n" + "This means there's a version mismatch between xine and this input" + "plugin.\nInstalling current input plugins should help.\n", + iface); return NULL; } -} - + this = (file_input_plugin_t *) malloc (sizeof (file_input_plugin_t)); + + this->input_plugin.interface_version = INPUT_PLUGIN_IFACE_VERSION; + this->input_plugin.get_capabilities = file_plugin_get_capabilities; + this->input_plugin.open = file_plugin_open; + this->input_plugin.read = file_plugin_read; + this->input_plugin.read_block = file_plugin_read_block; + this->input_plugin.seek = file_plugin_seek; + this->input_plugin.get_current_pos = file_plugin_get_current_pos; + this->input_plugin.get_length = file_plugin_get_length; + this->input_plugin.get_blocksize = file_plugin_get_blocksize; + this->input_plugin.get_dir = file_plugin_get_dir; + this->input_plugin.eject_media = file_plugin_eject_media; + this->input_plugin.get_mrl = file_plugin_get_mrl; + this->input_plugin.close = file_plugin_close; + this->input_plugin.get_description = file_plugin_get_description; + this->input_plugin.get_identifier = file_plugin_get_identifier; + this->input_plugin.get_autoplay_list = NULL; + this->input_plugin.get_optional_data = file_plugin_get_optional_data; + this->input_plugin.handle_input_event= NULL; + this->input_plugin.is_branch_possible= NULL; + + this->fh = -1; + this->mrl = NULL; + this->config = config; + + this->mrls = (mrl_t **) malloc(sizeof(mrl_t)); + this->mrls_allocated_entries = 0; + + return (input_plugin_t *) this; +} diff --git a/src/input/input_net.c b/src/input/input_net.c index df2ee9e83..10df55896 100644 --- a/src/input/input_net.c +++ b/src/input/input_net.c @@ -293,42 +293,41 @@ input_plugin_t *init_input_plugin (int iface, config_values_t *config) { xine_debug = config->lookup_int (config, "xine_debug", 0); - switch (iface) { - case 1: - this = (net_input_plugin_t *) malloc (sizeof (net_input_plugin_t)); - - this->input_plugin.interface_version = INPUT_PLUGIN_IFACE_VERSION; - this->input_plugin.get_capabilities = net_plugin_get_capabilities; - this->input_plugin.open = net_plugin_open; - this->input_plugin.read = net_plugin_read; - this->input_plugin.read_block = NULL; - this->input_plugin.seek = NULL; - this->input_plugin.get_current_pos = net_plugin_get_current_pos; - this->input_plugin.get_length = net_plugin_get_length; - this->input_plugin.get_blocksize = net_plugin_get_blocksize; - this->input_plugin.get_dir = NULL; - this->input_plugin.eject_media = net_plugin_eject_media; - this->input_plugin.get_mrl = net_plugin_get_mrl; - this->input_plugin.close = net_plugin_close; - this->input_plugin.get_description = net_plugin_get_description; - this->input_plugin.get_identifier = net_plugin_get_identifier; - this->input_plugin.get_autoplay_list = NULL; - this->input_plugin.get_optional_data = net_plugin_get_optional_data; - - this->fh = -1; - this->mrl = NULL; - this->config = config; - this->curpos = 0; - - return (input_plugin_t *) this; - break; - default: - fprintf(stderr, - "Net input plugin doesn't support plugin API version %d.\n" - "PLUGIN DISABLED.\n" - "This means there's a version mismatch between xine and this input" - "plugin.\nInstalling current input plugins should help.\n", - iface); + if (iface != 2) { + printf("net input plugin doesn't support plugin API version %d.\n" + "PLUGIN DISABLED.\n" + "This means there's a version mismatch between xine and this input" + "plugin.\nInstalling current input plugins should help.\n", + iface); return NULL; } + + this = (net_input_plugin_t *) malloc (sizeof (net_input_plugin_t)); + + this->input_plugin.interface_version = INPUT_PLUGIN_IFACE_VERSION; + this->input_plugin.get_capabilities = net_plugin_get_capabilities; + this->input_plugin.open = net_plugin_open; + this->input_plugin.read = net_plugin_read; + this->input_plugin.read_block = NULL; + this->input_plugin.seek = NULL; + this->input_plugin.get_current_pos = net_plugin_get_current_pos; + this->input_plugin.get_length = net_plugin_get_length; + this->input_plugin.get_blocksize = net_plugin_get_blocksize; + this->input_plugin.get_dir = NULL; + this->input_plugin.eject_media = net_plugin_eject_media; + this->input_plugin.get_mrl = net_plugin_get_mrl; + this->input_plugin.close = net_plugin_close; + this->input_plugin.get_description = net_plugin_get_description; + this->input_plugin.get_identifier = net_plugin_get_identifier; + this->input_plugin.get_autoplay_list = NULL; + this->input_plugin.get_optional_data = net_plugin_get_optional_data; + this->input_plugin.handle_input_event= NULL; + this->input_plugin.is_branch_possible= NULL; + + this->fh = -1; + this->mrl = NULL; + this->config = config; + this->curpos = 0; + + return (input_plugin_t *) this; } diff --git a/src/input/input_plugin.h b/src/input/input_plugin.h index c0f42cb30..2c109aa9d 100644 --- a/src/input/input_plugin.h +++ b/src/input/input_plugin.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: input_plugin.h,v 1.7 2001/06/02 21:44:01 guenter Exp $ + * $Id: input_plugin.h,v 1.8 2001/07/01 23:37:04 guenter Exp $ */ #ifndef HAVE_INPUT_PLUGIN_H @@ -28,7 +28,7 @@ #include "buffer.h" #include "configfile.h" -#define INPUT_PLUGIN_IFACE_VERSION 1 +#define INPUT_PLUGIN_IFACE_VERSION 2 #ifndef CLUT_T #define CLUT_T @@ -182,6 +182,19 @@ struct input_plugin_s */ int (*get_optional_data) (input_plugin_t *this, void *data, int data_type); + /* + * deliver an input event (mouse press/move, keypress) + * optional: may be NULL + */ + void (*handle_input_event) (input_plugin_t *this, int event_type, int key, + int x, int y); + + /* + * check if it is possible/valid to directly branch to this MRL + * optional: may be NULL + */ + + int (*is_branch_possible) (input_plugin_t *this, char *next_mrl); }; /* @@ -203,4 +216,9 @@ struct input_plugin_s #define INPUT_OPTIONAL_DATA_CLUT 1 #define INPUT_OPTIONAL_DATA_AUDIOLANG 2 +#define INPUT_EVENT_MOUSEBUTTON 1 +#define INPUT_EVENT_KEYPRESS 2 +#define INPUT_EVENT_MOUSEMOVE 3 + #endif + diff --git a/src/input/input_rtp.c b/src/input/input_rtp.c index f43c7cb6c..b69eeee03 100644 --- a/src/input/input_rtp.c +++ b/src/input/input_rtp.c @@ -444,63 +444,62 @@ static int rtp_plugin_get_optional_data (input_plugin_t *this_gen, * */ input_plugin_t *init_input_plugin (int iface, config_values_t *config) { + rtp_input_plugin_t *this; + int bufn; xine_debug = config->lookup_int (config, "xine_debug", 0); - switch (iface) { - case 1: { - int bufn; - - this = (rtp_input_plugin_t *) malloc (sizeof (rtp_input_plugin_t)); + if (iface != 2) { + printf("rtp input plugin doesn't support plugin API version %d.\n" + "PLUGIN DISABLED.\n" + "This means there's a version mismatch between xine and this input" + "plugin.\nInstalling current input plugins should help.\n", + iface); + return NULL; + } - for (bufn = 0; bufn < N_BUFFERS; bufn++) { - input_buffer_t *buf = malloc(sizeof(input_buffer_t)); - if (!buf) { - fprintf(stderr, "unable to allocate input buffer.\n"); - exit(1); - } - buf->buf = malloc(IBUFFER_SIZE); - if (!buf->buf) { - fprintf(stderr, "unable to allocate input buffer.\n"); - exit(1); - } - buf->next = this->free_buffers; - this->free_buffers = buf; - } - this->input_plugin.interface_version = INPUT_PLUGIN_IFACE_VERSION; - this->input_plugin.get_capabilities = rtp_plugin_get_capabilities; - this->input_plugin.open = rtp_plugin_open; - this->input_plugin.read = rtp_plugin_read; - this->input_plugin.read_block = NULL; - this->input_plugin.seek = NULL; - this->input_plugin.get_current_pos = rtp_plugin_get_current_pos; - this->input_plugin.get_length = rtp_plugin_get_length; - this->input_plugin.get_blocksize = rtp_plugin_get_blocksize; - this->input_plugin.eject_media = rtp_plugin_eject_media; - this->input_plugin.close = rtp_plugin_close; - this->input_plugin.get_identifier = rtp_plugin_get_identifier; - this->input_plugin.get_description = rtp_plugin_get_description; - this->input_plugin.get_dir = NULL; - this->input_plugin.get_mrl = rtp_plugin_get_mrl; - this->input_plugin.get_autoplay_list = NULL; - this->input_plugin.get_optional_data = rtp_plugin_get_optional_data; - - this->fh = -1; - this->mrl = NULL; - this->config = config; - - return (input_plugin_t *) this; - } - break; - default: - fprintf(stderr, - "Rtp input plugin doesn't support plugin API version %d.\n" - "PLUGIN DISABLED.\n" - "This means there's a version mismatch between xine and this input" - "plugin.\nInstalling current input plugins should help.\n", - iface); - return NULL; + this = (rtp_input_plugin_t *) malloc (sizeof (rtp_input_plugin_t)); + + for (bufn = 0; bufn < N_BUFFERS; bufn++) { + input_buffer_t *buf = malloc(sizeof(input_buffer_t)); + if (!buf) { + fprintf(stderr, "unable to allocate input buffer.\n"); + exit(1); + } + buf->buf = malloc(IBUFFER_SIZE); + if (!buf->buf) { + fprintf(stderr, "unable to allocate input buffer.\n"); + exit(1); + } + buf->next = this->free_buffers; + this->free_buffers = buf; } + + this->input_plugin.interface_version = INPUT_PLUGIN_IFACE_VERSION; + this->input_plugin.get_capabilities = rtp_plugin_get_capabilities; + this->input_plugin.open = rtp_plugin_open; + this->input_plugin.read = rtp_plugin_read; + this->input_plugin.read_block = NULL; + this->input_plugin.seek = NULL; + this->input_plugin.get_current_pos = rtp_plugin_get_current_pos; + this->input_plugin.get_length = rtp_plugin_get_length; + this->input_plugin.get_blocksize = rtp_plugin_get_blocksize; + this->input_plugin.eject_media = rtp_plugin_eject_media; + this->input_plugin.close = rtp_plugin_close; + this->input_plugin.get_identifier = rtp_plugin_get_identifier; + this->input_plugin.get_description = rtp_plugin_get_description; + this->input_plugin.get_dir = NULL; + this->input_plugin.get_mrl = rtp_plugin_get_mrl; + this->input_plugin.get_autoplay_list = NULL; + this->input_plugin.get_optional_data = rtp_plugin_get_optional_data; + this->input_plugin.handle_input_event= NULL; + this->input_plugin.is_branch_possible= NULL; + + this->fh = -1; + this->mrl = NULL; + this->config = config; + + return (input_plugin_t *) this; } diff --git a/src/input/input_stdin_fifo.c b/src/input/input_stdin_fifo.c index f2dd31528..b45e3b50f 100644 --- a/src/input/input_stdin_fifo.c +++ b/src/input/input_stdin_fifo.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: input_stdin_fifo.c,v 1.6 2001/05/30 02:09:24 f1rmb Exp $ + * $Id: input_stdin_fifo.c,v 1.7 2001/07/01 23:37:04 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -249,43 +249,41 @@ input_plugin_t *init_input_plugin (int iface, config_values_t *config) { xine_debug = config->lookup_int (config, "xine_debug", 0); - switch (iface) { - case 1: - this = (stdin_input_plugin_t *) malloc (sizeof (stdin_input_plugin_t)); - - this->input_plugin.interface_version = INPUT_PLUGIN_IFACE_VERSION; - this->input_plugin.get_capabilities = stdin_plugin_get_capabilities; - this->input_plugin.open = stdin_plugin_open; - this->input_plugin.read = stdin_plugin_read; - this->input_plugin.read_block = stdin_plugin_read_block; - this->input_plugin.seek = NULL; - this->input_plugin.get_current_pos = stdin_plugin_get_current_pos; - this->input_plugin.get_length = stdin_plugin_get_length; - this->input_plugin.get_blocksize = stdin_plugin_get_blocksize; - this->input_plugin.get_dir = NULL; - this->input_plugin.eject_media = stdin_plugin_eject_media; - this->input_plugin.get_mrl = stdin_plugin_get_mrl; - this->input_plugin.close = stdin_plugin_close; - this->input_plugin.get_description = stdin_plugin_get_description; - this->input_plugin.get_identifier = stdin_plugin_get_identifier; - this->input_plugin.get_autoplay_list = NULL; - this->input_plugin.get_optional_data = stdin_plugin_get_optional_data; - - this->fh = -1; - this->mrl = NULL; - this->config = config; - this->curpos = 0; - - return (input_plugin_t *) this; - break; - default: - fprintf(stderr, - "Stdin input plugin doesn't support plugin API version %d.\n" - "PLUGIN DISABLED.\n" - "This means there's a version mismatch between xine and this input" - "plugin.\nInstalling current input plugins should help.\n", - iface); + if (iface != 2) { + printf("rtp input plugin doesn't support plugin API version %d.\n" + "PLUGIN DISABLED.\n" + "This means there's a version mismatch between xine and this input" + "plugin.\nInstalling current input plugins should help.\n", + iface); return NULL; } + + this = (stdin_input_plugin_t *) malloc (sizeof (stdin_input_plugin_t)); + + this->input_plugin.interface_version = INPUT_PLUGIN_IFACE_VERSION; + this->input_plugin.get_capabilities = stdin_plugin_get_capabilities; + this->input_plugin.open = stdin_plugin_open; + this->input_plugin.read = stdin_plugin_read; + this->input_plugin.read_block = stdin_plugin_read_block; + this->input_plugin.seek = NULL; + this->input_plugin.get_current_pos = stdin_plugin_get_current_pos; + this->input_plugin.get_length = stdin_plugin_get_length; + this->input_plugin.get_blocksize = stdin_plugin_get_blocksize; + this->input_plugin.get_dir = NULL; + this->input_plugin.eject_media = stdin_plugin_eject_media; + this->input_plugin.get_mrl = stdin_plugin_get_mrl; + this->input_plugin.close = stdin_plugin_close; + this->input_plugin.get_description = stdin_plugin_get_description; + this->input_plugin.get_identifier = stdin_plugin_get_identifier; + this->input_plugin.get_autoplay_list = NULL; + this->input_plugin.get_optional_data = stdin_plugin_get_optional_data; + this->input_plugin.handle_input_event= NULL; + this->input_plugin.is_branch_possible= NULL; + + this->fh = -1; + this->mrl = NULL; + this->config = config; + this->curpos = 0; + + return (input_plugin_t *) this; } -/* ------------------------------------------------------------------------- */ diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c index 00a63ecc5..cd51bc385 100644 --- a/src/input/input_vcd.c +++ b/src/input/input_vcd.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: input_vcd.c,v 1.11 2001/06/23 14:05:47 f1rmb Exp $ + * $Id: input_vcd.c,v 1.12 2001/07/01 23:37:04 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -1031,58 +1031,56 @@ static int vcd_plugin_get_optional_data (input_plugin_t *this_gen, * */ input_plugin_t *init_input_plugin (int iface, config_values_t *config) { + vcd_input_plugin_t *this; + int i; xine_debug = config->lookup_int (config, "xine_debug", 0); - switch (iface) { - case 1: { - int i; - - this = (vcd_input_plugin_t *) calloc (1, sizeof (vcd_input_plugin_t)); - - for (i = 0; i < 100; i++) { - this->filelist[i] = (char *) malloc (256); - this->mrls[i] = (mrl_t *) malloc(sizeof(mrl_t)); - this->mrls[i]->mrl = (char *) malloc (256); - this->mrls[i]->size = 0; - } + if (iface != 2) { + printf("vcd input plugin doesn't support plugin API version %d.\n" + "PLUGIN DISABLED.\n" + "This means there's a version mismatch between xine and this input" + "plugin.\nInstalling current input plugins should help.\n", + iface); + return NULL; + } - this->mrls_allocated_entries = 100; - - this->input_plugin.interface_version = INPUT_PLUGIN_IFACE_VERSION; - this->input_plugin.get_capabilities = vcd_plugin_get_capabilities; - this->input_plugin.open = vcd_plugin_open; - this->input_plugin.read = vcd_plugin_read; - this->input_plugin.read_block = vcd_plugin_read_block; - this->input_plugin.seek = vcd_plugin_seek; - this->input_plugin.get_current_pos = vcd_plugin_get_current_pos; - this->input_plugin.get_length = vcd_plugin_get_length; - this->input_plugin.get_blocksize = vcd_plugin_get_blocksize; - this->input_plugin.eject_media = vcd_plugin_eject_media; - this->input_plugin.close = vcd_plugin_close; - this->input_plugin.get_identifier = vcd_plugin_get_identifier; - this->input_plugin.get_description = vcd_plugin_get_description; - this->input_plugin.get_dir = vcd_plugin_get_dir; - this->input_plugin.get_mrl = vcd_plugin_get_mrl; - this->input_plugin.get_autoplay_list = vcd_plugin_get_autoplay_list; - this->input_plugin.get_optional_data = vcd_plugin_get_optional_data; - - this->fd = -1; - this->mrl = NULL; - this->config = config; - return (input_plugin_t *) this; - } - break; - default: - fprintf(stderr, - "Dvd input plugin doesn't support plugin API version %d.\n" - "PLUGIN DISABLED.\n" - "This means there's a version mismatch between xine and this input" - "plugin.\nInstalling current input plugins should help.\n", - iface); - return NULL; + this = (vcd_input_plugin_t *) calloc (1, sizeof (vcd_input_plugin_t)); + + for (i = 0; i < 100; i++) { + this->filelist[i] = (char *) malloc (256); + this->mrls[i] = (mrl_t *) malloc(sizeof(mrl_t)); + this->mrls[i]->mrl = (char *) malloc (256); + this->mrls[i]->size = 0; } + + this->mrls_allocated_entries = 100; + + this->input_plugin.interface_version = INPUT_PLUGIN_IFACE_VERSION; + this->input_plugin.get_capabilities = vcd_plugin_get_capabilities; + this->input_plugin.open = vcd_plugin_open; + this->input_plugin.read = vcd_plugin_read; + this->input_plugin.read_block = vcd_plugin_read_block; + this->input_plugin.seek = vcd_plugin_seek; + this->input_plugin.get_current_pos = vcd_plugin_get_current_pos; + this->input_plugin.get_length = vcd_plugin_get_length; + this->input_plugin.get_blocksize = vcd_plugin_get_blocksize; + this->input_plugin.eject_media = vcd_plugin_eject_media; + this->input_plugin.close = vcd_plugin_close; + this->input_plugin.get_identifier = vcd_plugin_get_identifier; + this->input_plugin.get_description = vcd_plugin_get_description; + this->input_plugin.get_dir = vcd_plugin_get_dir; + this->input_plugin.get_mrl = vcd_plugin_get_mrl; + this->input_plugin.get_autoplay_list = vcd_plugin_get_autoplay_list; + this->input_plugin.get_optional_data = vcd_plugin_get_optional_data; + this->input_plugin.handle_input_event= NULL; + this->input_plugin.is_branch_possible= NULL; + + this->fd = -1; + this->mrl = NULL; + this->config = config; + + return (input_plugin_t *) this; } - diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index f9f485e36..1a7d97424 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.26 2001/06/23 14:05:47 f1rmb Exp $ + * $Id: load_plugins.c,v 1.27 2001/07/01 23:37:05 guenter Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -99,12 +99,14 @@ void load_demux_plugins (xine_t *this, demux_plugin_t *dxp; dxp = (demux_plugin_t *) initplug(iface_version, config); - this->demuxer_plugins[this->num_demuxer_plugins] = dxp; + if (dxp) { + this->demuxer_plugins[this->num_demuxer_plugins] = dxp; - printf("load_plugins: demux plugin found : %s\n", - this->demuxer_plugins[this->num_demuxer_plugins]->get_identifier()); + printf("load_plugins: demux plugin found : %s\n", + this->demuxer_plugins[this->num_demuxer_plugins]->get_identifier()); - this->num_demuxer_plugins++; + this->num_demuxer_plugins++; + } } if(this->num_demuxer_plugins > DEMUXER_PLUGIN_MAX) { @@ -173,12 +175,14 @@ void load_input_plugins (xine_t *this, input_plugin_t *ip; ip = (input_plugin_t *) initplug(iface_version, config); - this->input_plugins[this->num_input_plugins] = ip; + if (ip) { + this->input_plugins[this->num_input_plugins] = ip; - printf("load_plugins: input plugin found : %s\n", - this->input_plugins[this->num_input_plugins]->get_identifier(this->input_plugins[this->num_input_plugins])); + printf("load_plugins: input plugin found : %s\n", + this->input_plugins[this->num_input_plugins]->get_identifier(this->input_plugins[this->num_input_plugins])); - this->num_input_plugins++; + this->num_input_plugins++; + } } else { printf ("load_plugins: %s is no valid input plugin (lacks init_input_plugin() function)\n", str); } |