summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2002-09-05 20:19:48 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2002-09-05 20:19:48 +0000
commitc35a3e9d5068667992c1b104195de59721e23786 (patch)
treee6f5aae17dc0b565dd99825763438980d353433f
parent0a4b9224218ce85bbd13c7f5eefbfd8ddbbee4df (diff)
downloadxine-lib-c35a3e9d5068667992c1b104195de59721e23786.tar.gz
xine-lib-c35a3e9d5068667992c1b104195de59721e23786.tar.bz2
use xine_mrl_t instead of mrl_t in input plugins, implement more configfile functions
CVS patchset: 2615 CVS date: 2002/09/05 20:19:48
-rw-r--r--src/input/input_cda.c14
-rw-r--r--src/input/input_dvd.c21
-rw-r--r--src/input/input_file.c42
-rw-r--r--src/input/input_plugin.h14
-rw-r--r--src/input/input_vcd.c14
-rw-r--r--src/libxvid/xine_decoder.c10
-rw-r--r--src/xine-engine/xine_interface.c39
7 files changed, 86 insertions, 68 deletions
diff --git a/src/input/input_cda.c b/src/input/input_cda.c
index dbf0d51fb..4029587c1 100644
--- a/src/input/input_cda.c
+++ b/src/input/input_cda.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_cda.c,v 1.29 2002/09/04 23:31:08 guenter Exp $
+ * $Id: input_cda.c,v 1.30 2002/09/05 20:19:48 guenter Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -182,7 +182,7 @@ typedef struct {
char *filelist[100];
int mrls_allocated_entries;
- mrl_t **mrls;
+ xine_mrl_t **mrls;
} cda_input_plugin_t;
@@ -1618,7 +1618,7 @@ static char *cda_plugin_get_identifier (input_plugin_t *this_gen) {
/*
* Get dir.
*/
-static mrl_t **cda_plugin_get_dir (input_plugin_t *this_gen,
+static xine_mrl_t **cda_plugin_get_dir (input_plugin_t *this_gen,
char *filename, int *nEntries) {
cda_input_plugin_t *this = (cda_input_plugin_t *) this_gen;
int i;
@@ -1660,11 +1660,11 @@ static mrl_t **cda_plugin_get_dir (input_plugin_t *this_gen,
if((i-1) >= this->mrls_allocated_entries) {
++this->mrls_allocated_entries;
/* note: 1 extra pointer for terminating NULL */
- this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(mrl_t*));
- this->mrls[(i-1)] = (mrl_t *) xine_xmalloc(sizeof(mrl_t));
+ this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*));
+ this->mrls[(i-1)] = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t));
}
else {
- memset(this->mrls[(i-1)], 0, sizeof(mrl_t));
+ memset(this->mrls[(i-1)], 0, sizeof(xine_mrl_t));
}
if(this->mrls[(i-1)]->mrl) {
@@ -1848,7 +1848,7 @@ void *init_input_plugin (xine_t *xine, void *data) {
_("cddbp cache directory"), NULL, 20,
cachedir_change_cb, (void *) this);
- this->mrls = (mrl_t **) xine_xmalloc(sizeof(mrl_t*));
+ this->mrls = (xine_mrl_t **) xine_xmalloc(sizeof(xine_mrl_t*));
this->mrls_allocated_entries = 0;
_LEAVE_FUNC();
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index 6c7f53352..6dd6611ef 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -18,7 +18,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.73 2002/09/05 05:51:14 jcdutton Exp $
+ * $Id: input_dvd.c,v 1.74 2002/09/05 20:19:48 guenter Exp $
*
*/
@@ -156,7 +156,7 @@ typedef struct {
xine_t *xine;
char dvd_name[128];
size_t dvd_name_length;
- mrl_t **mrls;
+ xine_mrl_t **mrls;
int num_mrls;
/* special buffer handling for libdvdnav caching */
@@ -326,16 +326,16 @@ static void dvdnav_build_mrl_list(dvdnav_input_plugin_t *this) {
}
/* allocate enough memory for:
- * - a list of pointers to mrls sizeof(mrl_t *) * num_mrls + 1
- * - an array of mrl structures sizeof(mrl_t) * num_mrls
+ * - a list of pointers to mrls sizeof(xine_mrl_t *) * num_mrls + 1
+ * - an array of mrl structures sizeof(xine_mrl_t) * num_mrls
* - enough chars for every filename sizeof(char)*25 * num_mrls
* - "dvd://:000000.000000\0" = 25 chars
*/
- if ((this->mrls = (mrl_t **) malloc(sizeof(mrl_t *) + num_mrls *
- (sizeof(mrl_t*) + sizeof(mrl_t) + 25*sizeof(char))))) {
+ if ((this->mrls = (xine_mrl_t **) malloc(sizeof(xine_mrl_t *) + num_mrls *
+ (sizeof(xine_mrl_t*) + sizeof(xine_mrl_t) + 25*sizeof(char))))) {
/* the first mrl struct comes after the pointer list */
- mrl_t *mrl = (mrl_t *) &this->mrls[num_mrls+1];
+ xine_mrl_t *mrl = (xine_mrl_t *) &this->mrls[num_mrls+1];
/* the chars for filenames come after the mrl structs */
char *name = (char *) &mrl[num_mrls];
int pos = 0, j;
@@ -882,8 +882,8 @@ static uint32_t dvdnav_plugin_get_blocksize (input_plugin_t *this_gen) {
return DVD_BLOCK_SIZE;
}
-static mrl_t **dvdnav_plugin_get_dir (input_plugin_t *this_gen,
- char *filename, int *nFiles) {
+static xine_mrl_t **dvdnav_plugin_get_dir (input_plugin_t *this_gen,
+ char *filename, int *nFiles) {
dvdnav_input_plugin_t *this = (dvdnav_input_plugin_t*)this_gen;
trace_print("Called\n");
@@ -1508,6 +1508,9 @@ void *init_input_plugin (xine_t *xine, void *data) {
/*
* $Log: input_dvd.c,v $
+ * Revision 1.74 2002/09/05 20:19:48 guenter
+ * use xine_mrl_t instead of mrl_t in input plugins, implement more configfile functions
+ *
* Revision 1.73 2002/09/05 05:51:14 jcdutton
* XV Video out at least loads now and we see the xine logo again.
* The DVD plugin now loads, but audio and spu info is lost.
diff --git a/src/input/input_file.c b/src/input/input_file.c
index 24d22f4ec..91661f675 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.53 2002/09/04 23:31:08 guenter Exp $
+ * $Id: input_file.c,v 1.54 2002/09/05 20:19:49 guenter Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -98,7 +98,7 @@ typedef struct {
config_values_t *config;
int mrls_allocated_entries;
- mrl_t **mrls;
+ xine_mrl_t **mrls;
} file_input_plugin_t;
@@ -190,7 +190,7 @@ static int strverscmp(const char *s1, const char *s2) {
/*
* Wrapper to strverscmp() for qsort() calls, which sort mrl_t type array.
*/
-static int _sortfiles_default(const mrl_t *s1, const mrl_t *s2) {
+static int _sortfiles_default(const xine_mrl_t *s1, const xine_mrl_t *s2) {
return(strverscmp(s1->mrl, s2->mrl));
}
@@ -427,12 +427,12 @@ static int is_a_dir(char *filepathname) {
/*
*
*/
-static mrl_t **file_plugin_get_dir (input_plugin_t *this_gen,
+static xine_mrl_t **file_plugin_get_dir (input_plugin_t *this_gen,
char *filename, int *nFiles) {
file_input_plugin_t *this = (file_input_plugin_t *) this_gen;
struct dirent *pdirent;
DIR *pdir;
- mrl_t *hide_files, *dir_files, *norm_files;
+ xine_mrl_t *hide_files, *dir_files, *norm_files;
char current_dir[XINE_PATH_MAX + 1];
char current_dir_slashed[XINE_PATH_MAX + 1];
char fullfilename[XINE_PATH_MAX + XINE_NAME_MAX + 1];
@@ -486,9 +486,9 @@ static mrl_t **file_plugin_get_dir (input_plugin_t *this_gen,
return NULL;
}
- dir_files = (mrl_t *) xine_xmalloc(sizeof(mrl_t) * MAXFILES);
- hide_files = (mrl_t *) xine_xmalloc(sizeof(mrl_t) * MAXFILES);
- norm_files = (mrl_t *) xine_xmalloc(sizeof(mrl_t) * MAXFILES);
+ dir_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
+ hide_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
+ norm_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
while((pdirent = readdir(pdir)) != NULL) {
@@ -631,13 +631,13 @@ static mrl_t **file_plugin_get_dir (input_plugin_t *this_gen,
* Sort arrays
*/
if(num_dir_files)
- qsort(dir_files, num_dir_files, sizeof(mrl_t), func);
+ qsort(dir_files, num_dir_files, sizeof(xine_mrl_t), func);
if(num_hide_files)
- qsort(hide_files, num_hide_files, sizeof(mrl_t), func);
+ qsort(hide_files, num_hide_files, sizeof(xine_mrl_t), func);
if(num_norm_files)
- qsort(norm_files, num_norm_files, sizeof(mrl_t), func);
+ qsort(norm_files, num_norm_files, sizeof(xine_mrl_t), func);
/*
* Add directories entries
@@ -646,11 +646,11 @@ static mrl_t **file_plugin_get_dir (input_plugin_t *this_gen,
if(num_files >= this->mrls_allocated_entries) {
++this->mrls_allocated_entries;
- this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(mrl_t*));
- this->mrls[num_files] = (mrl_t *) xine_xmalloc(sizeof(mrl_t));
+ this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*));
+ this->mrls[num_files] = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t));
}
else
- memset(this->mrls[num_files], 0, sizeof(mrl_t));
+ memset(this->mrls[num_files], 0, sizeof(xine_mrl_t));
MRL_DUPLICATE(&dir_files[i], this->mrls[num_files]);
@@ -664,11 +664,11 @@ static mrl_t **file_plugin_get_dir (input_plugin_t *this_gen,
if(num_files >= this->mrls_allocated_entries) {
++this->mrls_allocated_entries;
- this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(mrl_t*));
- this->mrls[num_files] = (mrl_t *) xine_xmalloc(sizeof(mrl_t));
+ this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*));
+ this->mrls[num_files] = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t));
}
else
- memset(this->mrls[num_files], 0, sizeof(mrl_t));
+ memset(this->mrls[num_files], 0, sizeof(xine_mrl_t));
MRL_DUPLICATE(&hide_files[i], this->mrls[num_files]);
@@ -682,11 +682,11 @@ static mrl_t **file_plugin_get_dir (input_plugin_t *this_gen,
if(num_files >= this->mrls_allocated_entries) {
++this->mrls_allocated_entries;
- this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(mrl_t*));
- this->mrls[num_files] = (mrl_t *) xine_xmalloc(sizeof(mrl_t));
+ this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*));
+ this->mrls[num_files] = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t));
}
else
- memset(this->mrls[num_files], 0, sizeof(mrl_t));
+ memset(this->mrls[num_files], 0, sizeof(xine_mrl_t));
MRL_DUPLICATE(&norm_files[i], this->mrls[num_files]);
@@ -882,7 +882,7 @@ void *init_input_plugin (xine_t *xine, void *data) {
this->mrl = NULL;
this->config = config;
- this->mrls = (mrl_t **) xine_xmalloc(sizeof(mrl_t*));
+ this->mrls = (xine_mrl_t **) xine_xmalloc(sizeof(xine_mrl_t*));
this->mrls_allocated_entries = 0;
{
diff --git a/src/input/input_plugin.h b/src/input/input_plugin.h
index 902752447..428ee4e71 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.27 2002/07/17 21:23:57 f1rmb Exp $
+ * $Id: input_plugin.h,v 1.28 2002/09/05 20:19:49 guenter Exp $
*/
#ifndef HAVE_INPUT_PLUGIN_H
@@ -130,20 +130,12 @@ extern "C" {
assert((d) != NULL); \
\
while((s) != NULL) { \
- d[i] = (mrl_t *) malloc(sizeof(mrl_t)); \
+ d[i] = (xine_mrl_t *) malloc(sizeof(xine_mrl_t)); \
MRL_DUPLICATE(s[i], d[i]); \
i++; \
} \
}
-typedef struct {
- char *origin; /* Origin of grabbed mrls (eg: path for file plugin */
- char *mrl; /* <type>://<location> */
- char *link; /* name of link, if exist, otherwise NULL */
- uint32_t type; /* match to mrl_type enum */
- off_t size; /* size of this source, may be 0 */
-} mrl_t;
-
typedef struct input_plugin_s input_plugin_t;
struct input_plugin_s
@@ -212,7 +204,7 @@ struct input_plugin_s
* ls function
* return value: NULL => filename is a file, **char=> filename is a dir
*/
- mrl_t** (*get_dir) (input_plugin_t *this, char *filename, int *nFiles);
+ xine_mrl_t** (*get_dir) (input_plugin_t *this, char *filename, int *nFiles);
/*
diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c
index 61d368835..68138e49d 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.47 2002/09/04 23:31:08 guenter Exp $
+ * $Id: input_vcd.c,v 1.48 2002/09/05 20:19:49 guenter Exp $
*
*/
@@ -128,7 +128,7 @@ typedef struct {
char *filelist[100];
int mrls_allocated_entries;
- mrl_t **mrls;
+ xine_mrl_t **mrls;
#if defined(__sun)
int controller_type;
@@ -973,7 +973,7 @@ static char *vcd_plugin_get_identifier (input_plugin_t *this_gen) {
/*
*
*/
-static mrl_t **vcd_plugin_get_dir (input_plugin_t *this_gen,
+static xine_mrl_t **vcd_plugin_get_dir (input_plugin_t *this_gen,
char *filename, int *nEntries) {
vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen;
@@ -1017,11 +1017,11 @@ static mrl_t **vcd_plugin_get_dir (input_plugin_t *this_gen,
if((i-1) >= this->mrls_allocated_entries) {
++this->mrls_allocated_entries;
/* note: 1 extra pointer for terminating NULL */
- this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(mrl_t*));
- this->mrls[(i-1)] = (mrl_t *) xine_xmalloc(sizeof(mrl_t));
+ this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*));
+ this->mrls[(i-1)] = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t));
}
else {
- memset(this->mrls[(i-1)], 0, sizeof(mrl_t));
+ memset(this->mrls[(i-1)], 0, sizeof(xine_mrl_t));
}
if(this->mrls[(i-1)]->mrl) {
@@ -1174,7 +1174,7 @@ void *init_input_plugin (xine_t *xine, void *data) {
_("path to your local vcd device file"),
NULL, 10, device_change_cb, (void *)this);
- this->mrls = (mrl_t **) xine_xmalloc(sizeof(mrl_t*));
+ this->mrls = (xine_mrl_t **) xine_xmalloc(sizeof(xine_mrl_t*));
this->mrls_allocated_entries = 0;
this->fd = -1;
diff --git a/src/libxvid/xine_decoder.c b/src/libxvid/xine_decoder.c
index aa203282d..2237798ab 100644
--- a/src/libxvid/xine_decoder.c
+++ b/src/libxvid/xine_decoder.c
@@ -210,18 +210,10 @@ static void xvid_dispose (video_decoder_t *this_gen) {
free (this_gen);
}
-video_decoder_t *init_video_decoder_plugin (int iface_version, xine_t *xine) {
+void *init_video_decoder_plugin (xine_t *xine, void *data) {
xvid_decoder_t *this;
XVID_INIT_PARAM xinit;
- if (iface_version != 10) {
- printf (_("xvid: plugin doesn't support plugin API version %d.\n"
- "xvid: this means there's a version mismatch between xine and this\n"
- "xvid: decoder plugin. Installing current plugins should help.\n"),
- iface_version);
- return NULL;
- }
-
xinit.cpu_flags = 0;
xvid_init(NULL, 0, &xinit, NULL);
if (xinit.api_version != API_VERSION) {
diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c
index fe8e822e3..a0c594c07 100644
--- a/src/xine-engine/xine_interface.c
+++ b/src/xine-engine/xine_interface.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: xine_interface.c,v 1.2 2002/09/04 23:31:13 guenter Exp $
+ * $Id: xine_interface.c,v 1.3 2002/09/05 20:19:50 guenter Exp $
*
* convenience/abstraction layer, functions to implement
* libxine's public interface
@@ -238,13 +238,44 @@ xine_cfg_entry_t *xine_config_lookup_entry (xine_t *this, char *key) {
*/
void xine_config_update_entry (xine_t *this, xine_cfg_entry_t *entry){
printf ("xine_interface: xine_config_update_entry: not implemented\n");
- abort();
+
+ switch (entry->type) {
+ case XINE_CONFIG_TYPE_RANGE:
+ case XINE_CONFIG_TYPE_ENUM:
+ case XINE_CONFIG_TYPE_NUM:
+ case XINE_CONFIG_TYPE_BOOL:
+ this->config->update_num (this->config, entry->key, entry->num_value);
+ break;
+
+ case XINE_CONFIG_TYPE_STRING:
+ this->config->update_string (this->config, entry->key, entry->str_value);
+ break;
+
+ default:
+ printf ("xine_interface: error, unknown config entry type %d\n",
+ entry->type);
+ abort();
+ }
}
void xine_reset_config (xine_t *this){
- printf ("xine_interface: xine_reset_config: not implemented\n");
- abort();
+
+ config_values_t *config = this->config;
+ cfg_entry_t *entry;
+
+ config->cur = NULL;
+
+ entry = config->first;
+ while (entry) {
+ cfg_entry_t *next;
+ next = entry->next;
+ free (entry);
+ entry = next;
+ }
+
+ config->first = NULL;
+ config->last = NULL;
}
int xine_gui_send_vo_data (xine_t *this,