1 /*
2  * Copyright (C) 2000-2018 the xine project
3  *
4  * This file is part of xine, a free video player.
5  *
6  * xine is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * xine is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19  *
20  * xine-internal header: Definitions for plugin lists
21  */
22 
23 #ifndef _PLUGIN_CATALOG_H
24 #define _PLUGIN_CATALOG_H
25 
26 #include <xine/xine_plugin.h>
27 #include <xine/xineutils.h>
28 
29 #define DECODER_MAX 128
30 #define PLUGIN_MAX  256
31 
32 /* the engine takes this many plugins for one stream type */
33 #define PLUGINS_PER_TYPE 10
34 
35 typedef struct {
36   char            *filename;
37   off_t            filesize;
38   time_t           filemtime;
39   void            *lib_handle;
40   int              ref;          /* count number of classes */
41   int              no_unload;    /* set if the file can't be unloaded */
42 } plugin_file_t ;
43 
44 typedef struct plugin_node_s {
45   plugin_file_t   *file;
46   plugin_info_t   *info;
47   void            *plugin_class;
48   xine_list_t     *config_entry_list;
49   int              ref;          /* count intances of plugins */
50   int              priority;
51 } plugin_node_t ;
52 
53 struct plugin_catalog_s {
54   xine_sarray_t   *plugin_lists[PLUGIN_TYPE_MAX];
55 
56   xine_sarray_t   *cache_list;
57   xine_list_t     *file_list;
58 
59   plugin_node_t   *audio_decoder_map[DECODER_MAX][PLUGINS_PER_TYPE];
60   plugin_node_t   *video_decoder_map[DECODER_MAX][PLUGINS_PER_TYPE];
61   plugin_node_t   *spu_decoder_map[DECODER_MAX][PLUGINS_PER_TYPE];
62 
63   const char      *ids[PLUGIN_MAX];
64 
65   /* memory block for the decoder priority config entry descriptions */
66   char            *prio_desc[DECODER_MAX];
67 
68   pthread_mutex_t  lock;  /* recursive mutex */
69 
70   int              plugin_count;
71   int              decoder_count;
72 
73   xine_sarray_t   *modules_list;
74 };
75 typedef struct plugin_catalog_s plugin_catalog_t;
76 
77 #endif
78