source: titan/titan/struct.h @ 39578

Last change on this file since 39578 was 39294, checked in by obi, 7 years ago

fix

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