source: titan/titan/struct.h @ 45027

Last change on this file since 45027 was 45027, checked in by obi, 3 years ago

build STABLE=45027 v1.93

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