source: titan/titan/struct.h @ 43667

Last change on this file since 43667 was 43621, checked in by gost, 5 years ago

[titan] add unicable2 products

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