File: PluginInterface.txt

package info (click to toggle)
dvbstreamer 2.1.0-5.8
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 5,676 kB
  • sloc: ansic: 42,193; sh: 10,230; python: 519; makefile: 363
file content (103 lines) | stat: -rw-r--r-- 2,996 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
DVBStreamer - Plugins Ideas

Load all plugins found in a certain directory.

Plugin can add commands.
Plugin can add Processors/Filters.
Plugin can add output methods.

struct Plugin_t
{
	unsigned int RequiredVersion;
	char *name;        /* Name of the plugin */
	char *version;     /* String describing the version of the plugin */
	char *description; /* Description of the plugin */
	char *author;      /* Author/Contact address for bugs */
	Command_t *commands; /* NULL terminated array of commands or NULL for no commands */
	PluginFeature_t *features; /* A PLUGIN_FEATURE_NONE terminated list of features or NULL for no features. */
}

struct Command_t
{
    char *command;
    bool  tokenise;
    int   minargs;
    int   maxargs;
    char *shorthelp;
    char *longhelp;
    void (*commandfunc)(int argc, char **argv);
}


PLUGIN_FEATURE_TYPE_NONE           0x00
PLUGIN_FEATURE_TYPE_FILTER         0x01
PLUGIN_FEATURE_TYPE_PATPROCESSOR   0x02
PLUGIN_FEATURE_TYPE_PMTPROCESSOR   0x03
PLUGIN_FEATURE_TYPE_DELIVERYMETHOD 0x04
PLUGIN_FEATURE_TYPE_CHANNELCHANGE  0x05

struct PluginFeature_t
{
	int type;
	void *details;
}

type = PLUGIN_FEATURE_TYPE_FILTER
details = An instance of the following structure:
struct FilterHandler_t
{
	void (*InitFilter)(PIDFilter_t* filter);
	void (*DeInitFilter)(PIDFilter_t* filter);
}

type = PLUGIN_FEATURE_TYPE_PATPROCESSOR
details = A function pointer to a function with the following prototype:
void PluginPATProcessor(dvbpsi_pat_t* newpat);

type = PLUGIN_FEATURE_TYPE_PMTPROCESSOR
details =  A function pointer to a function with the following prototype:
void PluginPMTProcessor(dvbpsi_pmt_t* newpmt);

type = PLUGIN_FEATURE_TYPE_DELIVERYMETHOD
details = An instance of the following structure
struct DeliveryMethodHandler_t
{
	void (*CanHandle)(char *mrl);
	DeliveryMethodInstance_t* (*CreateInstance)(char *mrl);

}

mrl's will be in the form <delivery method>://<url>[,<options>]
For example udp could be (ppd == Packets Per Datagram)
udp://localhost:1234,tos=25,ppd=7

Implementors should consider the following structure as the 'base class' and
should extend it with the state they require for the output method.

struct DeliveryMethodInstance_t
{
	void (*SendPacket)(DeliveryMethodInstance *this, TSPacket_t packet);
	void (*DestroyInstance)(DeliveryMethodInstance_t *this);
}


For example:

struct UDPOutputDeliveryMethodInstance_t
{
	void (*SendPacket)(DeliveryMethodInstance_t *this, TSPacket_t packet);
	void (*DestroyInstance)(DeliveryMethodInstance_t *this);
	int tos;
	int packetsPerDatagram;
	Socket socketFD;
	int packetCount;
	char *buffer;
}

type = PLUGIN_FEATURE_TYPE_CHANNELCHANGE
details = A function pointer to a function with the following prototype:
void PluginChannelChanged(Multiplex_t *newMultiplex, Service_t *newService);

PluginChannelChanged function pointer will be called every time the primary service
filter is updated. newMultiplex will contain the current multiplex and newService
will contain the currentService.