source: titan/titan/struct.h @ 37786

Last change on this file since 37786 was 37786, checked in by obi, 8 years ago

cleanup

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