source: titan/titan/struct.h @ 40678

Last change on this file since 40678 was 40678, checked in by gost, 7 years ago

[titan] mipsel/arm ca extension

File size: 44.4 KB
Line 
1/*****************************************************/
2/* this file is part of the tiTan / tiTanNIT Project */
3/* and allowed only for use with this.               */
4/*                                                   */
5/* copyright by NIT                                  */
6/*****************************************************/
7
8#ifndef STRUCT_H
9#define STRUCT_H
10
11#define _GNU_SOURCE
12
13#ifdef SIMULATE
14#include <mcheck.h>
15#endif
16
17#include <stdio.h>
18#include <stdlib.h>
19#include <stdint.h>
20#include <string.h>
21#include <libgen.h>
22#include <fcntl.h>
23#include <ctype.h>
24#include <linux/fb.h>
25#include <sys/ioctl.h>
26#include <sys/mman.h>
27#include <png.h>
28#include <jpeglib.h>
29#include <libintl.h>
30#include <locale.h>
31#include <math.h>
32#include <linux/input.h>
33#include <sys/wait.h>
34#include <time.h>
35#include <dirent.h>
36#include <fnmatch.h>
37#include <dlfcn.h>
38#include <pthread.h>
39#include <linux/dvb/frontend.h>
40#include <linux/dvb/dmx.h>
41#include <linux/dvb/audio.h>
42#include <linux/dvb/video.h>
43#include <sys/vfs.h>
44#include <inttypes.h>
45#include <sys/socket.h>
46#include <sys/un.h>
47#include <unistd.h>
48#include <zlib.h>
49#include <net/if.h>
50#include <netinet/in.h>
51#include <arpa/inet.h>
52#include <netdb.h>
53#include <errno.h>
54#include <linux/dvb/version.h>
55#include <setjmp.h>
56#include <sys/mount.h>
57#include <execinfo.h>
58#include <ifaddrs.h>
59#include <linux/dvb/ca.h>
60#include <poll.h>
61#include <sys/utsname.h>
62#include <regex.h>
63#include <mntent.h>
64#include <termios.h>
65//#ifndef SH4
66#include <sys/stat.h>
67//#endif
68#include <openssl/aes.h>
69#include <openssl/dh.h>
70#include <openssl/rsa.h>
71#include <openssl/sha.h>
72#include <stdio.h>
73#include <unistd.h>
74#include <fcntl.h>
75#include <sys/ioctl.h>
76#include <stdint.h>
77#include <inttypes.h>
78#include <arpa/inet.h>
79#include <time.h>
80#include <linux/dvb/ca.h>
81#include <sys/types.h>
82
83#include <fcntl.h>
84#include <stdint.h>
85#include <stdio.h>
86#include <stdlib.h>
87#include <string.h>
88#include <sys/types.h>
89#include <sys/stat.h>
90#include <unistd.h>
91#include <time.h>
92
93#include <openssl/pem.h>
94#include <openssl/x509.h>
95#include <openssl/x509v3.h>
96#include <openssl/sha.h>
97#include <openssl/aes.h>
98
99//for freetype
100#include <ft2build.h>
101#include FT_FREETYPE_H
102#include FT_CACHE_H
103
104//for eplayer
105#ifdef EPLAYER3
106#include <common.h>
107//#ifndef BETA
108//#include <subtitle.h>
109//#endif
110#endif
111
112#ifdef EPLAYER4
113#include <gst/gst.h>
114#include <gst/pbutils/missing-plugins.h>
115#endif
116
117#ifdef DVDPLAYER
118#include <ddvdlib.h>
119#endif
120
121#define DRIVER " -   - "
122#define OVERSION "1.86"
123#define PROGNAME "titan"
124#define COPYRIGHT "NIT"
125#define CRONTRIBUT "obi, gost"
126#define PLUGINVERSION 1
127
128#define _(x) gettext(x)
129#define MINMALLOC 4096
130#define SCROLLBARWIDTH 15
131#define SCROLLBARBORDERSIZE 1
132#define FONTPOSYOFFSET -3
133#define FB "fb0"
134#define FB1 "fb1"
135#define SKINFB "skinfb"
136#define ACCELFB "accelfb"
137#define CONFIGFILE PROGNAME".cfg"
138#define KILLPROG "killall -9 "PROGNAME
139#define REBOOT "init 6"
140#define FILELISTDELMARK 255
141#define PLUGINDELMARK 254
142#define MAXDVBADAPTER 1
143//#ifndef MIPSEL
144#define MAXFRONTENDDEV 4
145//#else
146//#define MAXFRONTENDDEV 2
147//#endif
148#define MAXDEMUXDEVOPEN 10
149#define MAXAUDIODEV 4
150#define MAXVIDEODEV 4
151#define MAXCIDEV 4
152#define MAXCADEV 4
153#ifndef MIPSEL
154#define MAXDVRDEV 4
155#define MAXDEMUXDEV 4
156#else
157#define MAXDVRDEV 5
158#define MAXDEMUXDEV 5
159#define MAXENCODERDEV 2
160#define DVB_API_VERSION 5
161#endif   
162#define MAXSCDEV 2
163#define RCTIMEOUT 999999
164#define RCTHREADSTANDBY 999998
165#define MAXSERVICETYPE 10
166#define CHANNELCACHEMAX 1000
167#define MEDIADBCACHEMAX 1000
168#define TRANSPONDERCACHEMAX 500
169#define MAXHTTPDCONN 20
170#define MAXHTMLLINE 300
171#define MAXRGUIDCONN 1
172#define LISTHASHSIZE 27
173#define MAXCASESSION 16
174#define MAXCASERVICE 20
175#define MAXLONGKEY 10
176#define MAXSAT 64
177#define MAXBGDOWNLOAD 10
178#ifdef MIPSEL
179#define EPGSCANLOG "/mnt/logs/epgscan.log"
180#else
181#define EPGSCANLOG "/tmp/epgscan.log"
182#endif
183#define MAXCHANNELHISTORY 6
184#define HILO(x) (x##_hi << 8 | x##_lo)
185#define HILO32(x) (x##_hi << 24 | x##_mh << 16 | x##_ml << 8 | x##_lo)
186#define SERIALDEV "/dev/ttyAS0"
187#define MAXTOKENS 256
188#define MAXSTACKTRACE 30
189#define MAXSTACKTRACEFUNC 20
190
191#define USBDEVICE_SUPER_MAGIC 0x9fa2
192#define EXT2_SUPER_MAGIC 0xEF53
193#define EXT3_SUPER_MAGIC 0xEF53
194#define SMB_SUPER_MAGIC 0x517B
195#define NFS_SUPER_MAGIC 0x6969
196#define MSDOS_SUPER_MAGIC 0x4d44
197
198#ifndef VIDEO_SOURCE_HDMI
199#define VIDEO_SOURCE_HDMI 2
200#endif
201#ifndef AUDIO_SOURCE_HDMI
202#define AUDIO_SOURCE_HDMI 2
203#endif
204
205//cacc cert check
206#define ROOT_CERT     "/mnt/swapextensions/etc/pem/root.pem"
207#define CUSTOMER_CERT "/mnt/swapextensions/etc/pem/customer.pem"
208#define DEVICE_CERT   "/mnt/swapextensions/etc/pem/device.pem"
209#define MAX_ELEMENTS    33
210#ifdef MIPSEL
211#define CA_SET_DESCR_DATA_DREAM _IOW('o', 137, struct ca_descr_data)
212#define CA_SET_DESCR_DATA _IOW('o', 10, struct ca_descr_data)
213#endif
214#ifdef SH4NEW
215#define CA_SET_DESCR_DATA _IOW('o', 137, struct ca_descr_data)
216#endif
217
218//Start Function Entry Point
219#define STARTFUNC
220
221//CA Defines
222#define T_SB 0x80               //sb (h<--m)
223#define T_RCV 0x81              //receive (h-->m)
224#define T_CREATE_T_C 0x82       //create transport connection (h-->m)
225#define T_C_T_C_REPLY 0x83      //ctc reply (h<--m)
226#define T_DELETE_T_C 0x84       //delete tc (h<->m)
227#define T_D_T_C_REPLY 0x85      //dtc reply (h<->m)
228#define T_REQUEST_T_C 0x86      //request transport connection (h<--m)
229#define T_NEW_T_C 0x87          //new tc - reply to t_request (h-->m)
230#define T_T_C_ERROR 0x77        //error creating tc (h-->m)
231#define T_DATA_LAST 0xA0        //convey data from higher (h<->m)
232#define T_DATA_MORE 0xA1        //convey data from higher (h<->m)
233
234//Alarm Signal used as timeout
235#define ALARMTIMEOUT 1
236#define ALARMSTARTTIME(x) if(ALARMTIMEOUT == 1) {alarm(x);}
237#define ALARMSTOPTIME if(ALARMTIMEOUT == 1) {alarm(0);}
238
239// VFD icons supported (more or less) on all boxes:
240typedef enum { VFD_USB = 0x10, VFD_HD, VFD_HDD, VFD_LOCK, VFD_BT, VFD_MP3, VFD_MUSIC, VFD_DD, VFD_MAIL, VFD_MUTE, VFD_PLAY, VFD_PAUSE, VFD_FF, VFD_FR, VFD_REC, VFD_CLOCK } vfdicons;
241
242#define OMIN(a,b) (a < b ? a : b)
243#define OMAX(a,b) (a > b ? a : b)
244
245#define bcdtoint(i) ((((i & 0xf0) >> 4) * 10) + (i & 0x0f))
246
247#define alpha_composite(composite, fg, alpha, ralpha, bg) { (composite) = ((fg)*(alpha) + (bg)*(ralpha)) >> 8; }
248
249enum {LEFT=20000, CENTER, RIGHT, TEXTCENTER, TEXTRIGHT};
250enum {TOP=20000, MIDDLE, BOTTOM, TEXTMIDDLE, TEXTBOTTOM};
251enum {BOTTOMLEFT, BOTTOMRIGHT, TOPLEFT, TOPRIGHT};
252enum {LEFTRIGHT=1, TOPBOTTOM, LEFTMIDDLE, TOPMIDDLE};
253enum {NO, YES, AUTONO, AUTOYES};
254enum {UNDEF=0, LISTBOX=1, TEXTBOX=2, CHOICEBOX=4, INPUTBOX=8, INPUTBOXNUM=16, FILELIST=32, PROGRESSBAR=64, MENU=128, MULTIPROGRESSBAR=256, GRID=512, GRIDBR=1024, PASSWORD=2048};
255enum {FRONTENDDEV, DEMUXDEV, VIDEODEV, AUDIODEV, CADEV, CIDEV, FRONTENDDEVDUMMY, DVRDEV, SCDEV, ENCODERDEV};
256enum {TV, RADIO};
257enum {RECDIRECT, RECTIMER, RECTIMESHIFT, RECSTREAM, RECPLAY, RECSTREAMENC};
258#ifdef DREAMBOX
259enum {MPEGV = 0, MPEG4V = 4, H264 = 1, VC1 = 10, H265 = 22};
260enum {AC3 = 0, MPEGA = 1, DTS = 2, LPCM = 6, AAC = 8, AACHE = 9, DTSHD = 16, DDP = 7};
261#else
262enum {AC3 = 0, MPEGA = 1, DTS = 2, LPCM = 6, AAC = 8, AACHE = 9, DTSHD = 16, DDP = 34};
263enum {MPEGV = 0, MPEG4V = 4, H264 = 1, VC1 = 10, H265 = 7};
264#endif
265enum {ALLCHANNEL, SATCHANNEL, PROVIDERCHANNEL, AZCHANNEL, BOUQUETCHANNEL, SATLIST, PROVIDERLIST, AZLIST, MAINBOUQUETLIST};
266enum {NOMODE, MVMODE, RMMODE, CPMODE, PROTECTMODE, EDITMODE};
267enum {NOTHING, CHANNEL, STILLPIC, RECORDDIRECT, RECORDTIMER, RECORDTIMESHIFT, RECORDSTREAM, TMPOTHER, RECORDPLAY, HDMIIN};
268enum {START, PAUSE, STOP};
269enum {DEACTIVE, ACTIVE, INPAUSE, ERROR};
270enum {FUNCTEXT, FUNCPIC, FUNCPROGRESS,FUNCPICOLED};
271enum {CASESSIONCREATE, CASESSIONBUSY, CASESSIONDEL, CASESSIONSTART, CASESSIONFINAL, CARESFIRSTENQUIRY, CARESCHANGE, CARESENQUIRY, CADATETIMESEND, CAMMIIDLE, CAMMIDISPLAYREPLAY, CAMMIFAKEOK};
272
273#ifdef BETA
274struct stacktrace
275{
276        int pos;
277        pthread_t thread;
278        void* func[MAXSTACKTRACEFUNC];
279};
280struct stacktrace stacktrace[MAXSTACKTRACE];
281#endif
282
283struct lastsubtitle
284{
285        uint64_t transponderid;
286        int serviceid;
287        int16_t subtitlepid;
288        int16_t subtitleid1;
289        int16_t subtitleid2;
290        struct lastsubtitle* next;
291};
292
293struct newsletter
294{
295        unsigned long nr;
296        char* date;
297        char* title;
298        char* text;
299        struct newsletter* next;
300};
301
302struct oldentry
303{
304        void* entry;
305        //0 = epg
306        int type;
307        time_t del;
308        struct oldentry* next;
309};
310
311struct unicable
312{
313        char* manufacturer;
314        char* product;
315        int scr1;
316        int scr2;
317        int scr3;
318        int scr4;
319        int scr5;
320        int scr6;
321        int scr7;
322        int scr8;
323        int lofl;
324        int lofh;
325        struct unicable* next;
326        struct unicable* prev;
327};
328
329struct id3tag
330{
331        int version;
332        char* title;
333        char* artist;
334        char* album;
335        char* year;
336        char* comment;
337        char* genrecode;
338        char* genretext;
339        char* poster;
340        int track;
341        int len;
342        int picturetype;
343        unsigned int picturepos;
344        unsigned int picturelen;
345};
346
347struct id3genre
348{
349        int code;
350        char text[30];
351};
352
353struct regex
354{
355        char* match1;
356        char* match2;
357        char* match3;
358        char* match4;
359        char* match5;
360        char* match6;
361        char* match7;
362        char* match8;
363        char* match9;
364        char* match10;
365};
366
367struct imdb
368{
369        char* title;
370        char* year;
371        char* rated;
372        char* released;
373        char* genre;
374        char* director;
375        char* writer;
376        char* actors;
377        char* plot;
378        char* poster;
379        char* runtime;
380        char* rating;
381        char* votes;
382        char* id;
383        char* thumb;
384};
385
386struct imdbapi
387{
388        char* title;
389        char* year;
390        char* rated;
391        char* released;
392        char* genre;
393        char* director;
394        char* writer;
395        char* actors;
396        char* plot;
397        char* poster;
398        char* runtime;
399        char* rating;
400        char* votes;
401        char* id;
402};
403
404struct tmdb
405{
406        char* title;
407        char* year;
408        char* rated;
409        char* released;
410        char* genre;
411        char* runtime;
412        char* plot;
413        char* postermid;
414        char* rating;
415        char* votes;
416        char* id;
417        char* backdrop;
418        char* imdbid;
419        char* orgname;
420        char* language;
421        char* type;
422        char* score;
423        char* cover;
424        char* thumb;
425        char* mvi;
426        struct tmdb* prev;
427        struct tmdb* next;
428};
429
430struct mediadbfilter
431{
432        struct mediadb* node;
433        int count;
434        struct mediadbfilter* prev;
435        struct mediadbfilter* next;
436};
437
438struct mediadbcategory
439{
440        int type;
441        char* name;
442        struct mediadbcategory* prev;
443        struct mediadbcategory* next;
444};
445
446struct mediadb
447{
448        char* id;
449        int type;
450        char* title;
451        int year;
452        char* released;
453        char* runtime;
454        char* genre;
455        char* director;
456        char* writer;
457        char* actors;
458        char* plot;
459        char* poster;
460        int rating;
461        int votes;
462        char* path;
463        char* file;
464        char* shortname;
465        char* fileinfo;
466        time_t timestamp;
467        //bit 31: manual change
468        int flag;
469        int backdropcount;
470        struct mediadb* prev;
471        struct mediadb* next;
472};
473
474struct mediadbcache
475{
476        char* path;
477        char* file;
478        struct mediadb* mediadbnode;
479        struct mediadbcache* next;
480};
481
482struct mostzap
483{
484        int serviceid;
485        uint64_t transponderid;
486        int count;
487        struct mostzap* prev;
488        struct mostzap* next;
489};
490
491struct menulist
492{
493        char* name;
494        char* text;
495        char* pic;
496        char* param;
497        char* param1;
498        char* param2;
499        char* param3;
500        int deaktiv;
501        int defaultentry;
502        struct menulist* next;
503};
504
505struct channelhistory
506{
507        struct channel* chnode;
508        char* channellist;
509};
510
511struct queue
512{
513        //0-99 for ca module
514        //101 for thumb thread
515        int type;
516        int flag;
517        int len;
518        void* data;
519        void* data1;
520        struct queue* prev;
521        struct queue* next;
522};
523
524struct casession
525{
526        int inuse;
527        int sessionnr;
528        int action;
529        int state;
530        int mmimanager;
531        int camanager;
532        int datetimemanager;
533        int appmanager;
534        int resmanager;
535        int ccmanager;
536#ifdef MIPSEL
537        int hostmanager;
538        int hostlacmanager;
539        int     upgrademanager;
540#endif
541        char* mmititle;
542        char* mmisubtitle;
543        char* mmitext;
544        char* mmibottom;
545};
546
547struct caslot
548{
549        struct casession casession[MAXCASESSION];
550        int connid;
551        int poll;
552        int status;
553        int rlen;
554        unsigned char* rbuf;
555        char* name;
556        int fastrun;
557        char* caids;
558        // cacc
559        unsigned char lastKey[32];
560        uint8_t lastParity;
561//      unsigned char scrambled;
562        int scrambled;
563        void *private_data;
564        int ccmgr_ready;
565        // not in used currently
566        int inuse;
567        int sidblacklisted;
568};
569
570struct hdd
571{
572        char* device;
573        int partition;
574        unsigned long long size;
575        char* filesystem;
576        char* label;
577        char* uuid;
578        char* vendor;
579        char* model;
580        int removable;
581        int read;
582        int write;
583        int sleeptime;
584        int notchanged;
585        struct hdd* prev;
586        struct hdd* next;
587};
588
589struct scaninfo
590{
591        struct dvbdev* fenode;
592        struct transponder* tpnode;
593        struct skin* scanscreen;
594        struct skin* listbox;
595        int threadend;
596        int scantype;
597        int fetype;
598        int orbitalpos;
599        int timeout;
600        int onlyfree;
601        int networkscan;
602        int clear;
603        int blindscan;
604        char* satname;
605        int tpcount;
606        int tpmax;
607        int tpnew;
608        int tpdel;
609        int tvcount;
610        int newtvcount;
611        int radiocount;
612        int newradiocount;
613        int datacount;
614        int newdatacount;
615        int blindcount;
616        int newblindcount;
617        int changename;
618        int cleartransponder;
619        unsigned int blindmax;
620} scaninfo;
621
622struct screensaver
623{
624        int type;
625        int speed;
626        int newposx;
627        int newposy;
628        int flag;
629        struct skin* screen;
630        struct skin* screennode;
631        struct skin* filelist;
632        struct skin* aktnode;
633        struct pic* pic;
634        char* value;
635        char* path;
636};
637
638struct playlist
639{
640        char* file;
641        struct playlist* prev;
642        struct playlist* next;
643};
644
645struct mainplaylist
646{
647        char* name;
648        char* filename;
649        struct playlist* playlist;
650        struct mainplaylist* prev;
651        struct mainplaylist* next;
652};
653
654struct epgrecord
655{
656        time_t begin;
657        time_t end;
658        int posx;
659        int size;
660        struct epgrecord* prev;
661        struct epgrecord* next;
662};
663
664struct download
665{
666        char* host;
667        char* page;
668        int port;
669        char* filename;
670        char* auth;
671        int connfd;
672        int proz;
673        unsigned int maxkb;
674        unsigned int aktkb;
675        int ret;
676        int timeout;
677        int flag;
678};
679
680struct copyfile
681{
682        char* from;
683        char* to;
684        int proz;
685        int filecount;
686        int maxfilecount;
687        off64_t maxkb;
688        off64_t aktkb;
689        int stop;
690        int ret;
691        int flag;
692};
693
694struct epgscanlist
695{
696        int serviceid;
697        uint64_t transponderid;
698        time_t scantime;
699        struct epgscanlist* prev;
700        struct epgscanlist* next;
701        char* name;
702};
703
704struct rgba
705{
706        char r;
707        char g;
708        char b;
709        char a;
710};
711
712struct subclutentry
713{
714        unsigned char Y, Cr, Cb, T;
715        unsigned char valid;
716};
717
718struct subclut
719{
720        unsigned char clutid;
721        unsigned char clutversionnumber;
722        struct subclutentry entries2bit[4];
723        struct subclutentry entries4bit[16];
724        struct subclutentry entries8bit[256];
725        struct subclut *next;
726};
727
728struct subpagereg
729{
730        int regid;
731        int reghorizontaladdress;
732        int regverticaladdress;
733        int scaleposx, scaleposy;
734        struct subpagereg *next;
735};
736
737struct subregobj
738{
739        int objid;
740        int objtype;
741        int objproviderflag;
742        int objhorizontalpos;
743        int objverticalpos;
744        // not supported right now...
745        int foregroundpixel;
746        int backgroundpixel;
747        struct subregobj *next;
748};
749
750struct subreg
751{
752        int regid;
753        int versionnumber;
754        int height, width;
755        int scaleheight, scalewidth;
756        int depth;
757        unsigned char *buf;
758        struct rgba *palette;
759        int clutid;
760        int committed;
761        struct subregobj *objects;
762        struct subreg *next;
763};
764
765struct subpage
766{
767        int pageid;
768        time_t pagetimeout;
769        int pageversionnumber;
770        int state;
771        int pcssize;
772        struct subpagereg *pageregions;
773        struct subreg *regions;
774        struct subclut *cluts;
775        struct subpage *next;
776};
777
778struct bitstream
779{
780        unsigned char *data;
781        int size;
782        int avail;
783        int consumed;
784};
785
786//there are a copyrectimer function
787//if you change the struct you must change this funktion
788struct rectimer
789{
790        char* name;
791        char* timestamp;
792        time_t begin;
793        time_t end;
794        int repeate;
795        int afterevent;
796        char* pincode;
797        int disabled;
798        int justplay;
799        char* recpath;
800        int servicetype;
801        char* channellist;
802        int serviceid;
803        //0 = nothing
804        //1 = running
805        //2 = end
806        //3 = error
807        //4 = epgscan timer activ
808        //5 = epgscan timer not activ
809        int status;
810        char* errstr;
811        struct service* servicenode;
812        uint64_t transponderid;
813        struct rectimer *prev;
814        struct rectimer *next;
815};
816
817struct inetwork
818{
819        char* device;
820        char* ip;
821        char* netmask;
822        char* mac;
823        char* broadcast;
824        //0 = static
825        //1 = dhcp
826        //2 = off
827        int type;
828        int found;
829        //flag 1 = used in titan
830        int flag;
831        struct inetwork *prev;
832        struct inetwork *next;
833};
834
835struct rcmap
836{
837        char* name;
838        int key;
839        int newkey;
840        struct rcmap* next;
841};
842
843struct splitstr
844{
845        char* part;
846};
847
848struct channelcache
849{
850        int serviceid;
851        uint64_t transponderid;
852        struct channel* chnode;
853        struct channelcache* next;
854};
855
856struct transpondercache
857{
858        uint64_t transponderid;
859        struct transponder* tpnode;
860        struct transpondercache* next;
861};
862
863struct filelist
864{
865        int type;
866        int view;
867        off64_t size;
868        time_t date;
869};
870
871struct skin
872{
873        char* name;
874        unsigned int type;
875        uint8_t wrap;
876        uint8_t bordersize;
877        uint8_t scrollbar;
878        uint16_t halign;
879        uint16_t valign;
880        int16_t posx;
881        int16_t posy;
882        int16_t width;
883        int16_t height;
884        long bordercol;
885        long deaktivcol;
886        long shadowcol;
887        uint8_t shadowsize;
888        uint8_t shadowpos;
889        uint8_t fontsize;
890        uint8_t fontsize2;
891        long fontcol;
892        long fontcol2;
893        char* font;
894        int16_t zorder;
895        int16_t titlealign;
896        char* title;
897        char* text;
898        char* text2;
899        long bgcol;
900        long bgcol2;
901        long titlebgcol;
902        long titlebgcol2;
903        long progresscol;
904        char* selectpic;
905        char* pic;
906        int16_t picwidth;
907        int16_t picheight;
908        uint16_t hspace;
909        uint16_t vspace;
910        char* (*skinfunc)(struct skin*, void*, void*);
911        char* param1;
912        char* param2;
913        char* parent;
914        char* input;
915        char* mask;
916        uint16_t textposx;
917        uint16_t textposx2;
918        int16_t gradient;
919        int16_t titlegradient;
920        uint8_t transparent;
921        uint8_t hidden;
922        uint8_t funcrettype;
923        int8_t charspace;
924        int8_t bordertype;
925        int16_t borderradius;
926        uint16_t bgspace;
927        uint8_t picquality;
928
929        uint8_t titlesize;
930        struct filelist* filelist;
931        struct skin* parentpointer;
932        char* ret;
933        char* choiceboxvalue;
934        unsigned int linecount;
935        unsigned int pagecount;
936        unsigned int poscount;
937        unsigned int gridcol;
938        int aktpage;
939        int aktline;
940        uint8_t scrollbarbordersize;
941        uint8_t prozposx;
942        uint8_t prozposy;
943        uint8_t prozwidth;
944        uint8_t prozheight;
945        uint8_t picprozwidth;
946        uint8_t del;
947        uint8_t picprozheight;
948        int16_t scrollbarheight;
949        int16_t progresssize;
950        int16_t scrollbarwidth;
951        int16_t scrollbarpos;
952        int16_t rposx;
953        int16_t rposy;
954        int16_t rwidth;
955        int16_t rheight;
956        int16_t rpicwidth;
957        int16_t rpicheight;
958        int16_t iposx;
959        int16_t iposy;
960        int16_t iwidth;
961        int16_t iheight;
962        char* handle;
963        char* handle1;
964        struct epgrecord* epgrecord;
965        char* pluginhandle;
966        uint8_t locked;
967        uint8_t picmem;
968        //bit 0: 1 = node is drawed
969        //bit 1: 1 = node is changed
970        uint8_t flag;
971        int hash;
972        struct skin *select;
973        struct skin *child;
974        struct skin *prev;
975        struct skin *next;
976        struct skin *drawnext;
977        // usesavebg=0 disable
978        // usesavebg=1 save always
979        // usesavebg=2 save one times then free
980        // usesavebg=3 dummy for filelist
981        int usesavebg;
982        // savebg is saved date
983        char* savebg;
984        // fuer blinken
985        int nodestyle;
986};
987
988struct style
989{
990        char* name;
991        int16_t posx;
992        int16_t posy;
993        int16_t width;
994        int16_t height;
995        int16_t picwidth;
996        int16_t picheight;
997        uint16_t textposx;
998        uint16_t textposx2;
999        uint16_t halign;
1000        uint16_t valign;
1001        uint16_t hspace;
1002        uint16_t vspace;
1003        uint16_t bgspace;
1004        int16_t borderradius;
1005        int16_t titlealign;
1006        int16_t zorder;
1007        int16_t gradient;
1008        int16_t titlegradient;
1009        uint8_t picquality;
1010        uint8_t hidden;
1011        uint8_t wrap;
1012        uint8_t scrollbar;
1013        uint8_t bordersize;
1014        int8_t bordertype;
1015        uint8_t shadowsize;
1016        uint8_t shadowpos;
1017        uint8_t fontsize;
1018        uint8_t fontsize2;
1019        int8_t charspace;
1020        uint8_t transparent;
1021        uint8_t prozposx;
1022        uint8_t prozposy;
1023        uint8_t prozwidth;
1024        uint8_t prozheight;
1025        uint8_t picprozwidth;
1026        uint8_t picprozheight;
1027        uint8_t funcrettype;
1028        uint8_t picmem;
1029        long bordercol;
1030        long deaktivcol;
1031        long progresscol;
1032        long shadowcol;
1033        long fontcol;
1034        long fontcol2;
1035        long titlebgcol;
1036        long titlebgcol2;
1037        long bgcol;
1038        long bgcol2;
1039        char* font;
1040        char* pic;
1041        char* param1;
1042        char* param2;
1043        char* input;
1044        char* mask;
1045        char* (*skinfunc)(struct skin*, void*, void*);
1046        struct style* next;
1047};
1048
1049struct epg
1050{
1051        int eventid;
1052        int version;
1053        time_t starttime;
1054        time_t endtime;
1055        char* title;
1056        char* subtitle;
1057        char* desc;
1058        int desclen;
1059        int desccomplen;
1060        int parentalrating;
1061        struct epg* prev;
1062        struct epg* next;
1063};
1064
1065struct shutdowntimer
1066{
1067        int active,type; //type: 0=DeepStandby, 1=Standby
1068        long long shutdown_time;
1069};
1070
1071struct dvbdev
1072{
1073        char* dev;
1074        int fd;
1075        uint8_t type;
1076        uint8_t adapter;
1077        uint8_t devnr;
1078        uint8_t felock;
1079        uint8_t deactive;
1080        uint8_t decoder;
1081        struct transponder* felasttransponder;
1082        struct transponder* feakttransponder;
1083        int feunicable;
1084        unsigned int feloffrequency;
1085        int feaktband;
1086        int feaktpolarization;
1087        fe_sec_voltage_t feaktvolt;
1088        fe_sec_tone_mode_t feakttone;
1089        int fedmxsource;
1090        char* feaktnr;
1091        char* feshortname;
1092        char* fehyprid;
1093        struct dvb_frontend_info* feinfo;
1094        struct caslot* caslot;
1095        struct dvbdev *next;
1096};
1097
1098//there are a copytransponder and createtransponder function
1099//if you change this struct you must change the function
1100struct transponder
1101{
1102        uint64_t id;
1103        uint8_t fetype;
1104        uint8_t polarization;
1105        uint8_t modulation;
1106        uint8_t fec;
1107        uint8_t pilot;
1108        uint8_t rolloff;
1109        uint8_t inversion;
1110        uint8_t system;
1111        uint8_t flag;
1112        // 0 = unknown
1113        // 1 = tunable
1114        // 2 = not tunable
1115        uint8_t tunablestatus;
1116        int orbitalpos;
1117        unsigned int frequency;
1118        unsigned int symbolrate;
1119        int encoding;
1120        time_t lastepg;
1121        struct transponder *next;
1122};
1123
1124struct provider
1125{
1126        int providerid;
1127        char* name;
1128        int flag;
1129        struct provider *prev;
1130        struct provider *next;
1131};
1132
1133struct subtitle
1134{
1135        char* name;
1136        int16_t subtype;
1137        int16_t pid;
1138        int16_t type;
1139        int16_t id1;
1140        int16_t id2;
1141        struct subtitle* next;
1142};
1143
1144struct esinfo
1145{
1146        int streamtype;
1147        int pid;
1148        struct esinfo* next;
1149};
1150
1151struct cadesc
1152{
1153        int pid;
1154        int len;
1155        int systemid;
1156        int reserved;
1157        int capid;
1158        char* privat;
1159        struct cadesc* next;
1160};
1161
1162struct pmt
1163{
1164        int programnumber;
1165        int versionnumber;
1166        int currentnextindicator;
1167};
1168
1169struct audiotrack
1170{
1171        char* name;
1172        uint8_t audiocodec;
1173        int16_t audiopid;
1174        int16_t rdspid;
1175        struct audiotrack* next;
1176};
1177
1178struct linkedchannel
1179{
1180        uint64_t transponderid;
1181        int serviceid;
1182        time_t starttime;
1183        time_t endtime;
1184        struct linkedchannel* next;
1185};
1186
1187//there are a createchannel function
1188//if you change this struct you must change the function
1189struct channel
1190{
1191        char* name;
1192        uint64_t transponderid;
1193        int providerid;
1194        int serviceid;
1195        int servicetype;
1196        uint8_t flag;
1197        uint8_t crypt;
1198        int8_t videocodec;
1199        int8_t audiocodec;
1200        int16_t videopid;
1201        int16_t audiopid;
1202        int16_t ac3audiopid;
1203        int16_t txtpid;
1204        int16_t pcrpid;
1205        int16_t pmtpid;
1206        int16_t aitpid;
1207        uint8_t protect;
1208        char* hbbtvurl;
1209        struct transponder *transponder;
1210        struct provider *provider;
1211        struct audiotrack *audiotrack;
1212        struct subtitle *subtitle;
1213        struct linkedchannel *linkedchannel;
1214        struct pmt *pmt;
1215        struct cadesc *cadesc;
1216        struct esinfo *esinfo;
1217        struct epg *epg;
1218        struct channel *prev;
1219        struct channel *next;
1220};
1221
1222struct sat
1223{
1224        char* name;
1225        int orbitalpos;
1226        int flag;
1227        int fetype;
1228        int scan;
1229        struct sat *prev;
1230        struct sat *next;
1231};
1232
1233struct service
1234{
1235        int type;
1236        char* channellist;
1237        struct dvbdev *fedev;
1238        struct dvbdev *dmxaudiodev;
1239        struct dvbdev *dmxvideodev;
1240        struct dvbdev *dmxpcrdev;
1241        struct dvbdev *dmxsubtitledev;
1242        struct dvbdev *audiodev;
1243        struct dvbdev *videodev;
1244        struct dvbdev *encoderdev;
1245        struct transponder *transponder;
1246        struct channel *channel;
1247        unsigned char *pmtbuf;
1248        int pmtlen;
1249        int recdmxstart;
1250        int recdstfd;
1251        int recsrcfd;
1252        time_t recendtime;
1253        char* rectimestamp;
1254        size_t reclastsync;
1255        off64_t rectotal;
1256        int reccount;
1257        int tssize;
1258        char* recname;
1259        unsigned long long lenpts;
1260        unsigned long long startpts;
1261        unsigned long long endpts;
1262        unsigned long long bitrate;
1263        off64_t endoffile;
1264        struct service *next;
1265};
1266
1267struct caservice
1268{
1269        struct service* service;
1270        struct channel* channel;
1271        int count;
1272        int camsockfd;
1273        struct caslot* caslot;
1274        int camanager;
1275        char* capmt;
1276        int capmtlen;
1277        int cmdpos;
1278};
1279
1280struct stimerthread
1281{
1282        int delay;
1283        int count;
1284        int notfirst;
1285        pthread_attr_t attr;
1286        pthread_t thread;
1287        int status;
1288        int aktion;
1289        //bit 0: 1 = stop allwas on titan end
1290        int flag;
1291        void* param1;
1292        void* param2;
1293        void* (*func)(struct stimerthread*, void*, void*);
1294        struct stimerthread* next;
1295};
1296
1297struct hddparm
1298{
1299        char* device;
1300        int read;
1301        int write;
1302        int sleeptime;
1303        int notchanged;
1304};
1305
1306struct marker
1307{
1308        off64_t pos;
1309        off64_t time;
1310        char* timetext;
1311        struct marker* prev;
1312        struct marker* next;
1313};
1314
1315struct status
1316{
1317        int longkeycode[MAXLONGKEY];
1318        //aktivate extra featers
1319        int expertmodus;
1320        //http user:passwd
1321        char* httpauth;
1322        //set to 1 if channellist or channelnr open
1323        int channelswitch;
1324        //deaktivates child protect if greater then akttime
1325        time_t protecttime;
1326        char* boxtype;
1327        char* realboxtype;
1328        pthread_t mainthread;
1329        //videosize from stream
1330        video_size_t videosize;
1331        time_t videosizevalid;
1332        //radius for rounded border
1333        int borderradius;
1334        int picbordersize;
1335        int titlelinesize;
1336        //0 border
1337        //1 fullbar
1338        int listboxselecttype;
1339        //0 camd.socket
1340        //1 pmt.tmp
1341        int pmtmode;
1342        //timer for del old epg entrys
1343        time_t deloldepg;
1344        //write epg periodic to medium
1345        time_t writeperiodicepg;
1346        //0 dektiv
1347        //1 only scan
1348        //2 only whitlist
1349        //3 scan and whitelist
1350        int epglistmode;
1351        // 1 manual
1352        // 2 from standby
1353        int startmode;
1354        jmp_buf longjumpbuf;
1355        pthread_mutex_t drawingmutex;
1356        pthread_mutex_t rectimermutex;
1357        pthread_mutex_t servicemutex;
1358        pthread_mutex_t epgmutex;
1359        pthread_mutex_t channelmutex;
1360        pthread_mutex_t timerthreadmutex;
1361        pthread_mutex_t audiotrackmutex;
1362        pthread_mutex_t subtitlemutex;
1363        pthread_mutex_t linkedchannelmutex;
1364        pthread_mutex_t dmxdevmutex;
1365        pthread_mutex_t rcmutex;
1366        pthread_mutex_t queuemutex;
1367        pthread_mutex_t clistmutex;
1368        pthread_mutex_t hddmutex;
1369        pthread_mutex_t tsseekmutex;
1370        pthread_mutex_t accelfbmutex;
1371        pthread_mutex_t mediadbmutex;
1372        pthread_mutex_t oldentrymutex;
1373        pthread_mutex_t newslettermutex;
1374        pthread_mutex_t tithekmutex;
1375        pthread_mutex_t inetworkmutex;
1376        pthread_mutex_t textboxmutex;
1377        pthread_mutex_t setaktresmutex;
1378        pthread_mutex_t waitrcmutex;
1379        // mutex for VFD handling
1380        pthread_mutex_t vfdmutex;
1381        // mutex for OLED handling
1382        pthread_mutex_t oledmutex;
1383                // mutex for cec handling
1384        pthread_mutex_t cecmutex;
1385        off64_t recsplitsize;
1386        char* gateway;
1387        char* dnsserver1;
1388        char* dnsserver2;
1389        int fasttextrender;
1390        // 1 release all menus
1391        int menurelease;
1392        int play;
1393        int pause;
1394        int playspeed;
1395        int slowspeed;
1396        int prefillbuffer;
1397        int playpic;
1398#ifdef EPLAYER4
1399        int prefillbuffercount;
1400        int bufferpercent;
1401        int cleaninfobar;
1402//      gint avgInRate;
1403//      gint avgOutRate;
1404//      gint64 bufferingLeft;
1405        gint64 pts;
1406#endif
1407        int random;
1408        int repeat;
1409        int epgdays;
1410        int spinnertime;
1411        int spinnerspeed;
1412        int hangtime;
1413        int timeupdatecount;
1414        int markmodus;
1415        // 1 from main prog
1416        // 2 from a thread
1417        int standby;
1418        char* tmp;
1419        // rc filedescriptor
1420        int fdrc;
1421        // rc filedescriptor for tuxtxt
1422        int fdrctxt;
1423        int writeconfig;
1424        int writeownconfig;
1425        int writercconfig;
1426        int writeskinconfig;
1427        int writechannel;
1428        int writetransponder;
1429        int writeprovider;
1430        int writemainbouquet;
1431        int writebouquet;
1432        int writemainplaylist;
1433        int writeplaylist;
1434        int writesat;
1435        int writerectimer;
1436        int writeepgscanlist;
1437        int writemostzap;
1438        int writemediadb;
1439        int writelastsubtitle;
1440        int writechannelslot;
1441        // 1 mute is aktiv
1442        int mute;
1443        // 1 spinner is aktiv
1444        int spinner;
1445        // 1 infobar is aktiv
1446        // 2 infobar is aktiv (with wait befor show)
1447        // 3 infobar is aktiv (no autohide)
1448        int infobar;
1449        // with infobar to display
1450        int infobarnr;
1451        // 0 is for mute screen
1452        struct skin *drawallways[1];
1453        char* drawallwaysbg[1];
1454        int usedirectfb;
1455        // count how long last rcwait (shows spinner if to long)
1456        time_t sec;
1457        // if set to a value != 0, rcwait returns this number
1458        int rckey;
1459        struct skin* skinerr;
1460        pthread_attr_t timerthreadattr;
1461        pthread_t timerthread;
1462        int timerthreadstatus;
1463        int timerthreadaktion;
1464        pthread_attr_t subthreadattr;
1465        pthread_t subthread;
1466        int subthreadstatus;
1467        int subthreadaktion;
1468        int subthreadpid;
1469        int subthreadid1;
1470        int subthreadid2;
1471        // epg thread pointer
1472        struct stimerthread* epgthread;
1473        // epgscanlist thread pointer
1474        struct stimerthread* epgscanlistthread;
1475        // httpd thread pointer
1476        struct stimerthread* httpthread;
1477        // rguid thread pointer
1478        struct stimerthread* rguithread;
1479        // mediadb thread pointer
1480        struct stimerthread* mediadbthread;
1481        // newsletter thread pointer
1482        struct stimerthread* newsletterthread;
1483        // thumb thread pointer
1484        struct stimerthread* thumbthread;
1485        // rectimer thread
1486        struct stimerthread* rectimerthread;
1487        // rguid sock filedescriptor for rguid
1488        int rguidfd;
1489        struct service* aktservice;
1490        struct service* lastservice;
1491        struct service* pipservice;
1492        struct channel* markedchannel;
1493        //if we are in a epg screen, this is the showen channel
1494        struct channel* epgchannel;
1495        char* configfile;
1496        // for bouquet channel numbering
1497        int bouquetnr[MAXSERVICETYPE];
1498        int servicetype;
1499        struct shutdowntimer *sd_timer;
1500        // akt pos in channel cache
1501        int channelcachepos;
1502        // aktivate/deaktivate auto updatevfd
1503        int updatevfd;
1504        // count for recording
1505        int recording;
1506        // count for streaming
1507        int streaming;
1508        // pvr allowed = 1, disable = 0
1509        int pvr;
1510        // timeshift running = 1, ending = 2
1511        int timeshift;
1512        // 0 = normal, 1 = permanent timeshift
1513        int timeshifttype;
1514        // position in timeshiftfile to seek
1515        off64_t timeshiftpos;
1516        // ask if timeshift is running and switch channel
1517        int asktimeshift;
1518        // ts playing running = 1
1519        int playing;
1520        // if set to a skin (screenpointer) only this screen has rc
1521        struct skin* rcowner;
1522        struct skin* rcstandby;
1523        // timerstuktur fuer autores
1524        struct stimerthread* restimer;
1525        // spindown USB/HDD
1526        struct hddparm hdd[3];
1527        struct stimerthread* addhddall;
1528        // save old rotor position
1529        int rotoroldorbitalpos;
1530        // security check
1531        int security;
1532        // set to 1 if tvpic size is changed
1533        int tvpic;
1534        // timestamp for rc action
1535        time_t lastrcaction;
1536        // show timeline in channellist for each channel
1537        int showchanneltimeline;
1538        // see player.h for details
1539        int playercan;
1540                //Code von infobar.h aktiv = 1
1541        int infobaraktiv;
1542        //Name der Datei die abgespielt wird
1543        char* playfile;
1544        //Code MC aktiv = 1
1545        int mcaktiv;
1546        //greater 0 aktivate screen animation
1547        int screenanim;
1548        int screenanimspeed;
1549        //for auto increase audio vol
1550        int volautochange;
1551        int volautochangevalue;
1552        //for powerofftimer
1553        time_t fixpowerofftime;
1554        //for write FB in File
1555        int write_png;
1556        int write_jpg;
1557        //holds oversize value for blitter
1558        int leftoffset;
1559        int rightoffset;
1560        int topoffset;
1561        int bottomoffset;
1562        //background picture for all screens
1563        char* bgpic;
1564        //time for next picmem timeout check
1565        time_t picmemtimeout;
1566        time_t defpicmemtimeout;
1567        //show not tunable channel hidden (0)) or deaktive (1) in channellist
1568        int channellistview;
1569        //for blockmove in channellist
1570        int moveblockcount;
1571        //name ob file who played from webig
1572        char* webplayfile;
1573        //status of mediadbthread
1574        int mediadbthreadstatus;
1575        //for save mediadb in scan
1576        time_t mediadbsavetime;
1577        //colors / pic for selection
1578        long markcol;
1579        long filelistselectcol;
1580        long listboxselectcol;
1581        char* selectpic;
1582        //check if cam can decrypt channel
1583        int checkcamdecrypt;
1584        //don't send privat part of cadescriptor in capmt
1585        int caskipprivat;
1586        //send all caids or only caids cam can
1587        int casendallcaids;
1588        //show hidden files in filelist
1589        int showhiddenfiles;
1590        //mediadb
1591        int mediadbfiles;
1592        //show infobar on program change
1593        int infobarprogram;
1594        //for auto increase audio vol (mute)
1595        int volmute;
1596        int secondzap;
1597        //pointer to marker for recordings
1598        struct marker* playmarker;
1599        int autosubtitle;
1600        //save timeshift start time
1601        time_t timeshiftstart;
1602        int crosscontrol;
1603        int autochangechannelname;
1604        //tuxtext is running
1605        int tuxtxt;
1606        //on some fat32 hdd it takes very long to get free size
1607        int showrecfreesize;
1608        int firstunicablewait;
1609        //path for imdbfolder
1610        char* imdbfolderpath;
1611        int virtualzap;
1612        int fontsizeadjust;
1613        //count for drawing screen
1614        unsigned int drawscreencount;
1615        int autoseek;
1616        //skip all rc input events older than this value in millisec
1617        int rcskipms;
1618        //Workaround da ansonsten DVR4 nicht funktioniert (Treiberproblem)
1619        int setdvr0;
1620#ifdef MIPSEL
1621        //cec mipsel
1622        int cec_fixedAddress;
1623        int hdmiFd;
1624        int webencode;
1625#endif
1626        //pip Einstellungen
1627        int pipzap;
1628        // guest
1629        int whilecount;
1630        int sleepcount;
1631        int stats;
1632        char* url;
1633        //externer plugin Aufruf
1634        char* extplugin;
1635        //node oled blinken
1636        int skinblink;
1637        //BCM accel interface
1638        int bcm;
1639        //Volume
1640        int volume;
1641        int screenshot;
1642        // cacc
1643        int certchecked;
1644        int certok;
1645        int liveslot;
1646        // dynamic default skin infobar
1647        int getepgaktstart;
1648        int getepgaktend;
1649        int getepgakttitle;
1650        int getepgakttimeremaining;
1651        int getepgnextstart;
1652        int getepgnextend;
1653        int getepgnexttitle;
1654        int getepgnexttimeremaining;
1655        // downmix switch in audio menu (audiotrack.h)
1656        int downmix;
1657        // channels for recording
1658        struct channel* recchnode[9];
1659        // frontdev filedescriptor
1660        int fdrc1;
1661} status;
1662
1663struct fb
1664{
1665        int dev;
1666        char *name;
1667        int fd;
1668        unsigned char *fb;
1669        unsigned long *fblong;
1670        int width;
1671        int height;
1672        int pitch;
1673        unsigned long fixfbsize;
1674        unsigned long varfbsize;
1675        int colbytes;
1676        unsigned long data_phys;
1677        struct fb *next;
1678};
1679
1680struct rc
1681{
1682        int key;
1683        void (*rcfunc)(struct skin*, struct skin*, int screencalc, int filelistview, int flag);
1684        struct skin *screen;
1685        struct skin *screennode;
1686        struct skin *owner;
1687        struct rc *next;
1688};
1689
1690struct clist
1691{
1692        char *key;
1693        char *value;
1694        char *def;
1695        char *tmp;
1696        struct clist *next;
1697};
1698
1699struct bouquet
1700{
1701        int nr;
1702        int serviceid;
1703        uint64_t transponderid;
1704        struct channel *channel;
1705        struct bouquet *prev;
1706        struct bouquet *next;
1707};
1708
1709struct channelslot
1710{
1711        int slot;
1712        int serviceid;
1713        uint64_t transponderid;
1714        struct channelslot *next;
1715};
1716
1717struct mainbouquet
1718{
1719        char *name;
1720        int type;
1721        char *filename;
1722        struct bouquet *bouquet;
1723        struct mainbouquet *prev;
1724        struct mainbouquet *next;
1725};
1726
1727struct pic
1728{
1729        char* name;
1730        unsigned char* picbuf;
1731        // < 0 when picbuf is normal mem (hw jpg)
1732        int memfd;
1733        unsigned long width;
1734        unsigned long height;
1735        unsigned long rowbytes;
1736        int channels;
1737  int timeout;
1738  time_t lastaccess;
1739        int del;
1740        struct pic* next;
1741};
1742
1743struct font
1744{
1745        char *name;
1746        FT_Error error;
1747        FTC_Manager manager;
1748        FTC_SBitCache cache;
1749        FTC_ImageTypeRec desc;
1750        FT_Face face;
1751        FT_UInt prev_glyphindex;
1752        FT_Bool use_kerning;
1753        struct font *next;
1754};
1755
1756//structure for write fb to File
1757struct writeFBfile
1758{
1759        unsigned char* ActBuf;
1760        unsigned char* buf1;
1761        unsigned char* buf2;
1762} writeFBfile;
1763
1764struct eit
1765{
1766        u_char table_id                               /*:8*/;
1767        u_char section_length_hi                      :4;
1768        u_char                                        :3;
1769        u_char section_syntax_indicator               :1;
1770        u_char section_length_lo                      /*:8*/;
1771        u_char service_id_hi                          /*:8*/;
1772        u_char service_id_lo                          /*:8*/;
1773        u_char current_next_indicator                 :1;
1774        u_char version_number                         :5;
1775        u_char                                        :2;
1776        u_char section_number                         /*:8*/;
1777        u_char last_section_number                    /*:8*/;
1778        u_char transport_stream_id_hi                 /*:8*/;
1779        u_char transport_stream_id_lo                 /*:8*/;
1780        u_char original_network_id_hi                 /*:8*/;
1781        u_char original_network_id_lo                 /*:8*/;
1782        u_char segment_last_section_number            /*:8*/;
1783        u_char segment_last_table_id                  /*:8*/;
1784        u_char data[]; /* struct eitevent */
1785};
1786#define EITLEN sizeof(struct eit)
1787#define GETEITSECLEN(x) HILO(((struct eit*)(x))->section_length)
1788
1789struct eitevent
1790{
1791        u_char event_id_hi                            /*:8*/;
1792        u_char event_id_lo                            /*:8*/;
1793        u_char mjd_hi                                 /*:8*/;
1794        u_char mjd_lo                                 /*:8*/;
1795        u_char start_time_h                           /*:8*/;
1796        u_char start_time_m                           /*:8*/;
1797        u_char start_time_s                           /*:8*/;
1798        u_char duration_h                             /*:8*/;
1799        u_char duration_m                             /*:8*/;
1800        u_char duration_s                             /*:8*/;
1801        u_char descriptors_loop_length_hi             :4;
1802        u_char free_ca_mode                           :1;
1803        u_char running_status                         :3;
1804        u_char descriptors_loop_length_lo             /*:8*/;
1805        u_char data[];
1806};
1807#define EITEVENTLEN sizeof(struct eitevent)
1808#define GETEITDESCLEN(x) HILO(((struct eitevent *)x)->descriptors_loop_length)
1809
1810struct eitshortevent
1811{
1812        u_char descriptor_tag                         /*:8*/;
1813        u_char descriptor_length                      /*:8*/;
1814        u_char lang_code1                             /*:8*/;
1815        u_char lang_code2                             /*:8*/;
1816        u_char lang_code3                             /*:8*/;
1817        u_char event_name_length                      /*:8*/;
1818        u_char data[];
1819};
1820#define EITSHORTEVENTLEN sizeof(struct eitshortevent)
1821
1822struct eitlongevent
1823{
1824        u_char descriptor_tag                         /*:8*/;
1825        u_char descriptor_length                      /*:8*/;
1826        u_char last_descriptor_number                 :4;
1827        u_char descriptor_number                      :4;
1828        u_char lang_code1                             /*:8*/;
1829        u_char lang_code2                             /*:8*/;
1830        u_char lang_code3                             /*:8*/;
1831        u_char length_of_items                        /*:8*/;
1832        u_char data[]; /* struct eitlongeventitem */
1833};
1834#define EITLONGEVENTLEN sizeof(struct eitlongevent)
1835
1836struct eitlongeventitem
1837{
1838        u_char item_description_length               /*:8*/;
1839        u_char data[];
1840};
1841#define EITLONGEVENTITEMLEN sizeof(struct eitlongeventitem)
1842
1843struct eitlinkage
1844{
1845        u_char descriptor_tag                 /*:8*/;
1846        u_char descriptor_length              /*:8*/;
1847        u_char transport_stream_id_hi         /*:8*/;
1848        u_char transport_stream_id_lo         /*:8*/;
1849        u_char original_network_id_hi         /*:8*/;
1850        u_char original_network_id_lo         /*:8*/;
1851        u_char service_id_hi                  /*:8*/;
1852        u_char service_id_lo                  /*:8*/;
1853        u_char linkage_type                   /*:8*/;
1854};
1855#define EITLLINKAGELEN sizeof(struct eitlinkage)
1856
1857struct parentalrating
1858{
1859        u_char descriptor_tag                 /*:8*/;
1860        u_char descriptor_length              /*:8*/;
1861        u_char data[]; //struct parental_rating_item
1862};
1863#define PARENTALRATINGLEN sizeof(struct parentalrating)
1864
1865struct parentalratingitem
1866{
1867        u_char lang_code1                    /*:8*/;
1868        u_char lang_code2                    /*:8*/;
1869        u_char lang_code3                    /*:8*/;
1870        u_char rating                        /*:8*/;
1871};
1872#define PARENTALRATINGITEMLEN sizeof(struct parentalratingitem)
1873
1874struct rst //table id 0x71
1875{
1876        u_char table_id                     /*:8*/;
1877        u_char section_syntax_indicator         :1;
1878        u_char reserved_1                       :1;
1879        u_char reserved_2                       :2;
1880        u_int section_length                   :12;
1881};
1882#define RSTLEN sizeof(struct rst)
1883
1884struct rstitem
1885{
1886        u_char transponder_stream_id_hi     /*:8*/;
1887        u_char transponder_stream_id_lo     /*:8*/;
1888        u_char original_network_id_hi       /*:8*/;
1889        u_char original_network_id_lo       /*:8*/;
1890        u_char service_id_hi                /*:8*/;
1891        u_char service_id_lo                /*:8*/;
1892        u_char event_id_hi                  /*:8*/;
1893        u_char event_id_lo                  /*:8*/;
1894        u_char reserved_1                       :5;
1895        u_char running_status                   :3;
1896};
1897#define RSTITEMLEN sizeof(struct rstitem)
1898
1899struct mhwchannel
1900{
1901        u_char  network_id_hi;
1902        u_char  network_id_lo;
1903        u_char  transponder_id_hi;
1904        u_char  transponder_id_lo;
1905        u_char  channel_id_hi;
1906        u_char  channel_id_lo;
1907        u_char  name[16];
1908};
1909#define MHWCHANNELLEN sizeof(struct mhwchannel)
1910
1911struct mhwtitle
1912{
1913        u_char table_id                       :8;
1914        u_char section_length_hi              :4;
1915        u_char                                :2;
1916        u_char dummy                          :1;
1917        u_char section_syntax_indicator       :1;
1918        u_char section_length_lo              :8;
1919        u_char channel_id                     :8;
1920        u_char theme_id                       :8;
1921        u_char hours                                  :5;
1922        u_char day                            :3;
1923        u_char summary_available              :1;
1924        u_char                                      :1;
1925        u_char minutes                        :6;
1926        u_char                                :8;
1927        u_char                                :8;
1928        u_char duration_hi                    :8;
1929        u_char duration_lo                    :8;
1930        u_char title                          [23];
1931        u_char ppv_id_hi                      :8;
1932        u_char ppv_id_mh                      :8;
1933        u_char ppv_id_ml                      :8;
1934        u_char ppv_id_lo                      :8;
1935        u_char program_id_hi                  :8;
1936        u_char program_id_mh                  :8;
1937        u_char program_id_ml                  :8;
1938        u_char program_id_lo                  :8;
1939        u_char                                :8;
1940        u_char                                :8;
1941        u_char                                :8;
1942        u_char                                :8;
1943};
1944#define MHWTITLELEN sizeof(struct mhwtitle)
1945
1946struct mhwsummary
1947{
1948        u_char table_id                       :8;
1949        u_char section_length_hi              :4;
1950        u_char                                :2;
1951        u_char dummy                          :1;
1952        u_char section_syntax_indicator       :1;
1953        u_char section_length_lo              :8;
1954        u_char program_id_hi                  :8;
1955        u_char program_id_mh                  :8;
1956        u_char program_id_ml                  :8;
1957        u_char program_id_lo                  :8;
1958        u_char                                :8;
1959        u_char                                :8;
1960        u_char                                :8;
1961        u_char nb_replays                     :8;
1962};
1963#define MHWSUMMARYLEN sizeof(struct mhwsummary)
1964
1965struct mhw2channel
1966{
1967        u_char network_id_hi;
1968        u_char network_id_lo;
1969        u_char transponder_id_hi;
1970        u_char transponder_id_lo;
1971        u_char channel_id_hi;
1972        u_char channel_id_lo;
1973        u_char                                :8;
1974        u_char                                :8;
1975};
1976
1977struct extepgcache
1978{
1979        long id;
1980        struct epg* epgnode;
1981        struct extepgcache* next;
1982};
1983
1984struct extepgchannel
1985{
1986        long id;
1987        int serviceid;
1988        uint64_t transponderid;
1989        struct extepgchannel* next;
1990};
1991
1992struct extepgconfig
1993{
1994        uint64_t transponderid;
1995        int type;
1996        char* file;
1997        int channelpid;
1998        int titlepid[8];
1999        int summarypid[8];
2000        struct extepgconfig* next;
2001};
2002
2003struct blacklist
2004{
2005  char* file;
2006  struct splitstr* splitstr;
2007  int count;
2008};
2009
2010typedef struct sci_modes
2011{
2012        int emv2000;
2013        int dma;
2014        int man_act;
2015        int rw_mode;
2016} scimodes;
2017
2018typedef struct sci_parameters
2019{
2020        u_char T;
2021        unsigned long fs;
2022        unsigned long ETU;
2023        unsigned long WWT;
2024        unsigned long CWT;
2025        unsigned long BWT;
2026        unsigned long EGT;
2027        unsigned long clock_stop_polarity;
2028        u_char check;
2029        u_char P;
2030        u_char I;
2031        u_char U;
2032} sciparameters;
2033
2034struct update
2035{
2036        char* auth;
2037        char* type;
2038        char* skinname;
2039        char* filemask;
2040        char* filepath;
2041        int imgtype;
2042};
2043
2044#ifdef EPLAYER4
2045typedef enum { stUnknown, stPlainText, stSSA, stASS, stSRT, stVOB, stPGS } subtype_t;
2046typedef enum {atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC, atWMA} audiotype_t;
2047typedef struct _CustomData {
2048//typedef struct CustomData {
2049  GstElement *playbin2;   /* Our one and only element */
2050   
2051  gint n_video;          /* Number of embedded video streams */
2052  gint n_audio;          /* Number of embedded audio streams */
2053  gint n_text;           /* Number of embedded subtitle streams */
2054   
2055  gint current_video;    /* Currently playing video stream */
2056  gint current_audio;    /* Currently playing audio stream */
2057  gint current_text;     /* Currently playing subtitle stream */
2058
2059  gboolean is_live;
2060  GstElement *pipeline;
2061  GMainLoop *loop;
2062} CustomData;
2063
2064typedef enum {
2065        GST_PLAY_FLAG_VIDEO = (1 << 0),
2066        GST_PLAY_FLAG_AUDIO = (1 << 1),
2067        GST_PLAY_FLAG_TEXT = (1 << 2),
2068        GST_PLAY_FLAG_NATIVE_VIDEO = (1 << 3)
2069} GstPlayFlags;
2070#endif
2071
2072#ifdef MIPSEL
2073//fuer cec Mipsel
2074
2075#ifdef DREAMBOX
2076struct cec_message
2077{
2078        unsigned char address;
2079        unsigned char data[16];
2080        unsigned char length;
2081        unsigned char flag;
2082}__attribute__((packed));
2083struct cec_rx_message
2084{
2085        unsigned char address;
2086        unsigned char destination;
2087        unsigned char data[16];
2088        unsigned char length;
2089}__attribute__((packed));
2090
2091
2092#else
2093struct cec_message
2094{
2095unsigned char address;
2096unsigned char length;
2097unsigned char data[256];
2098}__attribute__((packed));
2099struct cec_rx_message
2100{
2101        unsigned char address;
2102        unsigned char destination;
2103        unsigned char data[16];
2104        unsigned char length;
2105}__attribute__((packed));
2106#endif
2107
2108unsigned char cec_physicalAddress[2];
2109unsigned char cec_logicalAddress;
2110unsigned char cec_deviceType;
2111
2112#endif
2113
2114// cacc
2115/* CI+ certificates */
2116
2117struct cert_ctx {
2118        X509_STORE *store;
2119
2120        /* Host */
2121        X509 *cust_cert;
2122        X509 *device_cert;
2123
2124        /* Module */
2125        X509 *ci_cust_cert;
2126        X509 *ci_device_cert;
2127};
2128
2129#ifdef MIPSEL
2130enum ca_descr_data_type {
2131        CA_DATA_IV,
2132        CA_DATA_KEY,
2133};
2134
2135enum ca_descr_parity {
2136        CA_PARITY_EVEN,
2137        CA_PARITY_ODD,
2138};
2139
2140struct ca_descr_data {
2141        unsigned int index;
2142        enum ca_descr_parity parity;
2143        enum ca_descr_data_type data_type;
2144        unsigned int length;
2145        unsigned char *data;
2146};
2147
2148#endif
2149
2150#ifdef SH4NEW
2151enum ca_descr_data_type {
2152        CA_DATA_IV,
2153        CA_DATA_KEY,
2154};
2155
2156enum ca_descr_parity {
2157        CA_PARITY_EVEN,
2158        CA_PARITY_ODD,
2159};
2160
2161struct ca_descr_data {
2162        unsigned int index;
2163        enum ca_descr_parity parity;
2164        enum ca_descr_data_type data_type;
2165        unsigned int length;
2166        unsigned char *data;
2167};
2168
2169#endif
2170
2171struct aes_xcbc_mac_ctx {
2172        uint8_t K[3][16];
2173        uint8_t IV[16];
2174        AES_KEY key;
2175        int buflen;
2176};
2177
2178uint32_t datatype_sizes[MAX_ELEMENTS] = {
2179        0, 50, 0, 0, 0, 8, 8, 0,
2180        0, 0, 0, 0, 32, 256, 256, 0,
2181        0, 256, 256, 32, 8, 8, 32, 32,
2182        0, 8, 2, 32, 1, 32, 1, 0,
2183        32
2184};
2185
2186struct element {
2187        uint8_t *data;
2188        uint32_t size;
2189        /* buffer valid */
2190        int valid;
2191};
2192
2193struct cc_ctrl_data {
2194        /* parent */
2195        struct caslot* slot;
2196
2197        /* ci+ credentials */
2198        struct element elements[MAX_ELEMENTS];
2199
2200        /* DHSK */
2201        uint8_t dhsk[256];
2202
2203        /* KS_host */
2204        uint8_t ks_host[32];
2205
2206        /* derived keys */
2207        uint8_t sek[16];
2208        uint8_t sak[16];
2209
2210        /* AKH checks - module performs 5 tries to get correct AKH */
2211        unsigned int akh_index;
2212
2213        /* authentication data */
2214        uint8_t dh_exp[256];
2215
2216        /* certificates */
2217        struct cert_ctx *cert_ctx;
2218
2219        /* private key of device-cert */
2220        RSA *rsa_device_key;
2221};
2222
2223#endif
Note: See TracBrowser for help on using the repository browser.