source: titan/titan/struct.h @ 43033

Last change on this file since 43033 was 42986, checked in by obi, 5 years ago

add #include <sys/sysmacros.h>

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