xine-lib  1.2.9
xine_plugin.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2000-2009 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  * generic plugin definitions
21  */
22 
23 #ifndef XINE_PLUGIN_H
24 #define XINE_PLUGIN_H
25 
26 #include <xine/attributes.h>
27 
28 #define PLUGIN_NONE 0
29 #define PLUGIN_INPUT 1
30 #define PLUGIN_DEMUX 2
31 #define PLUGIN_AUDIO_DECODER 3
32 #define PLUGIN_VIDEO_DECODER 4
33 #define PLUGIN_SPU_DECODER 5
34 #define PLUGIN_AUDIO_OUT 6
35 #define PLUGIN_VIDEO_OUT 7
36 #define PLUGIN_POST 8
37 
38 #define PLUGIN_TYPE_MAX PLUGIN_POST
39 
40 /* this flag may be or'ed with type in order to force preloading the plugin.
41  * very useful to register config items on xine initialization.
42  */
43 #define PLUGIN_MUST_PRELOAD (1 << 7)
44 
45 /* this flag may be or'ed with type to prevent the plugin loader from unloading
46  * the plugin
47  */
48 #define PLUGIN_NO_UNLOAD (1 << 6)
49 
50 #define PLUGIN_TYPE_MASK ((1 << 6) - 1)
51 
52 typedef struct {
53  uint8_t type; /* one of the PLUGIN_* constants above */
54  uint8_t API; /* API version supported by this plugin */
55  const char *id; /* a name that identifies this plugin */
56  uint32_t version; /* version number, increased every release */
57  const void *special_info; /* plugin-type specific, see structs below */
58  void *(*init)(xine_t *, void *); /* init the plugin class */
60 
61 
62 /* special_info for a video output plugin */
63 typedef struct {
64  int priority; /* priority of this plugin for auto-probing */
65  int visual_type; /* visual type supported by this plugin */
66 } vo_info_t;
67 
68 /* special info for a audio output plugin */
69 typedef struct {
70  int priority;
71 } ao_info_t;
72 
73 /* special_info for a decoder plugin */
74 typedef struct {
75  const uint32_t *supported_types; /* streamtypes this decoder can handle */
76  int priority;
78 
79 /* special info for a post plugin */
80 typedef struct {
81  uint32_t type; /* type of the post plugin, use one of XINE_POST_TYPE_* */
82 } post_info_t;
83 
84 /* special info for a demuxer plugin */
85 typedef struct {
86  int priority;
88 
89 /* special info for an input plugin */
90 typedef struct {
91  int priority;
92 } input_info_t;
93 
94 
95 /* register a list of statically linked plugins
96  * info is a list of plugin_info_t terminated by PLUGIN_NONE
97  * example:
98  * plugin_info_t acme_plugin_info[] = {
99  * { PLUGIN_VIDEO_OUT, 21, "acme", XINE_VERSION_CODE, &vo_info_acme,
100  * init_class_acme },
101  * { PLUGIN_NONE, 0, "", 0, NULL, NULL }
102  * };
103  *
104  */
106 
107 #endif
uint32_t type
Definition: xine_plugin.h:81
const void * special_info
Definition: xine_plugin.h:57
int priority
Definition: xine_plugin.h:70
uint8_t API
Definition: xine_plugin.h:54
Definition: xine_plugin.h:80
int priority
Definition: xine_plugin.h:76
uint32_t version
Definition: xine_plugin.h:56
int priority
Definition: xine_plugin.h:64
Definition: xine_plugin.h:69
int priority
Definition: xine_plugin.h:91
const char * id
Definition: xine_plugin.h:55
const uint32_t * supported_types
Definition: xine_plugin.h:75
Definition: xine_plugin.h:63
void xine_register_plugins(xine_t *self, plugin_info_t *info)
Definition: load_plugins.c:620
int priority
Definition: xine_plugin.h:86
Definition: xine_plugin.h:74
#define XINE_PROTECTED
Definition: attributes.h:73
Definition: xine_internal.h:81
Definition: xine_plugin.h:52
Definition: xine_plugin.h:85
uint8_t type
Definition: xine_plugin.h:53
int visual_type
Definition: xine_plugin.h:65
Definition: xine_plugin.h:90