1 /* This is public domain code developed by Elgato Systems GmbH. No GPL-covered
\r
2 * changes were added to this file by any members of the VideoLAN team. If you
\r
3 * want to do so, add a modified GPL header here, but keep a message emphasising
\r
4 * the non-licensed parts of this header file.
\r
5 * Ideally, VideoLAN-related changes should only go to eyetvplugin.h.
\r
15 The EyeTV Plugin API
\r
16 ====================
\r
18 The EyeTV Software gives third parties access to the incoming MPEG-2 transport stream.
\r
19 At this time the API is available for the following products:
\r
21 - EyeTV 200 (analog)
\r
22 - EyeTV 300 (DVB-S)
\r
25 A plugin receives device plugged/unplugged notifications, it can request or release
\r
26 individual PIDs and most importantly it has access to transport stream packets in
\r
27 real time, as they arrive from the device. Note that the plugin is called before EyeTV
\r
28 itself looks at the packets, so it is even possible to modify the data.
\r
30 Plugins currently live in EyeTV.app/Contens/Plugins/
\r
32 A plugin is packaged as a bundle with a single entry point:
\r
34 long EyeTVPluginDispatcher(EyeTVPluginSelector selector,
\r
36 EyeTVPluginDeviceID deviceID,
\r
46 EyeTV employs both hardware and software PID filtering. A plugin's dispatch routine
\r
47 is called with the kEyeTVPluginSelector_PacketsArrived selector after the hardware
\r
48 PID filter (naturally) but prior to the software PID filter, so the plugin has access
\r
49 to all packets that are delivered by the hardware.
\r
51 A plugin can request PIDs that are not needed by EyeTV from the hardware PID filter by
\r
52 means of a callback routine, see eyeTVPluginSelector_SetCallback.
\r
54 Note that hardware PID filtering is on for single processor machines (to reduce the CPU
\r
55 load), but off for multi-processor machines (to improve channel switch times).
\r
56 This behaviour is controlled by the "hardware PID filter" key in com.elgato.eyetv.plist,
\r
57 which defaults to "Auto" ("Off" on MP machines, "On" on single-processor machines). EyeTV
\r
58 does not offer GUI to change this setting. A plugin hence needs to be prepared to handle
\r
59 both an entire transponder or multiplex and to request PIDs it might need.
\r
61 Note that the plugin is called on the real-time thread that receives the transport stream
\r
62 packets and that the packet buffers passed to the plugin are the actual hardware DMA buffers.
\r
63 Please return as quickly as possible from the kEyeTVPluginSelector_PacketsArrived call and
\r
64 avoid blocking the calling thread.
\r
72 02/27/2004: Initial Release.
\r
78 #define EYETV_PLUGIN_API_VERSION 0x04021901
\r
79 #define EYETV_PLUGIN_API_MIN_VERSION 0x04021901
\r
81 typedef long long EyeTVPluginDeviceID;
\r
82 typedef long EyeTVPluginDeviceType;
\r
83 typedef long EyeTVPluginSelector;
\r
86 kEyeTVPIDType_Video = 0,
\r
87 kEyeTVPIDType_MPEGAudio = 1,
\r
88 kEyeTVPIDType_VBI = 2, /* teletext */
\r
89 kEyeTVPIDType_PCR = 3,
\r
90 kEyeTVPIDType_PMT = 4,
\r
91 kEyeTVPIDType_Unknown = 5,
\r
92 kEyeTVPIDType_AC3Audio = 6
\r
96 typedef struct EyeTVPluginPIDInfo EyeTVPluginPIDInfo;
\r
97 struct EyeTVPluginPIDInfo {
\r
104 /***********************************************************************************
\r
106 * EyeTVPluginCallbackParams,
\r
108 ***********************************************************************************/
\r
110 kEyeTVPluginCallbackSelector_RetainPIDs = 0,
\r
111 kEyeTVPluginCallbackSelector_ReleasePIDs = 1
\r
114 typedef struct EyeTVPluginCallbackParams EyeTVPluginCallbackParams;
\r
115 struct EyeTVPluginCallbackParams {
\r
116 EyeTVPluginDeviceID deviceID; // the deviceID
\r
117 long selector; // callback selector, see above
\r
118 long *pids; // list of pids to release/retain
\r
119 long pidsCount; // count of pids
\r
123 /***********************************************************************************
\r
125 * typedef for the callback function,
\r
127 ***********************************************************************************/
\r
128 typedef long(* EyeTVPluginCallbackProc)(EyeTVPluginCallbackParams *params);
\r
132 /***********************************************************************************
\r
134 * EyeTVPluginParamStructs
\r
136 ***********************************************************************************/
\r
139 typedef struct EyeTVPluginInitializeParams EyeTVPluginInitializeParams;
\r
140 struct EyeTVPluginInitializeParams {
\r
141 long apiVersion; // version of the EyeTV_PLUGIN_API
\r
142 EyeTVPluginCallbackProc callback; // the callback
\r
147 typedef struct EyeTVPluginGetInfoParams EyeTVPluginGetInfoParams;
\r
148 struct EyeTVPluginGetInfoParams {
\r
149 long *pluginAPIVersion; // <- EYETV_PLUGIN_API_VERSION
\r
150 char *pluginName; // <- points to a 128-byte buffer, the plugin is expected to fill the buffer with
\r
151 // a UTF-8 encoded string.
\r
152 char *description; // <- points to a 1024-byte buffer, the plugin is expected to fill the buffer with
\r
153 // a UTF-8 encoded string describing the plugin.
\r
159 kEyeTVPluginDeviceType_Unknown = 0,
\r
160 kEyeTVPluginDeviceType_e200 = 1,
\r
161 kEyeTVPluginDeviceType_e300 = 2,
\r
162 kEyeTVPluginDeviceType_e400 = 3
\r
165 typedef struct EyeTVPluginDeviceAddedParams EyeTVPluginDeviceAddedParams;
\r
166 struct EyeTVPluginDeviceAddedParams {
\r
167 EyeTVPluginDeviceType deviceType;
\r
171 typedef struct EyeTVPluginPacketsArrivedParams EyeTVPluginPacketsArrivedParams;
\r
172 struct EyeTVPluginPacketsArrivedParams {
\r
173 long **packets; // points to an array of packets
\r
179 typedef struct EyeTVPluginServiceChangedParams EyeTVPluginServiceChangedParams;
\r
180 struct EyeTVPluginServiceChangedParams {
\r
181 long headendID; // new headend ID. For E300 it's the orbital position of the satellite
\r
182 // in tenth of a degree
\r
183 long transponderID; // new transponder ID (The Frequency in kHz)
\r
184 long serviceID; // new service ID (the ID of the used service as included in the DVB Stream)
\r
185 EyeTVPluginPIDInfo *pidList; // points to the list of active PIDs;
\r
186 long pidCount; // the length of pidList
\r
192 /***********************************************************************************
\r
194 * EyeTVPluginParams
\r
196 ***********************************************************************************/
\r
197 typedef struct EyeTVPluginParams EyeTVPluginParams;
\r
198 struct EyeTVPluginParams {
\r
199 EyeTVPluginDeviceID deviceID; // ID of the device
\r
200 EyeTVPluginSelector selector; // selector
\r
201 void *refCon; // refCon
\r
204 EyeTVPluginInitializeParams initialize; // kEyeTVPluginSelector_Initialize
\r
205 // kEyeTVPluginSelector_Terminate, no additional parameters
\r
206 EyeTVPluginGetInfoParams info; // kEyeTVPluginSelector_GetInfo
\r
207 EyeTVPluginDeviceAddedParams deviceAdded; // kEyeTVPluginSelector_DeviceAdded
\r
208 // kEyeTVPluginSelector_DeviceRemoved, no additional parameters
\r
209 EyeTVPluginPacketsArrivedParams packetsArrived; // kEyeTVPluginSelector_PacketsArrived
\r
210 EyeTVPluginServiceChangedParams serviceChanged; // kEyeTVPluginSelector_ServiceChanged
\r
216 enum { // EyeTVPluginSelector
\r
217 kEyeTVPluginSelector_Initialize = 0,
\r
218 kEyeTVPluginSelector_Terminate = 1,
\r
219 kEyeTVPluginSelector_GetInfo = 2,
\r
220 kEyeTVPluginSelector_DeviceAdded = 3,
\r
221 kEyeTVPluginSelector_DeviceRemoved = 4,
\r
222 kEyeTVPluginSelector_PacketsArrived = 5,
\r
223 kEyeTVPluginSelector_ServiceChanged = 6
\r
228 /***********************************************************************************
\r
230 * EyeTVPluginEntryProc
\r
232 ***********************************************************************************/
\r
233 typedef long(* EyeTVPluginEntryProc)(EyeTVPluginParams *params);
\r