source: titan/titan/struct.h @ 37833

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

disable double define

File size: 42.7 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.77"
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 MIPSEL1
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        // not in used currently
549        int inuse;
550        int sidblacklisted;
551};
552
553struct hdd
554{
555        char* device;
556        int partition;
557        unsigned long long size;
558        char* filesystem;
559        char* label;
560        char* uuid;
561        char* vendor;
562        char* model;
563        int removable;
564        int read;
565        int write;
566        int sleeptime;
567        int notchanged;
568        struct hdd* prev;
569        struct hdd* next;
570};
571
572struct scaninfo
573{
574        struct dvbdev* fenode;
575        struct transponder* tpnode;
576        struct skin* scanscreen;
577        struct skin* listbox;
578        int threadend;
579        int scantype;
580        int fetype;
581        int orbitalpos;
582        int timeout;
583        int onlyfree;
584        int networkscan;
585        int clear;
586        int blindscan;
587        char* satname;
588        int tpcount;
589        int tpmax;
590        int tpnew;
591        int tpdel;
592        int tvcount;
593        int newtvcount;
594        int radiocount;
595        int newradiocount;
596        int datacount;
597        int newdatacount;
598        int blindcount;
599        int newblindcount;
600        int changename;
601        int cleartransponder;
602        unsigned int blindmax;
603} scaninfo;
604
605struct screensaver
606{
607        int type;
608        int speed;
609        int newposx;
610        int newposy;
611        int flag;
612        struct skin* screen;
613        struct skin* screennode;
614        struct skin* filelist;
615        struct skin* aktnode;
616        struct pic* pic;
617        char* value;
618        char* path;
619};
620
621struct playlist
622{
623        char* file;
624        struct playlist* prev;
625        struct playlist* next;
626};
627
628struct mainplaylist
629{
630        char* name;
631        char* filename;
632        struct playlist* playlist;
633        struct mainplaylist* prev;
634        struct mainplaylist* next;
635};
636
637struct epgrecord
638{
639        time_t begin;
640        time_t end;
641        int posx;
642        int size;
643        struct epgrecord* prev;
644        struct epgrecord* next;
645};
646
647struct download
648{
649        char* host;
650        char* page;
651        int port;
652        char* filename;
653        char* auth;
654        int connfd;
655        int proz;
656        unsigned int maxkb;
657        unsigned int aktkb;
658        int ret;
659        int timeout;
660        int flag;
661};
662
663struct copyfile
664{
665        char* from;
666        char* to;
667        int proz;
668        int filecount;
669        int maxfilecount;
670        off64_t maxkb;
671        off64_t aktkb;
672        int stop;
673        int ret;
674        int flag;
675};
676
677struct epgscanlist
678{
679        int serviceid;
680        uint64_t transponderid;
681        time_t scantime;
682        struct epgscanlist* prev;
683        struct epgscanlist* next;
684        char* name;
685};
686
687struct rgba
688{
689        char r;
690        char g;
691        char b;
692        char a;
693};
694
695struct subclutentry
696{
697        unsigned char Y, Cr, Cb, T;
698        unsigned char valid;
699};
700
701struct subclut
702{
703        unsigned char clutid;
704        unsigned char clutversionnumber;
705        struct subclutentry entries2bit[4];
706        struct subclutentry entries4bit[16];
707        struct subclutentry entries8bit[256];
708        struct subclut *next;
709};
710
711struct subpagereg
712{
713        int regid;
714        int reghorizontaladdress;
715        int regverticaladdress;
716        int scaleposx, scaleposy;
717        struct subpagereg *next;
718};
719
720struct subregobj
721{
722        int objid;
723        int objtype;
724        int objproviderflag;
725        int objhorizontalpos;
726        int objverticalpos;
727        // not supported right now...
728        int foregroundpixel;
729        int backgroundpixel;
730        struct subregobj *next;
731};
732
733struct subreg
734{
735        int regid;
736        int versionnumber;
737        int height, width;
738        int scaleheight, scalewidth;
739        int depth;
740        unsigned char *buf;
741        struct rgba *palette;
742        int clutid;
743        int committed;
744        struct subregobj *objects;
745        struct subreg *next;
746};
747
748struct subpage
749{
750        int pageid;
751        time_t pagetimeout;
752        int pageversionnumber;
753        int state;
754        int pcssize;
755        struct subpagereg *pageregions;
756        struct subreg *regions;
757        struct subclut *cluts;
758        struct subpage *next;
759};
760
761struct bitstream
762{
763        unsigned char *data;
764        int size;
765        int avail;
766        int consumed;
767};
768
769//there are a copyrectimer function
770//if you change the struct you must change this funktion
771struct rectimer
772{
773        char* name;
774        char* timestamp;
775        time_t begin;
776        time_t end;
777        int repeate;
778        int afterevent;
779        char* pincode;
780        int disabled;
781        int justplay;
782        char* recpath;
783        int servicetype;
784        char* channellist;
785        int serviceid;
786        //0 = nothing
787        //1 = running
788        //2 = end
789        //3 = error
790        //4 = epgscan timer activ
791        //5 = epgscan timer not activ
792        int status;
793        char* errstr;
794        struct service* servicenode;
795        uint64_t transponderid;
796        struct rectimer *prev;
797        struct rectimer *next;
798};
799
800struct inetwork
801{
802        char* device;
803        char* ip;
804        char* netmask;
805        char* mac;
806        char* broadcast;
807        //0 = static
808        //1 = dhcp
809        //2 = off
810        int type;
811        int found;
812        //flag 1 = used in titan
813        int flag;
814        struct inetwork *prev;
815        struct inetwork *next;
816};
817
818struct rcmap
819{
820        char* name;
821        int key;
822        int newkey;
823        struct rcmap* next;
824};
825
826struct splitstr
827{
828        char* part;
829};
830
831struct channelcache
832{
833        int serviceid;
834        uint64_t transponderid;
835        struct channel* chnode;
836        struct channelcache* next;
837};
838
839struct transpondercache
840{
841        uint64_t transponderid;
842        struct transponder* tpnode;
843        struct transpondercache* next;
844};
845
846struct filelist
847{
848        int type;
849        int view;
850        off64_t size;
851        time_t date;
852};
853
854struct skin
855{
856        char* name;
857        unsigned int type;
858        uint8_t wrap;
859        uint8_t bordersize;
860        uint8_t scrollbar;
861        uint16_t halign;
862        uint16_t valign;
863        int16_t posx;
864        int16_t posy;
865        int16_t width;
866        int16_t height;
867        long bordercol;
868        long deaktivcol;
869        long shadowcol;
870        uint8_t shadowsize;
871        uint8_t shadowpos;
872        uint8_t fontsize;
873        uint8_t fontsize2;
874        long fontcol;
875        long fontcol2;
876        char* font;
877        int16_t zorder;
878        int16_t titlealign;
879        char* title;
880        char* text;
881        char* text2;
882        long bgcol;
883        long bgcol2;
884        long titlebgcol;
885        long titlebgcol2;
886        long progresscol;
887        char* selectpic;
888        char* pic;
889        int16_t picwidth;
890        int16_t picheight;
891        uint16_t hspace;
892        uint16_t vspace;
893        char* (*skinfunc)(struct skin*, void*, void*);
894        char* param1;
895        char* param2;
896        char* parent;
897        char* input;
898        char* mask;
899        uint16_t textposx;
900        uint16_t textposx2;
901        int16_t gradient;
902        int16_t titlegradient;
903        uint8_t transparent;
904        uint8_t hidden;
905        uint8_t funcrettype;
906        int8_t charspace;
907        int8_t bordertype;
908        int16_t borderradius;
909        uint16_t bgspace;
910        uint8_t picquality;
911
912        uint8_t titlesize;
913        struct filelist* filelist;
914        struct skin* parentpointer;
915        char* ret;
916        char* choiceboxvalue;
917        unsigned int linecount;
918        unsigned int pagecount;
919        unsigned int poscount;
920        unsigned int gridcol;
921        int aktpage;
922        int aktline;
923        uint8_t scrollbarbordersize;
924        uint8_t prozposx;
925        uint8_t prozposy;
926        uint8_t prozwidth;
927        uint8_t prozheight;
928        uint8_t picprozwidth;
929        uint8_t del;
930        uint8_t picprozheight;
931        int16_t scrollbarheight;
932        int16_t progresssize;
933        int16_t scrollbarwidth;
934        int16_t scrollbarpos;
935        int16_t rposx;
936        int16_t rposy;
937        int16_t rwidth;
938        int16_t rheight;
939        int16_t rpicwidth;
940        int16_t rpicheight;
941        int16_t iposx;
942        int16_t iposy;
943        int16_t iwidth;
944        int16_t iheight;
945        char* handle;
946        char* handle1;
947        struct epgrecord* epgrecord;
948        char* pluginhandle;
949        uint8_t locked;
950        uint8_t picmem;
951        //bit 0: 1 = node is drawed
952        //bit 1: 1 = node is changed
953        uint8_t flag;
954        int hash;
955        struct skin *select;
956        struct skin *child;
957        struct skin *prev;
958        struct skin *next;
959        struct skin *drawnext;
960        // usesavebg=0 disable
961        // usesavebg=1 save always
962        // usesavebg=2 save one times then free
963        // usesavebg=3 dummy for filelist
964        int usesavebg;
965        // savebg is saved date
966        char* savebg;
967        // fuer blinken
968        int nodestyle;
969};
970
971struct style
972{
973        char* name;
974        int16_t posx;
975        int16_t posy;
976        int16_t width;
977        int16_t height;
978        int16_t picwidth;
979        int16_t picheight;
980        uint16_t textposx;
981        uint16_t textposx2;
982        uint16_t halign;
983        uint16_t valign;
984        uint16_t hspace;
985        uint16_t vspace;
986        uint16_t bgspace;
987        int16_t borderradius;
988        int16_t titlealign;
989        int16_t zorder;
990        int16_t gradient;
991        int16_t titlegradient;
992        uint8_t picquality;
993        uint8_t hidden;
994        uint8_t wrap;
995        uint8_t scrollbar;
996        uint8_t bordersize;
997        int8_t bordertype;
998        uint8_t shadowsize;
999        uint8_t shadowpos;
1000        uint8_t fontsize;
1001        uint8_t fontsize2;
1002        int8_t charspace;
1003        uint8_t transparent;
1004        uint8_t prozposx;
1005        uint8_t prozposy;
1006        uint8_t prozwidth;
1007        uint8_t prozheight;
1008        uint8_t picprozwidth;
1009        uint8_t picprozheight;
1010        uint8_t funcrettype;
1011        uint8_t picmem;
1012        long bordercol;
1013        long deaktivcol;
1014        long progresscol;
1015        long shadowcol;
1016        long fontcol;
1017        long fontcol2;
1018        long titlebgcol;
1019        long titlebgcol2;
1020        long bgcol;
1021        long bgcol2;
1022        char* font;
1023        char* pic;
1024        char* param1;
1025        char* param2;
1026        char* input;
1027        char* mask;
1028        char* (*skinfunc)(struct skin*, void*, void*);
1029        struct style* next;
1030};
1031
1032struct epg
1033{
1034        int eventid;
1035        int version;
1036        time_t starttime;
1037        time_t endtime;
1038        char* title;
1039        char* subtitle;
1040        char* desc;
1041        int desclen;
1042        int desccomplen;
1043        int parentalrating;
1044        struct epg* prev;
1045        struct epg* next;
1046};
1047
1048struct shutdowntimer
1049{
1050        int active,type; //type: 0=DeepStandby, 1=Standby
1051        long long shutdown_time;
1052};
1053
1054struct dvbdev
1055{
1056        char* dev;
1057        int fd;
1058        uint8_t type;
1059        uint8_t adapter;
1060        uint8_t devnr;
1061        uint8_t felock;
1062        uint8_t deactive;
1063        uint8_t decoder;
1064        struct transponder* felasttransponder;
1065        struct transponder* feakttransponder;
1066        int feunicable;
1067        unsigned int feloffrequency;
1068        int feaktband;
1069        int feaktpolarization;
1070        fe_sec_voltage_t feaktvolt;
1071        fe_sec_tone_mode_t feakttone;
1072        int fedmxsource;
1073        char* feaktnr;
1074        char* feshortname;
1075        char* fehyprid;
1076        struct dvb_frontend_info* feinfo;
1077        struct caslot* caslot;
1078        struct dvbdev *next;
1079};
1080
1081//there are a copytransponder and createtransponder function
1082//if you change this struct you must change the function
1083struct transponder
1084{
1085        uint64_t id;
1086        uint8_t fetype;
1087        uint8_t polarization;
1088        uint8_t modulation;
1089        uint8_t fec;
1090        uint8_t pilot;
1091        uint8_t rolloff;
1092        uint8_t inversion;
1093        uint8_t system;
1094        uint8_t flag;
1095        // 0 = unknown
1096        // 1 = tunable
1097        // 2 = not tunable
1098        uint8_t tunablestatus;
1099        int orbitalpos;
1100        unsigned int frequency;
1101        unsigned int symbolrate;
1102        int encoding;
1103        time_t lastepg;
1104        struct transponder *next;
1105};
1106
1107struct provider
1108{
1109        int providerid;
1110        char* name;
1111        int flag;
1112        struct provider *prev;
1113        struct provider *next;
1114};
1115
1116struct subtitle
1117{
1118        char* name;
1119        int16_t subtype;
1120        int16_t pid;
1121        int16_t type;
1122        int16_t id1;
1123        int16_t id2;
1124        struct subtitle* next;
1125};
1126
1127struct esinfo
1128{
1129        int streamtype;
1130        int pid;
1131        struct esinfo* next;
1132};
1133
1134struct cadesc
1135{
1136        int pid;
1137        int len;
1138        int systemid;
1139        int reserved;
1140        int capid;
1141        char* privat;
1142        struct cadesc* next;
1143};
1144
1145struct pmt
1146{
1147        int programnumber;
1148        int versionnumber;
1149        int currentnextindicator;
1150};
1151
1152struct audiotrack
1153{
1154        char* name;
1155        uint8_t audiocodec;
1156        int16_t audiopid;
1157        int16_t rdspid;
1158        struct audiotrack* next;
1159};
1160
1161struct linkedchannel
1162{
1163        uint64_t transponderid;
1164        int serviceid;
1165        time_t starttime;
1166        time_t endtime;
1167        struct linkedchannel* next;
1168};
1169
1170//there are a createchannel function
1171//if you change this struct you must change the function
1172struct channel
1173{
1174        char* name;
1175        uint64_t transponderid;
1176        int providerid;
1177        int serviceid;
1178        int servicetype;
1179        uint8_t flag;
1180        uint8_t crypt;
1181        int8_t videocodec;
1182        int8_t audiocodec;
1183        int16_t videopid;
1184        int16_t audiopid;
1185        int16_t ac3audiopid;
1186        int16_t txtpid;
1187        int16_t pcrpid;
1188        int16_t pmtpid;
1189        int16_t aitpid;
1190        uint8_t protect;
1191        char* hbbtvurl;
1192        struct transponder *transponder;
1193        struct provider *provider;
1194        struct audiotrack *audiotrack;
1195        struct subtitle *subtitle;
1196        struct linkedchannel *linkedchannel;
1197        struct pmt *pmt;
1198        struct cadesc *cadesc;
1199        struct esinfo *esinfo;
1200        struct epg *epg;
1201        struct channel *prev;
1202        struct channel *next;
1203};
1204
1205struct sat
1206{
1207        char* name;
1208        int orbitalpos;
1209        int flag;
1210        int fetype;
1211        int scan;
1212        struct sat *prev;
1213        struct sat *next;
1214};
1215
1216struct service
1217{
1218        int type;
1219        char* channellist;
1220        struct dvbdev *fedev;
1221        struct dvbdev *dmxaudiodev;
1222        struct dvbdev *dmxvideodev;
1223        struct dvbdev *dmxpcrdev;
1224        struct dvbdev *dmxsubtitledev;
1225        struct dvbdev *audiodev;
1226        struct dvbdev *videodev;
1227        struct dvbdev *encoderdev;
1228        struct transponder *transponder;
1229        struct channel *channel;
1230        unsigned char *pmtbuf;
1231        int pmtlen;
1232        int recdmxstart;
1233        int recdstfd;
1234        int recsrcfd;
1235        time_t recendtime;
1236        char* rectimestamp;
1237        size_t reclastsync;
1238        off64_t rectotal;
1239        int reccount;
1240        int tssize;
1241        char* recname;
1242        unsigned long long lenpts;
1243        unsigned long long startpts;
1244        unsigned long long endpts;
1245        unsigned long long bitrate;
1246        off64_t endoffile;
1247        struct service *next;
1248};
1249
1250struct caservice
1251{
1252        struct service* service;
1253        struct channel* channel;
1254        int count;
1255        int camsockfd;
1256        struct caslot* caslot;
1257        int camanager;
1258        char* capmt;
1259        int capmtlen;
1260        int cmdpos;
1261};
1262
1263struct stimerthread
1264{
1265        int delay;
1266        int count;
1267        int notfirst;
1268        pthread_attr_t attr;
1269        pthread_t thread;
1270        int status;
1271        int aktion;
1272        //bit 0: 1 = stop allwas on titan end
1273        int flag;
1274        void* param1;
1275        void* param2;
1276        void* (*func)(struct stimerthread*, void*, void*);
1277        struct stimerthread* next;
1278};
1279
1280struct hddparm
1281{
1282        char* device;
1283        int read;
1284        int write;
1285        int sleeptime;
1286        int notchanged;
1287};
1288
1289struct marker
1290{
1291        off64_t pos;
1292        off64_t time;
1293        char* timetext;
1294        struct marker* prev;
1295        struct marker* next;
1296};
1297
1298struct status
1299{
1300        int longkeycode[MAXLONGKEY];
1301        //aktivate extra featers
1302        int expertmodus;
1303        //http user:passwd
1304        char* httpauth;
1305        //set to 1 if channellist or channelnr open
1306        int channelswitch;
1307        //deaktivates child protect if greater then akttime
1308        time_t protecttime;
1309        char* boxtype;
1310        char* realboxtype;
1311        pthread_t mainthread;
1312        //videosize from stream
1313        video_size_t videosize;
1314        time_t videosizevalid;
1315        //radius for rounded border
1316        int borderradius;
1317        int picbordersize;
1318        int titlelinesize;
1319        //0 border
1320        //1 fullbar
1321        int listboxselecttype;
1322        //0 camd.socket
1323        //1 pmt.tmp
1324        int pmtmode;
1325        //timer for del old epg entrys
1326        time_t deloldepg;
1327        //write epg periodic to medium
1328        time_t writeperiodicepg;
1329        //0 dektiv
1330        //1 only scan
1331        //2 only whitlist
1332        //3 scan and whitelist
1333        int epglistmode;
1334        // 1 manual
1335        // 2 from standby
1336        int startmode;
1337        jmp_buf longjumpbuf;
1338        pthread_mutex_t drawingmutex;
1339        pthread_mutex_t rectimermutex;
1340        pthread_mutex_t servicemutex;
1341        pthread_mutex_t epgmutex;
1342        pthread_mutex_t channelmutex;
1343        pthread_mutex_t timerthreadmutex;
1344        pthread_mutex_t audiotrackmutex;
1345        pthread_mutex_t subtitlemutex;
1346        pthread_mutex_t linkedchannelmutex;
1347        pthread_mutex_t dmxdevmutex;
1348        pthread_mutex_t rcmutex;
1349        pthread_mutex_t queuemutex;
1350        pthread_mutex_t clistmutex;
1351        pthread_mutex_t hddmutex;
1352        pthread_mutex_t tsseekmutex;
1353        pthread_mutex_t accelfbmutex;
1354        pthread_mutex_t mediadbmutex;
1355        pthread_mutex_t oldentrymutex;
1356        pthread_mutex_t newslettermutex;
1357        pthread_mutex_t tithekmutex;
1358        pthread_mutex_t inetworkmutex;
1359        pthread_mutex_t textboxmutex;
1360        pthread_mutex_t setaktresmutex;
1361        pthread_mutex_t waitrcmutex;
1362        // mutex for VFD handling
1363        pthread_mutex_t vfdmutex;
1364        // mutex for OLED handling
1365        pthread_mutex_t oledmutex;
1366        off64_t recsplitsize;
1367        char* gateway;
1368        char* dnsserver1;
1369        char* dnsserver2;
1370        int fasttextrender;
1371        // 1 release all menus
1372        int menurelease;
1373        int play;
1374        int pause;
1375        int playspeed;
1376        int slowspeed;
1377        int prefillbuffer;
1378        int playpic;
1379#ifdef EPLAYER4
1380        int bufferpercent;
1381        int cleaninfobar;
1382//      gint avgInRate;
1383//      gint avgOutRate;
1384//      gint64 bufferingLeft;
1385        gint64 pts;
1386#endif
1387        int random;
1388        int repeat;
1389        int epgdays;
1390        int spinnertime;
1391        int spinnerspeed;
1392        int hangtime;
1393        int timeupdatecount;
1394        int markmodus;
1395        // 1 from main prog
1396        // 2 from a thread
1397        int standby;
1398        char* tmp;
1399        // rc filedescriptor
1400        int fdrc;
1401        // rc filedescriptor for tuxtxt
1402        int fdrctxt;
1403        int writeconfig;
1404        int writeownconfig;
1405        int writercconfig;
1406        int writeskinconfig;
1407        int writechannel;
1408        int writetransponder;
1409        int writeprovider;
1410        int writemainbouquet;
1411        int writebouquet;
1412        int writemainplaylist;
1413        int writeplaylist;
1414        int writesat;
1415        int writerectimer;
1416        int writeepgscanlist;
1417        int writemostzap;
1418        int writemediadb;
1419        int writelastsubtitle;
1420        int writechannelslot;
1421        // 1 mute is aktiv
1422        int mute;
1423        // 1 spinner is aktiv
1424        int spinner;
1425        // 1 infobar is aktiv
1426        // 2 infobar is aktiv (with wait befor show)
1427        // 3 infobar is aktiv (no autohide)
1428        int infobar;
1429        // with infobar to display
1430        int infobarnr;
1431        // 0 is for mute screen
1432        struct skin *drawallways[1];
1433        char* drawallwaysbg[1];
1434        int usedirectfb;
1435        // count how long last rcwait (shows spinner if to long)
1436        time_t sec;
1437        // if set to a value != 0, rcwait returns this number
1438        int rckey;
1439        struct skin* skinerr;
1440        pthread_attr_t timerthreadattr;
1441        pthread_t timerthread;
1442        int timerthreadstatus;
1443        int timerthreadaktion;
1444        pthread_attr_t subthreadattr;
1445        pthread_t subthread;
1446        int subthreadstatus;
1447        int subthreadaktion;
1448        int subthreadpid;
1449        int subthreadid1;
1450        int subthreadid2;
1451        // epg thread pointer
1452        struct stimerthread* epgthread;
1453        // epgscanlist thread pointer
1454        struct stimerthread* epgscanlistthread;
1455        // httpd thread pointer
1456        struct stimerthread* httpthread;
1457        // rguid thread pointer
1458        struct stimerthread* rguithread;
1459        // mediadb thread pointer
1460        struct stimerthread* mediadbthread;
1461        // newsletter thread pointer
1462        struct stimerthread* newsletterthread;
1463        // thumb thread pointer
1464        struct stimerthread* thumbthread;
1465        // rectimer thread
1466        struct stimerthread* rectimerthread;
1467        // rguid sock filedescriptor for rguid
1468        int rguidfd;
1469        struct service* aktservice;
1470        struct service* lastservice;
1471        struct service* pipservice;
1472        struct channel* markedchannel;
1473        //if we are in a epg screen, this is the showen channel
1474        struct channel* epgchannel;
1475        char* configfile;
1476        // for bouquet channel numbering
1477        int bouquetnr[MAXSERVICETYPE];
1478        int servicetype;
1479        struct shutdowntimer *sd_timer;
1480        // akt pos in channel cache
1481        int channelcachepos;
1482        // aktivate/deaktivate auto updatevfd
1483        int updatevfd;
1484        // count for recording
1485        int recording;
1486        // count for streaming
1487        int streaming;
1488        // pvr allowed = 1, disable = 0
1489        int pvr;
1490        // timeshift running = 1, ending = 2
1491        int timeshift;
1492        // 0 = normal, 1 = permanent timeshift
1493        int timeshifttype;
1494        // position in timeshiftfile to seek
1495        off64_t timeshiftpos;
1496        // ask if timeshift is running and switch channel
1497        int asktimeshift;
1498        // ts playing running = 1
1499        int playing;
1500        // if set to a skin (screenpointer) only this screen has rc
1501        struct skin* rcowner;
1502        struct skin* rcstandby;
1503        // timerstuktur fuer autores
1504        struct stimerthread* restimer;
1505        // spindown USB/HDD
1506        struct hddparm hdd[3];
1507        struct stimerthread* addhddall;
1508        // save old rotor position
1509        int rotoroldorbitalpos;
1510        // security check
1511        int security;
1512        // set to 1 if tvpic size is changed
1513        int tvpic;
1514        // timestamp for rc action
1515        time_t lastrcaction;
1516        // show timeline in channellist for each channel
1517        int showchanneltimeline;
1518        // see player.h for details
1519        int playercan;
1520                //Code von infobar.h aktiv = 1
1521        int infobaraktiv;
1522        //Name der Datei die abgespielt wird
1523        char* playfile;
1524        //Code MC aktiv = 1
1525        int mcaktiv;
1526        //greater 0 aktivate screen animation
1527        int screenanim;
1528        int screenanimspeed;
1529        //for auto increase audio vol
1530        int volautochange;
1531        int volautochangevalue;
1532        //for powerofftimer
1533        time_t fixpowerofftime;
1534        //for write FB in File
1535        int write_png;
1536        int write_jpg;
1537        //holds oversize value for blitter
1538        int leftoffset;
1539        int rightoffset;
1540        int topoffset;
1541        int bottomoffset;
1542        //background picture for all screens
1543        char* bgpic;
1544        //time for next picmem timeout check
1545        time_t picmemtimeout;
1546        time_t defpicmemtimeout;
1547        //show not tunable channel hidden (0)) or deaktive (1) in channellist
1548        int channellistview;
1549        //for blockmove in channellist
1550        int moveblockcount;
1551        //name ob file who played from webig
1552        char* webplayfile;
1553        //status of mediadbthread
1554        int mediadbthreadstatus;
1555        //for save mediadb in scan
1556        time_t mediadbsavetime;
1557        //colors / pic for selection
1558        long markcol;
1559        long filelistselectcol;
1560        long listboxselectcol;
1561        char* selectpic;
1562        //check if cam can decrypt channel
1563        int checkcamdecrypt;
1564        //don't send privat part of cadescriptor in capmt
1565        int caskipprivat;
1566        //send all caids or only caids cam can
1567        int casendallcaids;
1568        //show hidden files in filelist
1569        int showhiddenfiles;
1570        //mediadb
1571        int mediadbfiles;
1572        //show infobar on program change
1573        int infobarprogram;
1574        //for auto increase audio vol (mute)
1575        int volmute;
1576        int secondzap;
1577        //pointer to marker for recordings
1578        struct marker* playmarker;
1579        int autosubtitle;
1580        //save timeshift start time
1581        time_t timeshiftstart;
1582        int crosscontrol;
1583        int autochangechannelname;
1584        //tuxtext is running
1585        int tuxtxt;
1586        //on some fat32 hdd it takes very long to get free size
1587        int showrecfreesize;
1588        int firstunicablewait;
1589        //path for imdbfolder
1590        char* imdbfolderpath;
1591        int virtualzap;
1592        int fontsizeadjust;
1593        //count for drawing screen
1594        unsigned int drawscreencount;
1595        int autoseek;
1596        //skip all rc input events older than this value in millisec
1597        int rcskipms;
1598        //Workaround da ansonsten DVR4 nicht funktioniert (Treiberproblem)
1599        int setdvr0;
1600#ifdef MIPSEL
1601        //cec mipsel
1602        int cec_fixedAddress;
1603        int hdmiFd;
1604        int webencode;
1605#endif
1606        //pip Einstellungen
1607        int pipzap;
1608        // guest
1609        int whilecount;
1610        int sleepcount;
1611        int stats;
1612        char* url;
1613        //externer plugin Aufruf
1614        char* extplugin;
1615        //node oled blinken
1616        int skinblink;
1617        //BCM accel interface
1618        int bcm;
1619        //Volume
1620        int volume;
1621        int screenshot;
1622        // cacc
1623        int certchecked;
1624        int certok;
1625        int liveslot;
1626} status;
1627
1628struct fb
1629{
1630        int dev;
1631        char *name;
1632        int fd;
1633        unsigned char *fb;
1634        unsigned long *fblong;
1635        int width;
1636        int height;
1637        int pitch;
1638        unsigned long fixfbsize;
1639        unsigned long varfbsize;
1640        int colbytes;
1641        unsigned long data_phys;
1642        struct fb *next;
1643};
1644
1645struct rc
1646{
1647        int key;
1648        void (*rcfunc)(struct skin*, struct skin*, int screencalc, int filelistview, int flag);
1649        struct skin *screen;
1650        struct skin *screennode;
1651        struct skin *owner;
1652        struct rc *next;
1653};
1654
1655struct clist
1656{
1657        char *key;
1658        char *value;
1659        char *def;
1660        char *tmp;
1661        struct clist *next;
1662};
1663
1664struct bouquet
1665{
1666        int nr;
1667        int serviceid;
1668        uint64_t transponderid;
1669        struct channel *channel;
1670        struct bouquet *prev;
1671        struct bouquet *next;
1672};
1673
1674struct channelslot
1675{
1676        int slot;
1677        int serviceid;
1678        uint64_t transponderid;
1679        struct channelslot *next;
1680};
1681
1682struct mainbouquet
1683{
1684        char *name;
1685        int type;
1686        char *filename;
1687        struct bouquet *bouquet;
1688        struct mainbouquet *prev;
1689        struct mainbouquet *next;
1690};
1691
1692struct pic
1693{
1694        char* name;
1695        unsigned char* picbuf;
1696        // < 0 when picbuf is normal mem (hw jpg)
1697        int memfd;
1698        unsigned long width;
1699        unsigned long height;
1700        unsigned long rowbytes;
1701        int channels;
1702  int timeout;
1703  time_t lastaccess;
1704        int del;
1705        struct pic* next;
1706};
1707
1708struct font
1709{
1710        char *name;
1711        FT_Error error;
1712        FTC_Manager manager;
1713        FTC_SBitCache cache;
1714        FTC_ImageTypeRec desc;
1715        FT_Face face;
1716        FT_UInt prev_glyphindex;
1717        FT_Bool use_kerning;
1718        struct font *next;
1719};
1720
1721//structure for write fb to File
1722struct writeFBfile
1723{
1724        unsigned char* ActBuf;
1725        unsigned char* buf1;
1726        unsigned char* buf2;
1727} writeFBfile;
1728
1729struct eit
1730{
1731        u_char table_id                               /*:8*/;
1732        u_char section_length_hi                      :4;
1733        u_char                                        :3;
1734        u_char section_syntax_indicator               :1;
1735        u_char section_length_lo                      /*:8*/;
1736        u_char service_id_hi                          /*:8*/;
1737        u_char service_id_lo                          /*:8*/;
1738        u_char current_next_indicator                 :1;
1739        u_char version_number                         :5;
1740        u_char                                        :2;
1741        u_char section_number                         /*:8*/;
1742        u_char last_section_number                    /*:8*/;
1743        u_char transport_stream_id_hi                 /*:8*/;
1744        u_char transport_stream_id_lo                 /*:8*/;
1745        u_char original_network_id_hi                 /*:8*/;
1746        u_char original_network_id_lo                 /*:8*/;
1747        u_char segment_last_section_number            /*:8*/;
1748        u_char segment_last_table_id                  /*:8*/;
1749        u_char data[]; /* struct eitevent */
1750};
1751#define EITLEN sizeof(struct eit)
1752#define GETEITSECLEN(x) HILO(((struct eit*)(x))->section_length)
1753
1754struct eitevent
1755{
1756        u_char event_id_hi                            /*:8*/;
1757        u_char event_id_lo                            /*:8*/;
1758        u_char mjd_hi                                 /*:8*/;
1759        u_char mjd_lo                                 /*:8*/;
1760        u_char start_time_h                           /*:8*/;
1761        u_char start_time_m                           /*:8*/;
1762        u_char start_time_s                           /*:8*/;
1763        u_char duration_h                             /*:8*/;
1764        u_char duration_m                             /*:8*/;
1765        u_char duration_s                             /*:8*/;
1766        u_char descriptors_loop_length_hi             :4;
1767        u_char free_ca_mode                           :1;
1768        u_char running_status                         :3;
1769        u_char descriptors_loop_length_lo             /*:8*/;
1770        u_char data[];
1771};
1772#define EITEVENTLEN sizeof(struct eitevent)
1773#define GETEITDESCLEN(x) HILO(((struct eitevent *)x)->descriptors_loop_length)
1774
1775struct eitshortevent
1776{
1777        u_char descriptor_tag                         /*:8*/;
1778        u_char descriptor_length                      /*:8*/;
1779        u_char lang_code1                             /*:8*/;
1780        u_char lang_code2                             /*:8*/;
1781        u_char lang_code3                             /*:8*/;
1782        u_char event_name_length                      /*:8*/;
1783        u_char data[];
1784};
1785#define EITSHORTEVENTLEN sizeof(struct eitshortevent)
1786
1787struct eitlongevent
1788{
1789        u_char descriptor_tag                         /*:8*/;
1790        u_char descriptor_length                      /*:8*/;
1791        u_char last_descriptor_number                 :4;
1792        u_char descriptor_number                      :4;
1793        u_char lang_code1                             /*:8*/;
1794        u_char lang_code2                             /*:8*/;
1795        u_char lang_code3                             /*:8*/;
1796        u_char length_of_items                        /*:8*/;
1797        u_char data[]; /* struct eitlongeventitem */
1798};
1799#define EITLONGEVENTLEN sizeof(struct eitlongevent)
1800
1801struct eitlongeventitem
1802{
1803        u_char item_description_length               /*:8*/;
1804        u_char data[];
1805};
1806#define EITLONGEVENTITEMLEN sizeof(struct eitlongeventitem)
1807
1808struct eitlinkage
1809{
1810        u_char descriptor_tag                 /*:8*/;
1811        u_char descriptor_length              /*:8*/;
1812        u_char transport_stream_id_hi         /*:8*/;
1813        u_char transport_stream_id_lo         /*:8*/;
1814        u_char original_network_id_hi         /*:8*/;
1815        u_char original_network_id_lo         /*:8*/;
1816        u_char service_id_hi                  /*:8*/;
1817        u_char service_id_lo                  /*:8*/;
1818        u_char linkage_type                   /*:8*/;
1819};
1820#define EITLLINKAGELEN sizeof(struct eitlinkage)
1821
1822struct parentalrating
1823{
1824        u_char descriptor_tag                 /*:8*/;
1825        u_char descriptor_length              /*:8*/;
1826        u_char data[]; //struct parental_rating_item
1827};
1828#define PARENTALRATINGLEN sizeof(struct parentalrating)
1829
1830struct parentalratingitem
1831{
1832        u_char lang_code1                    /*:8*/;
1833        u_char lang_code2                    /*:8*/;
1834        u_char lang_code3                    /*:8*/;
1835        u_char rating                        /*:8*/;
1836};
1837#define PARENTALRATINGITEMLEN sizeof(struct parentalratingitem)
1838
1839struct rst //table id 0x71
1840{
1841        u_char table_id                     /*:8*/;
1842        u_char section_syntax_indicator         :1;
1843        u_char reserved_1                       :1;
1844        u_char reserved_2                       :2;
1845        u_int section_length                   :12;
1846};
1847#define RSTLEN sizeof(struct rst)
1848
1849struct rstitem
1850{
1851        u_char transponder_stream_id_hi     /*:8*/;
1852        u_char transponder_stream_id_lo     /*:8*/;
1853        u_char original_network_id_hi       /*:8*/;
1854        u_char original_network_id_lo       /*:8*/;
1855        u_char service_id_hi                /*:8*/;
1856        u_char service_id_lo                /*:8*/;
1857        u_char event_id_hi                  /*:8*/;
1858        u_char event_id_lo                  /*:8*/;
1859        u_char reserved_1                       :5;
1860        u_char running_status                   :3;
1861};
1862#define RSTITEMLEN sizeof(struct rstitem)
1863
1864struct mhwchannel
1865{
1866        u_char  network_id_hi;
1867        u_char  network_id_lo;
1868        u_char  transponder_id_hi;
1869        u_char  transponder_id_lo;
1870        u_char  channel_id_hi;
1871        u_char  channel_id_lo;
1872        u_char  name[16];
1873};
1874#define MHWCHANNELLEN sizeof(struct mhwchannel)
1875
1876struct mhwtitle
1877{
1878        u_char table_id                       :8;
1879        u_char section_length_hi              :4;
1880        u_char                                :2;
1881        u_char dummy                          :1;
1882        u_char section_syntax_indicator       :1;
1883        u_char section_length_lo              :8;
1884        u_char channel_id                     :8;
1885        u_char theme_id                       :8;
1886        u_char hours                                  :5;
1887        u_char day                            :3;
1888        u_char summary_available              :1;
1889        u_char                                      :1;
1890        u_char minutes                        :6;
1891        u_char                                :8;
1892        u_char                                :8;
1893        u_char duration_hi                    :8;
1894        u_char duration_lo                    :8;
1895        u_char title                          [23];
1896        u_char ppv_id_hi                      :8;
1897        u_char ppv_id_mh                      :8;
1898        u_char ppv_id_ml                      :8;
1899        u_char ppv_id_lo                      :8;
1900        u_char program_id_hi                  :8;
1901        u_char program_id_mh                  :8;
1902        u_char program_id_ml                  :8;
1903        u_char program_id_lo                  :8;
1904        u_char                                :8;
1905        u_char                                :8;
1906        u_char                                :8;
1907        u_char                                :8;
1908};
1909#define MHWTITLELEN sizeof(struct mhwtitle)
1910
1911struct mhwsummary
1912{
1913        u_char table_id                       :8;
1914        u_char section_length_hi              :4;
1915        u_char                                :2;
1916        u_char dummy                          :1;
1917        u_char section_syntax_indicator       :1;
1918        u_char section_length_lo              :8;
1919        u_char program_id_hi                  :8;
1920        u_char program_id_mh                  :8;
1921        u_char program_id_ml                  :8;
1922        u_char program_id_lo                  :8;
1923        u_char                                :8;
1924        u_char                                :8;
1925        u_char                                :8;
1926        u_char nb_replays                     :8;
1927};
1928#define MHWSUMMARYLEN sizeof(struct mhwsummary)
1929
1930struct mhw2channel
1931{
1932        u_char network_id_hi;
1933        u_char network_id_lo;
1934        u_char transponder_id_hi;
1935        u_char transponder_id_lo;
1936        u_char channel_id_hi;
1937        u_char channel_id_lo;
1938        u_char                                :8;
1939        u_char                                :8;
1940};
1941
1942struct extepgcache
1943{
1944        long id;
1945        struct epg* epgnode;
1946        struct extepgcache* next;
1947};
1948
1949struct extepgchannel
1950{
1951        long id;
1952        int serviceid;
1953        uint64_t transponderid;
1954        struct extepgchannel* next;
1955};
1956
1957struct extepgconfig
1958{
1959        uint64_t transponderid;
1960        int type;
1961        char* file;
1962        int channelpid;
1963        int titlepid[8];
1964        int summarypid[8];
1965        struct extepgconfig* next;
1966};
1967
1968struct blacklist
1969{
1970  char* file;
1971  struct splitstr* splitstr;
1972  int count;
1973};
1974
1975typedef struct sci_modes
1976{
1977        int emv2000;
1978        int dma;
1979        int man_act;
1980        int rw_mode;
1981} scimodes;
1982
1983typedef struct sci_parameters
1984{
1985        u_char T;
1986        unsigned long fs;
1987        unsigned long ETU;
1988        unsigned long WWT;
1989        unsigned long CWT;
1990        unsigned long BWT;
1991        unsigned long EGT;
1992        unsigned long clock_stop_polarity;
1993        u_char check;
1994        u_char P;
1995        u_char I;
1996        u_char U;
1997} sciparameters;
1998
1999struct update
2000{
2001        char* auth;
2002        char* type;
2003        char* skinname;
2004        char* filemask;
2005        char* filepath;
2006        int imgtype;
2007};
2008
2009#ifdef EPLAYER4
2010typedef enum { stUnknown, stPlainText, stSSA, stASS, stSRT, stVOB, stPGS } subtype_t;
2011typedef enum {atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC, atWMA} audiotype_t;
2012typedef struct _CustomData {
2013//typedef struct CustomData {
2014  GstElement *playbin2;   /* Our one and only element */
2015   
2016  gint n_video;          /* Number of embedded video streams */
2017  gint n_audio;          /* Number of embedded audio streams */
2018  gint n_text;           /* Number of embedded subtitle streams */
2019   
2020  gint current_video;    /* Currently playing video stream */
2021  gint current_audio;    /* Currently playing audio stream */
2022  gint current_text;     /* Currently playing subtitle stream */
2023
2024  gboolean is_live;
2025  GstElement *pipeline;
2026  GMainLoop *loop;
2027} CustomData;
2028
2029typedef enum {
2030        GST_PLAY_FLAG_VIDEO = (1 << 0),
2031        GST_PLAY_FLAG_AUDIO = (1 << 1),
2032        GST_PLAY_FLAG_TEXT = (1 << 2),
2033        GST_PLAY_FLAG_NATIVE_VIDEO = (1 << 3)
2034} GstPlayFlags;
2035#endif
2036
2037#ifdef MIPSEL
2038//fuer cec Mipsel
2039struct cec_message
2040{
2041unsigned char address;
2042unsigned char length;
2043unsigned char data[256];
2044}__attribute__((packed));
2045
2046unsigned char cec_physicalAddress[2];
2047unsigned char cec_logicalAddress;
2048unsigned char cec_deviceType;
2049
2050#endif
2051
2052// cacc
2053/* CI+ certificates */
2054
2055struct cert_ctx {
2056        X509_STORE *store;
2057
2058        /* Host */
2059        X509 *cust_cert;
2060        X509 *device_cert;
2061
2062        /* Module */
2063        X509 *ci_cust_cert;
2064        X509 *ci_device_cert;
2065};
2066
2067#ifdef MIPSEL1
2068enum ca_descr_data_type {
2069        CA_DATA_IV,
2070        CA_DATA_KEY,
2071};
2072
2073enum ca_descr_parity {
2074        CA_PARITY_EVEN,
2075        CA_PARITY_ODD,
2076};
2077
2078struct ca_descr_data {
2079        unsigned int index;
2080        enum ca_descr_parity parity;
2081        enum ca_descr_data_type data_type;
2082        unsigned int length;
2083        unsigned char *data;
2084};
2085
2086#endif
2087
2088struct aes_xcbc_mac_ctx {
2089        uint8_t K[3][16];
2090        uint8_t IV[16];
2091        AES_KEY key;
2092        int buflen;
2093};
2094
2095uint32_t datatype_sizes[MAX_ELEMENTS] = {
2096        0, 50, 0, 0, 0, 8, 8, 0,
2097        0, 0, 0, 0, 32, 256, 256, 0,
2098        0, 256, 256, 32, 8, 8, 32, 32,
2099        0, 8, 2, 32, 1, 32, 1, 0,
2100        32
2101};
2102
2103struct element {
2104        uint8_t *data;
2105        uint32_t size;
2106        /* buffer valid */
2107        int valid;
2108};
2109
2110struct cc_ctrl_data {
2111        /* parent */
2112        struct caslot* slot;
2113
2114        /* ci+ credentials */
2115        struct element elements[MAX_ELEMENTS];
2116
2117        /* DHSK */
2118        uint8_t dhsk[256];
2119
2120        /* KS_host */
2121        uint8_t ks_host[32];
2122
2123        /* derived keys */
2124        uint8_t sek[16];
2125        uint8_t sak[16];
2126
2127        /* AKH checks - module performs 5 tries to get correct AKH */
2128        unsigned int akh_index;
2129
2130        /* authentication data */
2131        uint8_t dh_exp[256];
2132
2133        /* certificates */
2134        struct cert_ctx *cert_ctx;
2135
2136        /* private key of device-cert */
2137        RSA *rsa_device_key;
2138};
2139
2140#endif
Note: See TracBrowser for help on using the repository browser.