diff options
-rw-r--r-- | include/xine.h.in | 44 | ||||
-rw-r--r-- | src/post/goom/xine_goom.c | 6 | ||||
-rw-r--r-- | src/post/planar/invert.c | 6 | ||||
-rw-r--r-- | src/xine-engine/load_plugins.c | 51 | ||||
-rw-r--r-- | src/xine-engine/plugin_catalog.h | 4 | ||||
-rw-r--r-- | src/xine-engine/post.h | 4 | ||||
-rw-r--r-- | src/xine-engine/xine_plugin.h | 7 |
7 files changed, 103 insertions, 19 deletions
diff --git a/include/xine.h.in b/include/xine.h.in index 0f2897622..448403019 100644 --- a/include/xine.h.in +++ b/include/xine.h.in @@ -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.h.in,v 1.49 2002/12/27 03:40:07 miguelfreitas Exp $ + * $Id: xine.h.in,v 1.50 2002/12/29 14:04:43 mroi Exp $ * * public xine-lib (libxine) interface and documentation * @@ -316,6 +316,11 @@ struct xine_post_s { */ xine_video_port_t **video_input; + /* the type of the post plugin + * one of XINE_POST_TYPE_* can be used here + */ + int type; + }; @@ -338,6 +343,9 @@ xine_post_t *xine_post_init(xine_t *xine, const char *name, /* get a list of all available post plugins */ const char *const *xine_list_post_plugins(xine_t *xine); +/* get a list of all post plugins of one type */ +const char *const *xine_list_post_plugins_typed(xine_t *xine, int type); + /* * post plugin input/output * @@ -408,19 +416,32 @@ const xine_post_out_t *xine_post_output(xine_post_t *self, char *name); */ int xine_post_wire(xine_post_out_t *source, xine_post_in_t *target); + /* - * wire a video port to an output + * wire a video port to a video output + * This can be used to rewire different post plugins to the video output + * plugin layer. The ports you hand in at xine_post_init() will already + * be wired with the post plugin, so you need this function for + * _re_connecting only. + * * returns 1 on success, 0 on failure */ int xine_post_wire_video_port(xine_post_out_t *source, xine_video_port_t *vo); /* - * wire an audio port to an output + * wire an audio port to an audio output + * This can be used to rewire different post plugins to the audio output + * plugin layer. The ports you hand in at xine_post_init() will already + * be wired with the post plugin, so you need this function for + * _re_connecting only. + * * returns 1 on success, 0 on failure */ int xine_post_wire_audio_port(xine_post_out_t *source, xine_audio_port_t *vo); - +/* + * Extracts an output for a stream. Use this to rewire the outputs of streams. + */ xine_post_out_t * xine_get_video_source(xine_stream_t *stream); xine_post_out_t * xine_get_audio_source(xine_stream_t *stream); @@ -433,29 +454,36 @@ xine_post_out_t * xine_get_audio_source(xine_stream_t *stream); void xine_post_dispose(xine_t *xine, xine_post_t *self); +/* post plugin types */ +#define XINE_POST_TYPE_VIDEO_FILTER 0x010000 +#define XINE_POST_TYPE_VIDEO_VISUALIZATION 0x010001 +#define XINE_POST_TYPE_AUDIO_FILTER 0x020000 +#define XINE_POST_TYPE_AUDIO_VISUALIZATION 0x020001 + + /* post plugin data types */ /* video port data * input->data is a xine_video_port_t* - * output->data is a xine_video_port_t** + * output->data usually is a xine_video_port_t** */ #define XINE_POST_DATA_VIDEO 0 /* audio port data * input->data is a xine_audio_port_t* - * output->data is a xine_audio_port_t** + * output->data usually is a xine_audio_port_t** */ #define XINE_POST_DATA_AUDIO 1 /* integer data * input->data is a int* - * output->data is a int* + * output->data usually is a int* */ #define XINE_POST_DATA_INT 3 /* double precision floating point data * input->data is a double* - * output->data is a double* + * output->data usually is a double* */ #define XINE_POST_DATA_DOUBLE 4 diff --git a/src/post/goom/xine_goom.c b/src/post/goom/xine_goom.c index 59ebfede5..7c31ec502 100644 --- a/src/post/goom/xine_goom.c +++ b/src/post/goom/xine_goom.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_goom.c,v 1.4 2002/12/27 23:25:16 tmattern Exp $ + * $Id: xine_goom.c,v 1.5 2002/12/29 14:04:43 mroi Exp $ * * GOOM post plugin. * @@ -70,9 +70,11 @@ static void *goom_init_plugin(xine_t *xine, void *); /* plugin catalog information */ +post_info_t goom_special_info = { XINE_POST_TYPE_AUDIO_VISUALIZATION }; + plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_POST, 1, "goom", XINE_VERSION_CODE, NULL, &goom_init_plugin }, + { PLUGIN_POST, 2, "goom", XINE_VERSION_CODE, &goom_special_info, &goom_init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/post/planar/invert.c b/src/post/planar/invert.c index 8d24a6389..47bb197a6 100644 --- a/src/post/planar/invert.c +++ b/src/post/planar/invert.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: invert.c,v 1.5 2002/12/25 15:05:06 mroi Exp $ + * $Id: invert.c,v 1.6 2002/12/29 14:04:43 mroi Exp $ */ /* @@ -33,9 +33,11 @@ static void *invert_init_plugin(xine_t *xine, void *); /* plugin catalog information */ +post_info_t invert_special_info = { XINE_POST_TYPE_VIDEO_FILTER }; + plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_POST, 1, "invert", XINE_VERSION_CODE, NULL, &invert_init_plugin }, + { PLUGIN_POST, 2, "invert", XINE_VERSION_CODE, &invert_special_info, &invert_init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index ecbb4bb3d..3a4550f67 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.126 2002/12/27 16:47:11 miguelfreitas Exp $ + * $Id: load_plugins.c,v 1.127 2002/12/29 14:04:43 mroi Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -154,6 +154,7 @@ static void _insert_plugin (xine_t *this, vo_info_t *vo_new, *vo_old; ao_info_t *ao_new, *ao_old; decoder_info_t *decoder_new, *decoder_old; + post_info_t *post_new, *post_old; uint32_t *types; int priority = 0; int i; @@ -215,6 +216,12 @@ static void _insert_plugin (xine_t *this, entry->info->special_info = decoder_new; break; + + case PLUGIN_POST: + post_old = info->special_info; + post_new = xine_xmalloc(sizeof(post_info_t)); + post_new->type = post_old->type; + entry->info->special_info = post_new; } xine_list_append_priority_content (list, entry, priority); @@ -497,6 +504,7 @@ static void save_plugin_list(FILE *fp, xine_list_t *plugins) { decoder_info_t *decoder_info; vo_info_t *vo_info; ao_info_t *ao_info; + post_info_t *post_info; int i; @@ -536,6 +544,11 @@ static void save_plugin_list(FILE *fp, xine_list_t *plugins) { fprintf(fp, "\n"); fprintf(fp, "decoder_priority=%d\n", decoder_info->priority ); break; + + case PLUGIN_POST: + post_info = node->info->special_info; + fprintf(fp, "post_type=%d\n", post_info->type); + break; } fprintf(fp, "\n"); @@ -552,6 +565,7 @@ static void load_plugin_list(FILE *fp, xine_list_t *plugins) { decoder_info_t *decoder_info = NULL; vo_info_t *vo_info = NULL; ao_info_t *ao_info = NULL; + post_info_t *post_info = NULL; int i; unsigned long long llu; unsigned long lu; @@ -580,6 +594,7 @@ static void load_plugin_list(FILE *fp, xine_list_t *plugins) { decoder_info = NULL; vo_info = NULL; ao_info = NULL; + post_info = NULL; } if ((value = strchr (line, '='))) { @@ -624,6 +639,11 @@ static void load_plugin_list(FILE *fp, xine_list_t *plugins) { decoder_info = node->info->special_info = xine_xmalloc(sizeof(decoder_info_t)); break; + + case PLUGIN_POST: + post_info = node->info->special_info = + xine_xmalloc(sizeof(post_info_t)); + break; } } else if( !strcmp("api",line) ) { @@ -657,7 +677,10 @@ static void load_plugin_list(FILE *fp, xine_list_t *plugins) { } else if( !strcmp("decoder_priority",line) && decoder_info ) { sscanf(value," %d",&i); decoder_info->priority = i; - } + } else if( !strcmp("post_type",line) && post_info ) { + sscanf(value," %d",&i); + post_info->type = i; + } } } } @@ -701,6 +724,7 @@ static void save_catalog (xine_t *this) { save_plugin_list (fp, this->plugin_catalog->video); save_plugin_list (fp, this->plugin_catalog->aout); save_plugin_list (fp, this->plugin_catalog->vout); + save_plugin_list (fp, this->plugin_catalog->post); fclose(fp); } free(cachefile); @@ -1680,6 +1704,26 @@ const char *const *xine_list_post_plugins(xine_t *xine) { return catalog->ids; } +const char *const *xine_list_post_plugins_typed(xine_t *xine, int type) { + plugin_catalog_t *catalog = xine->plugin_catalog; + plugin_node_t *node; + int i; + + pthread_mutex_lock (&catalog->lock); + + i = 0; + node = xine_list_first_content (catalog->post); + while (node) { + if (((post_info_t *)node->info->special_info)->type == type) + catalog->ids[i++] = node->info->id; + node = xine_list_next_content (catalog->post); + } + catalog->ids[i] = NULL; + + pthread_mutex_unlock (&catalog->lock); + return catalog->ids; +} + xine_post_t *xine_post_init(xine_t *xine, const char *name, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { @@ -1746,6 +1790,9 @@ xine_post_t *xine_post_init(xine_t *xine, const char *name, int inputs, } post->output_ids[i] = NULL; + /* copy the post plugin type to the public part */ + post->xine_post.type = ((post_info_t *)node->info->special_info)->type; + return &post->xine_post; } else { printf("load_plugins: post plugin %s failed to instantiate itself\n", name); diff --git a/src/xine-engine/plugin_catalog.h b/src/xine-engine/plugin_catalog.h index f30c72140..033b817b5 100644 --- a/src/xine-engine/plugin_catalog.h +++ b/src/xine-engine/plugin_catalog.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: plugin_catalog.h,v 1.9 2002/12/13 21:31:38 guenter Exp $ + * $Id: plugin_catalog.h,v 1.10 2002/12/29 14:04:43 mroi Exp $ * * xine-internal header: Definitions for plugin lists * @@ -35,7 +35,7 @@ /* the engine takes this many plugins for one stream type */ #define PLUGINS_PER_TYPE 10 -#define CACHE_CATALOG_VERSION 0 +#define CACHE_CATALOG_VERSION 1 #define CACHE_CATALOG_FILE ".xine/catalog.cache" #define CACHE_CATALOG_DIR ".xine" diff --git a/src/xine-engine/post.h b/src/xine-engine/post.h index d50b1d575..b919bf2d0 100644 --- a/src/xine-engine/post.h +++ b/src/xine-engine/post.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: post.h,v 1.4 2002/12/25 15:03:20 mroi Exp $ + * $Id: post.h,v 1.5 2002/12/29 14:04:43 mroi Exp $ * * post plugin definitions * @@ -31,7 +31,7 @@ #include "audio_out.h" #include "xineutils.h" -#define POST_PLUGIN_IFACE_VERSION 1 +#define POST_PLUGIN_IFACE_VERSION 2 typedef struct post_class_s post_class_t; diff --git a/src/xine-engine/xine_plugin.h b/src/xine-engine/xine_plugin.h index 7e905bbc5..fa07f7d5c 100644 --- a/src/xine-engine/xine_plugin.h +++ b/src/xine-engine/xine_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: xine_plugin.h,v 1.7 2002/12/01 15:10:04 mroi Exp $ + * $Id: xine_plugin.h,v 1.8 2002/12/29 14:04:43 mroi Exp $ * * generic plugin definitions * @@ -64,4 +64,9 @@ typedef struct { int priority; } decoder_info_t; +/* special info for a post plugin */ +typedef struct { + uint32_t type; /* type of the post plugin, use one of XINE_POST_TYPE_* */ +} post_info_t; + #endif |