summaryrefslogtreecommitdiff
path: root/src/xine-engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/xine-engine')
-rw-r--r--src/xine-engine/audio_decoder.c4
-rw-r--r--src/xine-engine/audio_out.h32
-rw-r--r--src/xine-engine/load_plugins.c97
-rw-r--r--src/xine-engine/metronom.h3
-rw-r--r--src/xine-engine/video_decoder.c5
-rw-r--r--src/xine-engine/xine_internal.h18
6 files changed, 129 insertions, 30 deletions
diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c
index 691e68c3b..015560844 100644
--- a/src/xine-engine/audio_decoder.c
+++ b/src/xine-engine/audio_decoder.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: audio_decoder.c,v 1.4 2001/04/24 15:47:32 guenter Exp $
+ * $Id: audio_decoder.c,v 1.5 2001/04/27 10:42:38 f1rmb Exp $
*
*
* functions that implement audio decoding
@@ -76,7 +76,7 @@ void *audio_decoder_loop (void *this_gen) {
}
- decoder->decode_data (decoder, buf);
+ decoder->decode_data (this->metronom, decoder, buf);
}
break;
diff --git a/src/xine-engine/audio_out.h b/src/xine-engine/audio_out.h
index 5688645b2..9b332e72d 100644
--- a/src/xine-engine/audio_out.h
+++ b/src/xine-engine/audio_out.h
@@ -17,13 +17,21 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_out.h,v 1.1 2001/04/24 20:53:00 f1rmb Exp $
+ * $Id: audio_out.h,v 1.2 2001/04/27 10:42:38 f1rmb Exp $
*/
#ifndef HAVE_AUDIO_OUT_H
#define HAVE_AUDIO_OUT_H
#include <inttypes.h>
+#if defined(XINE_COMPILE)
+#include "metronom.h"
+#include "configfile.h"
+#endif
+
+
+#define AUDIO_OUT_PLUGIN_IFACE_VERSION 1
+
/*
* audio output modes Used as Bitfield in AC3 decoder
*/
@@ -38,6 +46,12 @@ typedef struct ao_functions_s
{
/*
+ * plugin interface version, lower versions _may_ be supported
+ */
+
+ int interface_version;
+
+ /*
* find out if desired output mode is supported by
* this driver
*/
@@ -49,14 +63,15 @@ typedef struct ao_functions_s
* return value: <=0 : failure, 1 : ok
*/
- int (*open)(uint32_t bits, uint32_t rate, int mode);
+ int (*open)(metronom_t *metronom, uint32_t bits, uint32_t rate, int mode);
/*
* write audio data to output buffer - may block
* audio driver must sync sample playback with metronom
*/
- void (*write_audio_data)(int16_t* audio_data, uint32_t num_samples,
+ void (*write_audio_data)(metronom_t *metronom,
+ int16_t* audio_data, uint32_t num_samples,
uint32_t pts);
/*
@@ -65,6 +80,12 @@ typedef struct ao_functions_s
void (*close)(void);
+ /*
+ * return human readable identifier for this plugin
+ */
+
+ char* (*get_identifier) (void);
+
} ao_functions_t;
/*
@@ -89,9 +110,10 @@ typedef struct ao_functions_s
* find right device driver, init it
*/
-ao_functions_t *ao_init(char *driver_name) ;
+//ao_functions_t *ao_init(char *driver_name) ;
+
+ao_functions_t *init_audio_out_plugin(int iface, config_values_t *cfg);
char *ao_get_available_drivers ();
#endif
-
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index 64d662b4d..53b7500da 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.8 2001/04/26 21:40:17 f1rmb Exp $
+ * $Id: load_plugins.c,v 1.9 2001/04/27 10:42:38 f1rmb Exp $
*
*
* Load input/demux/audio_out/video_out/codec plugins
@@ -345,7 +345,7 @@ void load_audio_out_plugins (xine_t *this,
}
-vo_driver_t *load_video_output_plugin(config_values_t *config,
+vo_driver_t *xine_load_video_output_plugin(config_values_t *config,
char *filename, char *id,
int visual_type, void *visual) {
DIR *dir;
@@ -372,6 +372,7 @@ vo_driver_t *load_video_output_plugin(config_values_t *config,
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'))) {
@@ -386,7 +387,7 @@ vo_driver_t *load_video_output_plugin(config_values_t *config,
exit(1);
}
else {
- void *(*initplug) (int, config_values_t *, int, void *);
+ void *(*initplug) (int, config_values_t *, void *, int);
if((initplug = dlsym(plugin, "init_video_out_plugin")) != NULL) {
@@ -408,7 +409,7 @@ vo_driver_t *load_video_output_plugin(config_values_t *config,
exit(1);
}
else {
- void *(*initplug) (int, config_values_t *, int, void *);
+ void *(*initplug) (int, config_values_t *, void *, int);
if((initplug = dlsym(plugin, "init_video_out_plugin")) != NULL) {
@@ -435,20 +436,92 @@ char **enum_video_output_plugins(int visual_type) {
return NULL;
}
-ao_functions_t *load_audio_output_plugin(char *filename, char *id) {
-
- if(filename == NULL && id == NULL)
+ao_functions_t *xine_load_audio_output_plugin(config_values_t *config,
+ char *filename, char *id) {
+ DIR *dir;
+ ao_functions_t *aod;
+
+ if(filename == NULL && id == NULL) {
+ printf("%s(%s@%d): parameter(s) should be non null.\n",
+ __FILE__, __FUNCTION__, __LINE__);
return NULL;
-
- // Not implemented
-
+ }
+
+ dir = opendir (XINE_PLUGINDIR);
+
+ if (dir) {
+ struct dirent *pEntry;
+
+ while ((pEntry = readdir (dir)) != NULL) {
+ char str[1024];
+ void *plugin;
+
+ int nLen = strlen (pEntry->d_name);
+
+ if ((strncasecmp(pEntry->d_name,
+ XINE_AUDIO_OUT_PLUGIN_PREFIXNAME,
+ XINE_AUDIO_OUT_PLUGIN_PREFIXNAME_LENGTH) == 0) &&
+ ((pEntry->d_name[nLen-3]=='.')
+ && (pEntry->d_name[nLen-2]=='s')
+ && (pEntry->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))) {
+
+ 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;
+ }
+ }
+ }
+ }
+ 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 *);
+
+ 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;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
return NULL;
}
+
char **enum_audio_output_plugins(int output_type) {
// Not implemented
return NULL;
}
-
-
diff --git a/src/xine-engine/metronom.h b/src/xine-engine/metronom.h
index a16b9ef20..2ac1354cd 100644
--- a/src/xine-engine/metronom.h
+++ b/src/xine-engine/metronom.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: metronom.h,v 1.1 2001/04/18 22:36:07 f1rmb Exp $
+ * $Id: metronom.h,v 1.2 2001/04/27 10:42:38 f1rmb Exp $
*
* metronom: general pts => virtual calculation/assoc
*
@@ -176,4 +176,3 @@ struct metronom_s {
metronom_t *metronom_init ();
#endif
-
diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c
index 76a1807aa..98b84e0ee 100644
--- a/src/xine-engine/video_decoder.c
+++ b/src/xine-engine/video_decoder.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_decoder.c,v 1.7 2001/04/24 15:47:32 guenter Exp $
+ * $Id: video_decoder.c,v 1.8 2001/04/27 10:42:38 f1rmb Exp $
*
*/
@@ -69,7 +69,8 @@ void *video_decoder_loop (void *this_gen) {
}
- decoder->decode_data (this->cur_video_decoder_plugin, buf);
+ decoder->decode_data (this->metronom,
+ this->cur_video_decoder_plugin, buf);
}
break;
diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h
index 17b17a108..0a5497757 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.11 2001/04/26 11:31:36 f1rmb Exp $
+ * $Id: xine_internal.h,v 1.12 2001/04/27 10:42:38 f1rmb Exp $
*
*/
@@ -36,7 +36,6 @@
#define DECODER_PLUGIN_MAX 50
#define CODEC_PLUGIN_IFACE_VERSION 1
#define CODEC_PLUGIN_MAX 50
-#define AUDIO_OUT_PLUGIN_IFACE_VERSION 1
#define AUDIO_OUT_PLUGIN_MAX 50
#define VIDEO_OUT_PLUGIN_MAX 50
#define VIDEO_DECODER_PLUGIN_MAX 50
@@ -61,7 +60,8 @@ struct video_decoder_s {
void (*init) (video_decoder_t *this, vo_instance_t *video_out);
- void (*decode_data) (video_decoder_t *this, buf_element_t *buf);
+ void (*decode_data) (metronom_t *metronom,
+ video_decoder_t *this, buf_element_t *buf);
void (*release_img_buffers) (video_decoder_t *this);
@@ -85,7 +85,8 @@ struct audio_decoder_s {
void (*init) (audio_decoder_t *this, ao_functions_t *audio_out);
- void (*decode_data) (audio_decoder_t *this, buf_element_t *buf);
+ void (*decode_data) (metronom_t *metronom,
+ audio_decoder_t *this, buf_element_t *buf);
void (*close) (audio_decoder_t *this);
@@ -346,12 +347,15 @@ void load_decoder_plugins (xine_t *this,
#define VIDEO_OUTPUT_TYPE_PROBE 1
#define VIDEO_OUTPUT_TYPE_X11 2
#define VIDEO_OUTPUT_TYPE_FB 3
-vo_driver_t *load_video_output_plugin(config_values_t *config,
- char *filename, char *id,
- int visual_type, void *visual);
+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
+