00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _PLUGIN_H
00024 #define _PLUGIN_H
00025
00026
00027 #ifndef _DVBPSI_DVBPSI_H_
00028 #include <dvbpsi/dvbpsi.h>
00029 #endif
00030 #ifndef _DVBPSI_DESCRIPTOR_H_
00031 #include <dvbpsi/descriptor.h>
00032 #endif
00033 #ifndef _DVBPSI_PSI_H_
00034 #include <dvbpsi/psi.h>
00035 #endif
00036 #ifndef _DVBPSI_PAT_H_
00037 #include <dvbpsi/pat.h>
00038 #endif
00039 #ifndef _DVBPSI_PMT_H_
00040 #include <dvbpsi/pmt.h>
00041 #endif
00042 #ifndef _DVBPSI_DEMUX_H_
00043 #include <dvbpsi/demux.h>
00044 #endif
00045 #ifndef _DVBPSI_SDT_H_
00046 #include <dvbpsi/sdt.h>
00047 #endif
00048 #include "dvbpsi/datetime.h"
00049 #include "dvbpsi/nit.h"
00050 #include "dvbpsi/tdttot.h"
00051 #include "dvbpsi/atsc/mgt.h"
00052 #include "dvbpsi/atsc/stt.h"
00053 #include "dvbpsi/atsc/vct.h"
00054
00055 #include "config.h"
00056 #include "types.h"
00057 #include "ts.h"
00058 #include "commands.h"
00067 #define PLUGIN_FEATURE_TYPE_NONE 0x00
00068
00071 #define PLUGIN_FEATURE_TYPE_FILTER 0x01
00072
00075 #define PLUGIN_FEATURE_TYPE_PATPROCESSOR 0x02
00076
00079 #define PLUGIN_FEATURE_TYPE_PMTPROCESSOR 0x03
00080
00083 #define PLUGIN_FEATURE_TYPE_DELIVERYMETHOD 0x04
00084
00087 #define PLUGIN_FEATURE_TYPE_CHANNELCHANGED 0x05
00088
00091 #define PLUGIN_FEATURE_TYPE_SDTPROCESSOR 0x06
00092
00095 #define PLUGIN_FEATURE_TYPE_NITPROCESSOR 0x07
00096
00099 #define PLUGIN_FEATURE_TYPE_TDTPROCESSOR 0x08
00100
00103 #define PLUGIN_FEATURE_TYPE_SECTIONPROCESSOR 0x09
00104
00107 #define PLUGIN_FEATURE_TYPE_PESPROCESSOR 0x0A
00108
00111 #define PLUGIN_FEATURE_TYPE_MGTPROCESSOR 0x0B
00112
00115 #define PLUGIN_FEATURE_TYPE_STTPROCESSOR 0x0C
00116
00119 #define PLUGIN_FEATURE_TYPE_VCTPROCESSOR 0x0D
00120
00123 #define PLUGIN_FEATURE_TYPE_INSTALL 0xFF
00124
00128 typedef struct PluginFeature_t
00129 {
00130 int type;
00131 void *details;
00132 }PluginFeature_t;
00133
00137 #define PLUGIN_FOR_DVB 0x01
00138
00141 #define PLUGIN_FOR_ATSC 0x02
00142
00145 #define PLUGIN_FOR_ALL 0xff
00146
00172 typedef struct Plugin_t
00173 {
00174 unsigned int requiredVersion;
00175 unsigned int pluginFor;
00176 char *name;
00177 char *version;
00178 char *description;
00179 char *author;
00180 Command_t *commands;
00181 PluginFeature_t *features;
00182 }Plugin_t;
00183
00187 #define PLUGIN_INTERFACE_C(_for, _name, _version, _desc, _author) \
00188 Plugin_t PluginInterface = { DVBSTREAMER_VERSION, _for, _name, _version, _desc, _author, PluginCommands, NULL}
00189
00193 #define PLUGIN_INTERFACE_F(_for, _name, _version, _desc, _author) \
00194 Plugin_t PluginInterface = { DVBSTREAMER_VERSION, _for, _name, _version, _desc, _author, NULL, PluginFeatures}
00195
00200 #define PLUGIN_INTERFACE_CF(_for, _name, _version, _desc, _author) \
00201 Plugin_t PluginInterface = { DVBSTREAMER_VERSION, _for, _name, _version, _desc, _author, PluginCommands, PluginFeatures}
00202
00212 #define PLUGIN_COMMANDS(_commands...) \
00213 static Command_t PluginCommands[] = {\
00214 _commands,\
00215 {NULL, FALSE, 0, 0, NULL, NULL, NULL}\
00216 }
00217
00230 #define PLUGIN_FEATURES(_features...) \
00231 static PluginFeature_t PluginFeatures[] = {\
00232 _features,\
00233 {PLUGIN_FEATURE_TYPE_NONE, NULL}\
00234 }
00235
00240 #define PLUGIN_FEATURE_FILTER(_filter) {PLUGIN_FEATURE_TYPE_FILTER, (void*)&_filter}
00241
00245 #define PLUGIN_FEATURE_PATPROCESSOR(_processor) {PLUGIN_FEATURE_TYPE_PATPROCESSOR, (void*)_processor}
00246
00250 #define PLUGIN_FEATURE_PMTPROCESSOR(_processor) {PLUGIN_FEATURE_TYPE_PMTPROCESSOR, (void*)_processor}
00251
00255 #define PLUGIN_FEATURE_DELIVERYMETHOD(_method) {PLUGIN_FEATURE_TYPE_DELIVERYMETHOD, (void*)&_method}
00256
00261 #define PLUGIN_FEATURE_CHANNELCHANGED(_cchanged) {PLUGIN_FEATURE_TYPE_CHANNELCHANGED, (void*)_cchanged}
00262
00267 #define PLUGIN_FEATURE_SDTPROCESSOR(_processor) {PLUGIN_FEATURE_TYPE_SDTPROCESSOR, (void*)_processor}
00268
00272 #define PLUGIN_FEATURE_NITPROCESSOR(_processor) {PLUGIN_FEATURE_TYPE_NITPROCESSOR, (void*)_processor}
00273
00277 #define PLUGIN_FEATURE_TDTPROCESSOR(_processor) {PLUGIN_FEATURE_TYPE_TDTPROCESSOR, (void*)_processor}
00278
00283 #define PLUGIN_FEATURE_SECTIONPROCESSOR(_details) {PLUGIN_FEATURE_TYPE_SECTIONPROCESSOR, (void*)_details}
00284
00290 #define PLUGIN_FEATURE_PESPROCESSOR(_details) {PLUGIN_FEATURE_TYPE_PESPROCESSOR, (void*)_details}
00291
00295 #define PLUGIN_FEATURE_MGTPROCESSOR(_processor) {PLUGIN_FEATURE_TYPE_MGTPROCESSOR, (void*)_processor}
00296
00301 #define PLUGIN_FEATURE_STTPROCESSOR(_processor) {PLUGIN_FEATURE_TYPE_STTPROCESSOR, (void*)_processor}
00302
00307 #define PLUGIN_FEATURE_VCTPROCESSOR(_processor) {PLUGIN_FEATURE_TYPE_VCTPROCESSOR, (void*)_processor}
00308
00313 #define PLUGIN_FEATURE_INSTALL(_callback) {PLUGIN_FEATURE_TYPE_INSTALL, (void*)_callback}
00314
00321 typedef struct PluginFilter_t
00322 {
00323 PIDFilter_t *filter;
00324 void (*InitFilter)(PIDFilter_t* filter);
00325 void (*DeinitFilter)(PIDFilter_t* filter);
00326 }PluginFilter_t;
00327
00328
00334 typedef void (*PluginPATProcessor_t)(dvbpsi_pat_t* newpat);
00335
00341 typedef void (*PluginPMTProcessor_t)(dvbpsi_pmt_t* newpmt);
00342
00348 typedef void (*PluginSDTProcessor_t)(dvbpsi_sdt_t* newsdt);
00349
00355 typedef void (*PluginNITProcessor_t)(dvbpsi_nit_t* newnit);
00356
00362 typedef void (*PluginTDTProcessor_t)(dvbpsi_tdt_tot_t* newtdttot);
00363
00369 typedef void (*PluginMGTProcessor_t)(dvbpsi_atsc_mgt_t* newmgt);
00370
00376 typedef void (*PluginSTTProcessor_t)(dvbpsi_atsc_stt_t* newstt);
00377
00383 typedef void (*PluginVCTProcessor_t)(dvbpsi_atsc_vct_t* newvct);
00384
00389 typedef void (*PluginSectionProcessor_t)(void *userarg, dvbpsi_psi_section_t* newsection);
00390
00395 typedef struct PluginSectionProcessorDetails_t
00396 {
00397 uint16_t pid;
00398 PluginSectionProcessor_t processor;
00399 void *userarg;
00400 }PluginSectionProcessorDetails_t;
00401
00406 typedef void (*PluginPESProcessor_t)(void *userarg, uint8_t *packet, uint16_t length);
00407
00412 typedef struct PluginPESProcessorDetails_t
00413 {
00414 uint16_t pid;
00415 PluginPESProcessor_t processor;
00416 void *userarg;
00417 }PluginPESProcessorDetails_t;
00418
00426 typedef void (*PluginChannelChanged_t)(Multiplex_t *newMultiplex, Service_t *newService);
00427
00432 typedef void (*PluginInstallCallback_t)(bool installed);
00433
00435 #endif